Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP-stable]Reland (x2) "Output .js files as ES6 modules. (flutter#52023)" #54446

Conversation

flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Aug 8, 2024

This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

Issue Link:

What is the link to the issue this cherry-pick is addressing?

Changelog Description:

Fixes the loading of CanvasKit in a way that avoids app crashes and timeout issues.

Impact Description:

When CanvasKit is downloaded from the network (not cached), there's a high likelihood that the app crashes and displays a blank screen.

Workaround:

If the browser cache is enabled, users can refresh the page to get CanvasKit from cache and avoid the issue.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

  • Run a sample flutter app using --web-renderer=canvaskit.
  • In Chrome's Network tab, check the Disable cache checkbox.
  • Reload the app a few times and make sure it's working and there are no errors in the console.

…er#53718)

Second attempt to reland flutter#52023

Fixes since the previous reland attempt:
* We need to pass the skwasm main JS URI when loading the module so that it can pass that along to the worker. Since the worker uses the workaround to allow a cross script worker, it has trouble locating the main JS URI in relation to itself in a way that actually works for dynamic imports, so passing it along fixes that issue.
* Some of the Google3 tests relied on the relative default canvaskit path. Dynamic module imports seems to not handle relative paths the way we expect, so we do our own URL resolution using the URL constructor before passing it into the dynamic import API. Also cleaned up some of the other relative pathing stuff that we do around the base URI. in flutter.js
@flutteractionsbot flutteractionsbot added the cp: review add the cp request to the review queue of release engineers label Aug 8, 2024
@flutteractionsbot
Copy link
Author

@mdebbar please fill out the PR description above, afterwards the release team will review this request.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Aug 8, 2024
@jezell
Copy link
Contributor

jezell commented Aug 8, 2024

@kevmoo seems like this might also impact issues from #153077 #152995. Maybe closes them out as well?

@jezell
Copy link
Contributor

jezell commented Aug 8, 2024

@itsjustkevin itsjustkevin added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 14, 2024
@auto-submit auto-submit bot merged commit 46c417b into flutter:flutter-3.24-candidate.0 Aug 14, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App cp: review add the cp request to the review queue of release engineers platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants