Skip to content

[web] Correct --web-content-hash docs against shipped Flutter 3.50.0 - #14088

Merged
conooi merged 4 commits into
mainfrom
web-content-hash-3-50
Nov 17, 2026
Merged

conooi merged 4 commits into
mainfrom
web-content-hash-3-50

Conversation

@kevmoo

@kevmoo kevmoo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Description of what this PR is changing or adding, and why:

Corrects the --web-content-hash docs from #13986 to match the implementation shipped in Flutter 3.50.0 (ab2912035e).

  • canvaskit/** is always copied unhashed into build/web, not only with --no-web-resources-cdn. Adds a note that the default runtime loads CanvasKit/Skwasm from the versioned gstatic CDN, and that a self-hosted canvaskit/** must never be served immutable.
  • Lists the manifest the web runtime actually loads, AssetManifest.bin.<hash>.json, and states that AssetManifest.json is not emitted.
  • Relaxes the index.html requirement in initialization.md: only a custom web/flutter_bootstrap.js needs {{flutter_build_config}}; index.html just has to load flutter_bootstrap.js.
  • Adds the hashed filename rule, that the flag works in debug/profile/release, the template build errors, the hardcoded assets/... URL 404 caveat, and precache_manifest.json URL format and exclusions.
  • Completes the unhashed-files row (flutter.js.map, flutter_service_worker.js, precache_manifest.json, favicon.png, other web/ files).

Issues fixed by this PR (if any):

PRs or commits this PR depends on (if any):

Presubmit checklist

  • If you are unwilling, or unable, to sign the CLA, even for a tiny, one-word PR, please file an issue instead of a PR.
  • If this PR is not meant to land until a future stable release, mark it as draft with an explanation.
  • This PR follows the Google Developer Documentation Style Guidelines—for example, it doesn't use i.e. or e.g., and it avoids I and we (first-person pronouns).
  • This PR uses semantic line breaks
    of 80 characters or fewer.

@kevmoo
kevmoo requested review from a team and sfshaza2 as code owners November 16, 2026 17:45

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for Flutter's --web-content-hash flag, detailing how hashes are applied to compiled entrypoints and assets, how they are recorded in the bootstrap configuration, and the implications for asset loading and build failures. The review feedback suggests two improvements for accuracy: clarifying that the emitted AssetManifest files are also content-hashed to prevent 404 errors, and noting that the build check succeeds if web/index.html inlines flutter_bootstrap.js instead of just loading it.

@flutter-website-bot

flutter-website-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

@kevmoo

kevmoo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

CC @conooi

@flutter-website-bot

Copy link
Copy Markdown
Collaborator

@conooi
conooi self-requested a review November 16, 2026 20:05
@kevmoo
kevmoo requested a review from conooi November 17, 2026 18:29
@conooi
conooi merged commit ca84425 into main Nov 17, 2026
14 checks passed
@conooi
conooi deleted the web-content-hash-3-50 branch November 17, 2026 21:26
MrZaKaRiA pushed a commit to MrZaKaRiA/flutter that referenced this pull request Nov 20, 2026
… and canvaskit (flutter#196908)

Updates the "Serving tip" that `flutter build web --web-content-hash`
prints so it matches what the build actually hashes:

- Says that everything under `assets/` is hashed and safe to cache as
`immutable`, not just the `main.dart.<hash>.*` entrypoints.
- Warns about `canvaskit/` in every build, not only with
`--no-web-resources-cdn`. `WebBuiltInAssets` always copies
`canvaskit/**` into `build/web` without hashes, so a broad host rule
such as `**/*.wasm → immutable` would catch a self-hosted `skwasm.wasm`.
- Links straight to
https://docs.flutter.dev/deployment/web#web-content-hashing.
- Removes the stale TODO waiting on flutter/website#13825. The docs
landed in flutter/website#13986 and flutter/website#14088, and the flag
is staying opt-in.

Build behavior is unchanged. Only the printed message and its test
change.

Part of flutter#149031

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[flutter/website]: https://github.com/flutter/website
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants