To prepare for Dart 2.0, dart2js has been refactored to use the new Common Front End (CFE) and is being extended to support the Dart 2.0 type system semantics. This week we’re shipping the first half of this work.
Starting with the 2.0.0-dev.37.0 release of the SDK, dart2js uses the new front end by default. At this stage dart2js has no semantic changes: the Dart 2.0 strong-mode semantics are not enabled, so dart2js continues to support the Dart 1 type system. This change, however, lets us start supporting new syntactic features of Dart 2.0, like optional new/const.
Changes to expect in this release:- Small code differences (~1% code size): You may notice some generated code is slightly different. This is expected because the internal representation of your program has small differences between the old and new front-end.
- Source-map changes: With the new front-end, dart2js also is using a new mechanism to generate source-map files. We don't expect big differences here either, the new source maps try to encode more data for locations that are commonly used during debugging.
- Some missing error messages: The CFE is not complete and may not report some static errors that the old front-end did. This is temporary. If you run the analyzer on your project already, you may never notice those missing error messages.
- No support for dart:mirrors: This announcement has more details.
- No support for '--package-root': Instead use the '--packages' option to specify the location of a .packages file.
Temporary option to opt outIf you run into any issues, please
file a bug to let us know. For a short time, the Dart 1 front end will continue to work behind a flag (`--use-old-frontend`), but we expect to remove this flag in a few weeks.