Skip to content

[web] Fix deferred loading with wasm - #190140

Merged
mkustermann merged 2 commits into
flutter:masterfrom
mkustermann:deferred-loading-fix
Jul 29, 2026
Merged

mkustermann merged 2 commits into
flutter:masterfrom
mkustermann:deferred-loading-fix

Conversation

@mkustermann

Copy link
Copy Markdown
Member

It seemed deferred loading via the recently added ([0]) --enable-wasm-deferred-loading never really worked.

The embedder (flutter in this case) needs to invoke the callback function with either the wasm module bytes or a response object (which is a stream of bytes).

Currently it invokes it with a promise of a response object which does not work atm.

[0] 80157ee

It seemed deferred loading via the recently added ([0])
`--enable-wasm-deferred-loading` never really worked.

The embedder (flutter in this case) needs to invoke the callback
function with either the wasm module bytes or a response object (which
is a stream of bytes).

Currently it invokes it with a promise of a response object which does
not work atm.

[0] flutter/flutter@80157ee
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 28, 2026
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team labels Jul 28, 2026
@mkustermann
mkustermann requested a review from biggs0125 July 28, 2026 13:19

@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 introduces integration tests for deferred loading on the web (both with and without WebAssembly) and updates the entrypoint loader to resolve the fetch response before passing it to handleModule. Feedback suggests checking the fetch response status (response.ok) and throwing a descriptive error to avoid cryptic WebAssembly compilation errors when a module fails to load.

@flutter flutter deleted a comment from gemini-code-assist Bot Jul 28, 2026
biggs0125
biggs0125 previously approved these changes Jul 28, 2026

@biggs0125 biggs0125 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.

Thanks!

harryterkelsen
harryterkelsen previously approved these changes Jul 28, 2026

@harryterkelsen harryterkelsen 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.

LGTM

@mkustermann
mkustermann enabled auto-merge July 28, 2026 19:36
@mkustermann
mkustermann dismissed stale reviews from harryterkelsen and biggs0125 via 482bfde July 29, 2026 07:49
@mkustermann
mkustermann added this pull request to the merge queue Jul 29, 2026
Merged via the queue into flutter:master with commit 2e990fe Jul 29, 2026
16 of 17 checks passed
@mkustermann
mkustermann deleted the deferred-loading-fix branch July 29, 2026 15:55
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Aug 8, 2026
…12393)

Manual roll requested by [email protected]

flutter/flutter@2a230d1...2757a77

2026-07-29 [email protected] Roll Skia from 3ae9e364d30b to 0f35bba4945c (2 revisions) (flutter/flutter#190215)
2026-07-29 [email protected] [web] Fix deferred loading with wasm (flutter/flutter#190140)
2026-07-29 [email protected] Roll Dart SDK from 1bbaacba6a5a to 43f7de5f4977 (1 revision) (flutter/flutter#190211)
2026-07-29 [email protected] Roll Skia from 119cae396625 to 3ae9e364d30b (6 revisions) (flutter/flutter#190208)
2026-07-29 [email protected] [Win32] Ignore mouse move events without capture when dragging (flutter/flutter#190029)
2026-07-29 [email protected] Roll Dart SDK from 49c637261348 to 1bbaacba6a5a (7 revisions) (flutter/flutter#190196)
2026-07-29 [email protected] Roll Skia from 30ad01017a46 to 119cae396625 (2 revisions) (flutter/flutter#190183)
2026-07-29 [email protected] Fix NestedScrollView example crash when switching tabs on desktop (flutter/flutter#186993)
2026-07-29 [email protected] Roll Fuchsia Linux SDK from OZkZC_2CZ_G5rbMIS... to J8rVTlBnjnUpuHYk3... (flutter/flutter#190174)
2026-07-29 [email protected] Update widget location tracking to use the new generalized api (flutter/flutter#189725)
2026-07-29 [email protected] Avoid unnecessary work in `BoxDecoration` and `RenderPhysicalModel` (flutter/flutter#187891)
2026-07-29 [email protected] Fix web context-menu client lifecycle in SelectableRegion (flutter/flutter#189587)
2026-07-29 [email protected] Roll Skia from 70733f74d415 to 30ad01017a46 (2 revisions) (flutter/flutter#190173)
2026-07-29 [email protected] Manual roll of Dart from 28e63ac22d8d to 49c637261348 (flutter/flutter#190158)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants