You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initial WasmGC support has landed in the spec and our compiler can rely on everything in it. Though the wasm spec will be evolving over time and we want to be able to take advantage of newer features. In many cases it may not be possible to polyfill those features (e.g. usage of new instructions, new builtins that aren't polyfillable, etc).
Because of this I'd like to us to introduce a support detection mechanism that users can call to detect if their environment allows running dart2wasm compiled code.
One way could be to make this part of the public API of our <app>.mjs e.g.
constbundle=awaitimport('app.mjs');if(bundle.supportsCurrentEnvironment()){constcompiledApp=awaitbundle.compileStreaming(fetch('app.wasm');constappInstance=awaitcompiledApp.instantiate(...);appInstance.invokeMain();}else{// fall back to JS}
The downside of making this part of the <app>.mjs file is that users first have to load the mjs file (which may not be that small) in order to detect whether the wasm can be used before loading the actual wasm file (or loading the wasm file concurrently but possibly not use it).
Then we as Dart team can decide when we start requiring new things (based on data of browser support and browser version usages out there) and/or allow the invoker of dart2wasm to tell us to use newer features.
The initial WasmGC support has landed in the spec and our compiler can rely on everything in it. Though the wasm spec will be evolving over time and we want to be able to take advantage of newer features. In many cases it may not be possible to polyfill those features (e.g. usage of new instructions, new builtins that aren't polyfillable, etc).
Because of this I'd like to us to introduce a support detection mechanism that users can call to detect if their environment allows running dart2wasm compiled code.
One way could be to make this part of the public API of our
<app>.mjs
e.g.The downside of making this part of the
<app>.mjs
file is that users first have to load the mjs file (which may not be that small) in order to detect whether the wasm can be used before loading the actual wasm file (or loading the wasm file concurrently but possibly not use it).So we could also emit an extra file
that has such an API function in it.
Then we as Dart team can decide when we start requiring new things (based on data of browser support and browser version usages out there) and/or allow the invoker of dart2wasm to tell us to use newer features.
/cc @osa1
/cc @kevmoo
/cc @yjbanov @eyebrowsoffire what mechanism would work best for flutter?
The text was updated successfully, but these errors were encountered: