-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add dynamic module loader to flutter wasm entrypoint script. #169313
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
319ba50 to
41b2a5f
Compare
sigmundch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
| loadDynamicModule: async (wasmUri, mjsUri) => { | ||
| const wasmBytes = fetch(resolveUrlWithSegments(wasmUri)); | ||
| let mjsRuntimeUri = resolveUrlWithSegments(entrypointBaseUrl, mjsUri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some documentation about this that I can look at? I'm trying to understand why mjsUri is prefixed by entrypointBaseUrl but not wasmUri.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call out, thanks! During local testing this worked without that but the paths are probably simpler in that environment.
I went ahead and added the entrypointBaseUrl since the URL generated should have the same format as that of the main module which also uses entrypointBaseUrl.
Documentation on this input here: https://github.com/dart-lang/sdk/blob/main/pkg/dart2wasm/lib/js/runtime_blob.dart#L54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay, that makes more sense :)
Thanks for the link!
b022943 to
77f22b6
Compare
| loadDynamicModule: async (wasmUri, mjsUri) => { | ||
| const wasmBytes = fetch(resolveUrlWithSegments(wasmUri)); | ||
| let mjsRuntimeUri = resolveUrlWithSegments(entrypointBaseUrl, mjsUri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay, that makes more sense :)
Thanks for the link!
Pull Request is not mergeable
Adds support for loading dynamic module files to the Flutter wasm entrypoint script. The Dart SDK already tries to import this function when dynamic modules are enabled.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.