Skip to content

Commit b41c7be

Browse files
Merge branch 'main' into macros-page
2 parents 11b185c + 62fe395 commit b41c7be

File tree

35 files changed

+147
-42
lines changed

35 files changed

+147
-42
lines changed

examples/analysis/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: examples
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
examples_util: {path: ../util}

examples/analysis_alt/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: examples
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dev_dependencies:
88
lints: ^4.0.0

examples/async_await/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: async_await
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
examples_util: {path: ../util}

examples/build_runner_usage/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: build_runner_usage
22
description: dart.dev build_runner example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dev_dependencies:
88
args: ^2.4.0

examples/cli/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: cli_examples
22
description: Examples for CLI tutorials on dart.dev
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
args: ^2.4.2

examples/concurrency/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 0.0.1
44
publish_to: none
55

66
environment:
7-
sdk: ^3.3.0
7+
sdk: ^3.4.0
88

99
dependencies:
1010
http: any

examples/create_libraries/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: dart.dev example code.
33
version: 1.0.0
44

55
environment:
6-
sdk: ^3.3.0
6+
sdk: ^3.4.0
77

88
dev_dependencies:
99
lints: ^4.0.0

examples/extension_methods/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: dart.dev example code.
33
version: 1.0.0
44

55
environment:
6-
sdk: ^3.3.0
6+
sdk: ^3.4.0
77

88
dev_dependencies:
99
lints: ^4.0.0

examples/fetch_data/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Fetch data example
33
version: 0.0.1
44

55
environment:
6-
sdk: ^3.3.0
6+
sdk: ^3.4.0
77

88
dependencies:
99
http: ^1.2.0

examples/futures/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 0.0.1
44
publish_to: none
55

66
environment:
7-
sdk: ^3.3.0
7+
sdk: ^3.4.0
88

99
dependencies:
1010
examples_util: {path: ../util}

examples/html/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: dart.dev example code.
33
version: 0.0.1
44

55
environment:
6-
sdk: ^3.3.0
6+
sdk: ^3.4.0
77

88
dev_dependencies:
99
lints: ^4.0.0

examples/iterables/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: iterables_examples
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dev_dependencies:
88
examples_util: {path: ../util}

examples/language/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: examples
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
examples_util: { path: ../util }

examples/misc/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: examples
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
args: ^2.4.2

examples/non_promotion/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: dart.dev non-promotion examples.
33
version: 0.0.1
44

55
environment:
6-
sdk: ^3.3.0
6+
sdk: ^3.4.0
77

88
dev_dependencies:
99
lints: ^4.0.0

examples/null_safety_codelab/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: null_safety_codelab_examples
22
description: dart.dev example code for null safety codelab
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dev_dependencies:
88
examples_util: {path: ../util}

examples/type_system/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: type_system_examples
22
description: dart.dev type system examples.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
examples_util: {path: ../util}

examples/util/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: dart.dev example utilities.
33
version: 0.0.2
44

55
environment:
6-
sdk: ^3.3.0
6+
sdk: ^3.4.0
77

88
dependencies:
99
test: ^1.25.2

examples/vector_victor/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 1.0.0
44
# homepage: https://www.example.com
55

66
environment:
7-
sdk: ^3.3.0
7+
sdk: ^3.4.0
88

99
# dependencies:
1010
# path: ^1.8.0

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ publish_to: none
33
homepage: https://dart.dev
44

55
environment:
6-
sdk: ^3.3.0
6+
sdk: ^3.4.0
77

88
dev_dependencies:
99
dart_site:

src/_data/side-nav.yml

+2
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@
237237
permalink: /web/deployment
238238
- title: Libraries & packages
239239
permalink: /web/libraries
240+
- title: Wasm compilation
241+
permalink: /web/wasm
240242
- title: Environment declarations
241243
permalink: /guides/environment-declarations
242244

src/_data/site.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ og_image_vers: "?2"
3838

3939
sdkInfo:
4040
channel: stable
41-
version: 3.3.2
41+
version: 3.4.0

src/content/interop/js-interop/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ check out the [Past JS interop][] page for a more in depth summary on past
3535
iterations.
3636

3737
[recently]: https://medium.com/dartlang/dart-3-3-325bf2bf6c13
38-
[Wasm]: {{site.flutter-docs}}/platform-integration/web/wasm
38+
[Wasm]: /web/wasm
3939
[`package:web`]: {{site.pub-pkg}}/web
4040
[`dart:html`]: {{site.dart-api}}/dart-html/dart-html-library.html
4141
[`dart:svg`]: {{site.dart-api}}/dart-svg/dart-svg-library.html

src/content/interop/js-interop/js-types.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Usage information about the core types in JS interop.
44
---
55

66
Dart values and JS values belong to separate language domains. When compiling to
7-
Wasm, they execute in separate *runtimes* as well. As such, you should treat JS
7+
[Wasm][], they execute in separate *runtimes* as well. As such, you should treat JS
88
values as foreign types. To provide Dart types for JS values,
99
[`dart:js_interop`] exposes a set of types prefixed with `JS` called "JS types".
1010
These types are used to distinguish between Dart values and JS values at
@@ -90,7 +90,7 @@ Generally, the conversion table looks like the following:
9090
</div>
9191

9292
:::warning
93-
Compiling to JavaScript vs Wasm can introduce inconsistencies in both
93+
Compiling to JavaScript vs [Wasm][] can introduce inconsistencies in both
9494
performance and semantics for conversions. Conversions may have different costs
9595
depending on the compiler, so prefer to only convert values if you need to.
9696

@@ -233,7 +233,7 @@ error if the value returned was JS `null` or `undefined` to ensure soundness.
233233

234234
:::warning
235235
There is a subtle inconsistency with regards to `undefined` between compiling to
236-
JS and Wasm. While compiling to JS *treats* `undefined` values as if they were
236+
JS and [Wasm][]. While compiling to JS *treats* `undefined` values as if they were
237237
Dart `null`, it doesn't actually *change* the value itself. If an interop member
238238
returns `undefined` and you pass that value back into JS, JS will see
239239
`undefined`, *not* `null`, when compiling to JS.
@@ -279,4 +279,5 @@ See [`toExternalReference`] and [`toDartObject`] to convert to and from an
279279
[`JSBoxedDartObject`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop/JSBoxedDartObject-extension-type.html
280280
[`ExternalDartReference`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop/ExternalDartReference-extension-type.html
281281
[`toExternalReference`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop/ObjectToExternalDartReference/toExternalReference.html
282-
[`toDartObject`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop/ExternalDartReferenceToObject/toDartObject.html
282+
[`toDartObject`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop/ExternalDartReferenceToObject/toDartObject.html
283+
[Wasm]: /web/wasm

src/content/interop/js-interop/package-web.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Do we have any other package migrations to show off here?
298298
{% endcomment -%}
299299

300300
[`package:web`]: {{site.pub-pkg}}/web
301-
[Wasm]: {{site.repo.dart.sdk}}/blob/main/pkg/dart2wasm/README.md
301+
[Wasm]: /web/wasm
302302
[html]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-html/dart-html-library.html
303303
[svg]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-svg/dart-svg-library.html
304304
[`dart:js_interop`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop/dart-js_interop-library.html

src/content/interop/js-interop/past-js-interop.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Archive of past JS interop implementations.
44
---
55

66
:::warning
7-
None of these legacy interop libraries are supported when compiling to Wasm.
7+
None of these legacy interop libraries are supported when compiling to [Wasm][].
88
:::
99

1010
This page addresses previous iterations of JS interop for Dart that are
@@ -121,3 +121,4 @@ TODO: Link to `package:web` section
121121
[`dart:js_util`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_util
122122
[`Function.toJS`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop/FunctionToJSExportedDartFunction/toJS.html
123123
[`dart:js_interop_unsafe`]: {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-js_interop_unsafe
124+
[Wasm]: /web/wasm

src/content/overview.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ Dart's compiler technology lets you run code in different ways:
184184
an ahead-of-time (AOT) compiler for producing machine code.
185185

186186
* **Web platform**: For apps targeting the web, Dart can compile for
187-
development or production purposes. Its web compiler translates Dart
188-
into JavaScript.
187+
development or production purposes. Its web compilers translate Dart
188+
into JavaScript or WebAssembly.
189189

190190
<img
191191
src="/assets/img/Dart-platforms.svg"
@@ -221,26 +221,31 @@ More information:
221221
* [Write command-line apps](/tutorials/server/cmdline)
222222
* [Write HTTP servers](/tutorials/server/httpserver)
223223

224-
#### Dart Web (JavaScript dev & prod) {:#web-platform}
224+
#### Dart Web (JavaScript dev & prod and WebAssembly) {:#web-platform}
225225

226226
Dart Web enables running Dart code on web platforms powered by
227227
JavaScript. With Dart Web, you compile Dart code to JavaScript code, which in
228228
turn runs in a browser—for example, [V8](https://v8.dev/) inside
229229
[Chrome](https://www.google.com/chrome/).
230+
Alternatively, Dart code can be compiled to WebAssembly.
230231

231-
Dart web contains two compilation modes:
232+
Dart web contains three compilation modes:
232233

233-
* An incremental development compiler enabling a fast developer cycle
234-
* An optimizing production compiler which compiles Dart code to fast,
235-
compact, deployable JavaScript. These efficiencies come from
236-
techniques such as dead-code elimination.
234+
* An incremental JavaScript development compiler enabling a fast developer
235+
cycle.
236+
* An optimizing JavaScript production compiler which compiles Dart code to fast,
237+
compact, deployable JavaScript. These efficiencies come from techniques such
238+
as dead-code elimination.
239+
* An optimizing WebAssembly (WasmGC) production compiler which compiles Dart
240+
code to super-fast, deployable WebAssembly GC code.
237241

238242
More information:
239243

240244
* [Build a web app with Dart](/web/get-started)
241245
* [`dart compile js`](/tools/dart-compile#js)
242246
* [`webdev` tool](/tools/webdev)
243247
* [Web deployment tips](/web/deployment)
248+
* [WebAssembly compilation](/web/wasm)
244249

245250
#### The Dart runtime {:#runtime}
246251

src/content/tools/dart-compile.md

+8
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ The following table shows the subcommands of `dart compile`.
117117
<br><em><a href="#js">Learn more.</a></em>
118118
</td>
119119
</tr>
120+
<tr>
121+
<td> <code>wasm</code> </td>
122+
<td> WebAssembly </td>
123+
<td> A portable, binary instruction format for a stack-based virtual machine.
124+
Currently under development.
125+
<br><em><a href="/web/wasm">Learn more.</a></em>
126+
</td>
127+
</tr>
120128
</table>
121129

122130

src/content/tutorials/server/cmdline.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ $ dart run bin/dcat.dart -n pubspec.yaml
191191
4 # repository: https://github.com/my_org/my_repo
192192
5
193193
6 environment:
194-
7 sdk: ^3.3.0
194+
7 sdk: ^3.4.0
195195
8
196196
9 # Add regular dependencies here.
197197
10 dependencies:

0 commit comments

Comments
 (0)