What are the different “configuration modes” for Dart2?

Dev/Prod/Release/Strong/Checked/Asserts OH MY

maxresdefault

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)

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, …)
  • To enable assertions in the (VM only?) you use --enable-asserts
    • … which is literally just assert(), differing from Dart1.
  • And probably N other modes (profile mode, slow mode) in Flutter.

A couple open questions:

  1. Can we pick some terminology and stick with it? I.e. “debug” and “release”.*
  2. 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.

Author: Fantashit

1 thought on “What are the different “configuration modes” for Dart2?

Comments are closed.