-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Add support to the flutter tool to compile against the skwasm renderer #124296
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
yjbanov
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.
| canvaskit, | ||
| /// Always uses html. | ||
| html, | ||
| /// Always use skwasm. |
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.
nit: the above options say "uses"
| resolve({ | ||
| "skwasm": skwasmInstance.asm, | ||
| "ffi": { | ||
| "memory": skwasmInstance.wasmMemory, |
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.
nit: use single-quote for consistency
| serviceWorkerStrategy: kNoneWorker, | ||
| sourceMaps: true, | ||
| nativeNullAssertions:debuggingOptions.nativeNullAssertions, | ||
| isWasm: false, |
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.
Nice! We crossed the threshold of the reasonable number of positional arguments a while ago.
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.
I think this is the change that actually conflicts with Kevin's change, so I'm probably going to go with his changes because they are a little more flexible.
| moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, imports); | ||
| } catch (exception) { | ||
| console.error(`Failed to fetch and instantiate wasm module: ${exception}`); | ||
| console.error(`Failed to fetch and instantiate wasm module: \${exception}`); |
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.
Wow, how did this compile before? I don't see a variable named exception in scope 🤔
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.
In this PR, we changed this from a raw string literal (i.e. r''') to a multi-line string literal (i.e. ''') so we didn't need to escape before. We are doing string interpolation depending on whether you are going to actually import skwasm or not, so we needed to switch away from the raw string literal and escape any $ in the document.
|
I broke you. But I think you'll like where we end up! |
flutter#124296) Add support to the flutter tool to compile against the skwasm renderer

This allows the flutter tool to compile against the skwasm renderer, and changes our bootstrapping code to link the skwasm module. The resulting application doesn't actually work yet, but this sets us up to further iterate as more skwasm APIs are implemented.