Skip to content

Add support to the flutter tool to compile against the skwasm renderer - #124296

Merged
auto-submit[bot] merged 16 commits into
flutter:masterfrom
eyebrowsoffire:skwasm
Apr 10, 2023
Merged

auto-submit[bot] merged 16 commits into
flutter:masterfrom
eyebrowsoffire:skwasm

Conversation

@eyebrowsoffire

Copy link
Copy Markdown
Contributor

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.

@flutter-dashboard flutter-dashboard Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 6, 2023

@yjbanov yjbanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

canvaskit,
/// Always uses html.
html,
/// Always use skwasm.

Copy link
Copy Markdown
Contributor

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,

Copy link
Copy Markdown
Contributor

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,

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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}`);

Copy link
Copy Markdown
Contributor

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 🤔

Copy link
Copy Markdown
Contributor Author

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.

@kevmoo

kevmoo commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

I broke you. But I think you'll like where we end up!

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 10, 2023
@auto-submit
auto-submit Bot merged commit 07b89da into flutter:master Apr 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 10, 2023
exaby73 pushed a commit to exaby73/flutter_nevercode that referenced this pull request Apr 17, 2023
flutter#124296)

Add support to the flutter tool to compile against the skwasm renderer
@eyebrowsoffire
eyebrowsoffire deleted the skwasm branch December 12, 2025 21:56
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 tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants