Skip to content

Update WebAssembly compilation docs for Dart 3.14 - #7566

Merged
conooi merged 5 commits into
dart-lang:mainfrom
conooi:fix-7558-wasm-docs
Oct 16, 2026
Merged

conooi merged 5 commits into
dart-lang:mainfrom
conooi:fix-7558-wasm-docs

Conversation

@conooi

@conooi conooi commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Updates the WebAssembly compilation documentation on dart.dev for Dart 3.14.

Fixes #7558.

Summary of changes

  • src/content/web/wasm.md (/web/wasm):
    • Document the three WebAssembly proposals targeted by dart2wasm (WasmGC, JS String Builtins (wasm:js-string), and Phase 4 Exception Handling (try_table and exnref)) along with minimum browser versions (Chrome/Edge 137+, Safari 26.2+, and Firefox 134+ / 155+ recommended).
    • Document --standalone for non-web WASI runtimes (such as Wasmtime 39+ with -W gc,exceptions,function-references=y) and note that dart:js_interop is disallowed when --standalone is set.
    • Document dart.library.isolate conditional-import behavior (false in dart2wasm, matching dart2js and ddc) and native 128-bit v128 SIMD support for dart:typed_data SIMD types.
    • Update the dart help compile wasm CLI output with -O0..-O4, --[no-]minify, --[no-]strip-wasm, --[no-]enable-deferred-loading, --standalone, and --[no-]deprecated-js-interop.
    • Remove outdated "preview" wording and replace the 2023 GitHub gist bootstrap step with importing the compiler-generated site/main.mjs runtime (compileStreaming + instantiate + invokeMain).
  • src/content/tools/dart-compile.md (/tools/dart-compile#wasm):
    • Update the wasm subcommand summary to mention the companion .mjs runtime and add a dart compile wasm options table (-O<0|1|2|3|4>, --[no-]minify, --[no-]strip-wasm, --[no-]source-maps, --enable-deferred-loading, --standalone, --[no-]deprecated-js-interop, -D<key>=<value>).
  • src/content/web/index.md (/web):
    • Mention WebAssembly compilation (dart compile wasm) in the opening paragraph alongside Dart-to-JavaScript compilers.

@dart-github-bot

dart-github-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

@conooi
conooi marked this pull request as ready for review October 14, 2026 21:42
@conooi
conooi requested a review from kevmoo October 14, 2026 21:42

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the Dart WebAssembly (Wasm) compilation documentation across several files, including dart-compile.md, web/index.md, and web/wasm.md. The updates detail the companion .mjs JavaScript runtime, browser compatibility requirements, standalone WASI compilation, conditional imports, SIMD support, and provide a clearer step-by-step guide to compile and run a web app with Wasm. Feedback on the changes suggests avoiding the recommendation of dart pub global in the documentation, proposing instead to use dart run dhttpd after adding it to dev dependencies.

Comment thread src/content/web/wasm.md Resolved
Comment thread src/content/tools/dart-compile.md Resolved
Comment thread src/content/web/wasm.md Resolved
Comment thread src/content/web/wasm.md Resolved
Comment thread src/content/tools/dart-compile.md Resolved
Comment thread src/content/web/wasm.md Resolved
Comment thread src/content/web/wasm.md Resolved
Comment thread src/content/tools/dart-compile.md Resolved

@kevmoo kevmoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mustly nits - and one mistake on my part!

Comment thread src/content/web/wasm.md Resolved
@conooi
conooi merged commit 17dbf6f into dart-lang:main Oct 16, 2026
17 checks passed
@conooi
conooi deleted the fix-7558-wasm-docs branch October 16, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web/wasm] Update dart.dev/web/wasm and dart compile wasm docs for Dart 3.14

3 participants