Add dynamic module loader to flutter wasm entrypoint script.#169313
Add dynamic module loader to flutter wasm entrypoint script.#169313biggs0125 merged 4 commits intoflutter:masterfrom
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
| loadDynamicModule: async (wasmUri, mjsUri) => { | ||
| const wasmBytes = fetch(resolveUrlWithSegments(wasmUri)); | ||
| let mjsRuntimeUri = resolveUrlWithSegments(entrypointBaseUrl, mjsUri); |
There was a problem hiding this comment.
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.
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.
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.
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.