Dev/Prod/Release/Strong/Checked/Asserts OH MY
Our customers (including folks that are really in the Dartiverse, including even @sethladd) are easily confused on Dart2’s different “operating modes” (this is slightly compounded by Flutter having additional “modes”).
In Dart1, there was:
- Normal (?) mode (No asserts, which included type annotation checks)
- Web clients had a production mode, i.e. Dart2JS
- … which itself had production flags (
--minify
, and later,--trust-XXX
)
- … which itself had production flags (
In Dart2, we have:
- Normal (strong) mode (No asserts, but yes on type annotation/type checks)
- Web clients have a dev mode (DDC), a production mode (Dart2JS)
- … in which Dart2JS has production flags (
--minify
, …)
- … in which Dart2JS has production flags (
- To enable assertions in the (VM only?) you use
--enable-asserts
- … which is literally just
assert()
, differing from Dart1.
- … which is literally just
- And probably N other modes (profile mode, slow mode) in Flutter.
A couple open questions:
- Can we pick some terminology and stick with it? I.e. “debug” and “release”.*
- Can we have some user-facing docs on the differences between the two?
b. And the differences between these and Dart1’s different modes
*Just as an idea. Feel free to choose other names.
Not blaming you, I just mean if you don’t know, probably lots others don’t either😨