Skip to content

Commit

Permalink
Minor cleanup to dart compile page prepping for further js docs (#3991)
Browse files Browse the repository at this point in the history
* Minor cleanup to dart compile page prepping for further js docs

* Adjust to webdev serve until a web development page is created
  • Loading branch information
parlough authored Apr 18, 2022
1 parent ac49201 commit 03812b3
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions src/tools/dart-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Command-line tool for compiling Dart source code.
Use the `dart compile` command to compile
a Dart program to a [target platform](/platforms).
The output — which you specify using a subcommand —
can either include a Dart runtime or be a _module_
can either include a [Dart runtime][] or be a _module_
(also known as a _snapshot_).

{% include tools/dart-tool-note.md %}
Expand All @@ -21,8 +21,8 @@ Generated: /Users/me/myapp/bin/myapp.exe

The next example uses the `aot-snapshot` subcommand to
produce an ahead-of-time (AOT) compiled module (`myapp.aot`).
It then uses the [`dartaotruntime` command][]
(which provides a [Dart runtime](/overview#runtime))
It then uses the [`dartaotruntime` command](/tools/dartaotruntime)
(which provides a [Dart runtime][])
to run the AOT module:

```terminal
Expand All @@ -31,8 +31,6 @@ Generated: /Users/me/myapp/bin/myapp.aot
$ dartaotruntime bin/myapp.aot
```

[`dartaotruntime` command]: /tools/dartaotruntime

To specify the path to the output file,
use the `-o` or `--output` option:

Expand Down Expand Up @@ -60,7 +58,8 @@ The `dart compile` command replaces the
{{site.alert.end}}

Refer to the [native_app][] sample for a simple example of using `dart compile`
to compile a native app, followed by examples of running the app.
to compile a native app,
followed by examples of running the app.

[native_app]: https://github.com/dart-lang/samples/tree/master/native_app
[dart-run]: /tools/dart-run
Expand Down Expand Up @@ -113,7 +112,8 @@ The following table shows the subcommands of `dart compile`.
<tr>
<td> <code>js</code> </td>
<td> JavaScript </td>
<td> A deployable JavaScript file.
<td> A deployable JavaScript file,
compiled from the source code.
<br><em><a href="#js">Learn more.</a></em>
</td>
</tr>
Expand All @@ -132,7 +132,7 @@ The `exe` subcommand produces a standalone executable for
Windows, macOS, or Linux.
A **standalone executable** is native machine code that's compiled from
the specified Dart file and its dependencies,
plus a small Dart runtime that handles
plus a small [Dart runtime][] that handles
type checking and garbage collection.

You can distribute and run the output file like you would
Expand Down Expand Up @@ -162,7 +162,7 @@ No signing support ([issue 39106][])
: The format of the executables isn’t compatible with
standard signing tools such as codesign and SignTool.

No support for dart:mirrors and dart:developer
No support for `dart:mirrors` and `dart:developer`
: For a complete list of the core libraries you can use,
see the **All** and **AOT** entries in the
[table of core Dart libraries](/guides/libraries).
Expand Down Expand Up @@ -199,13 +199,6 @@ For more information, see

{% comment %}
TODO: Get info from https://github.com/dart-lang/sdk/wiki/Snapshots

kernel:
Use to package up an app into a single file and
reduce startup time.

jit:
To run the program, use `dart run myapp.jit`.
{% endcomment %}


Expand Down Expand Up @@ -257,8 +250,8 @@ they can have much slower startup than architecture-specific AOT output formats.
### JavaScript (js) {#js}

The `js` subcommand compiles Dart code to deployable JavaScript.
Another Dart-to-JavaScript compiler, [`dartdevc`][],
is for development use only.
For running and debugging during development,
see the [`webdev serve`][] command.

You usually use the [`webdev` tool][webdev] instead of
directly using a Dart-to-JavaScript compiler.
Expand All @@ -267,14 +260,10 @@ produces deployable JavaScript.
The [`webdev serve`][] command uses `dartdevc` by default, but you can switch
to producing deployable JavaScript by using the `--release` flag.

For more information, see the [`dart2js` documentation](/tools/dart2js).
For more information on building and deploying JavaScript applications,
see [Web deployment](/web/deployment).

[`dartdevc`]: /tools/dartdevc
[webdev]: /tools/webdev
[`webdev build`]: /tools/webdev#build
[`webdev serve`]: /tools/webdev#serve


[assert statements]: /guides/language/language-tour#assert
[static analysis]: /guides/language/analysis-options
[`String.fromEnvironment()` constructor]: {{site.dart_api}}/{{site.data.pkg-vers.SDK.channel}}/dart-core/String/String.fromEnvironment.html
[Dart runtime]: /overview#runtime

0 comments on commit 03812b3

Please sign in to comment.