[dart-announce] dart2js changes coming up

85 views
Skip to first unread message

'Siggi Cherem' via Dart Announcements

unread,
Mar 14, 2018, 6:33:07 PM3/14/18
to anno...@dartlang.org
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 out

If 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.

--
For more news and information, visit https://plus.google.com/+dartlang
 
To join the conversation, visit https://groups.google.com/a/dartlang.org/

Randal L. Schwartz

unread,
Mar 14, 2018, 7:00:46 PM3/14/18
to mi...@dartlang.org
The announcement also indirectly deprecates isolates, suggesting the
webworker interface is richer. Is there already a package to use
webworkers, or are we left without any access?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/Dart consulting, Technical writing, Comedy, etc. etc.
Still trying to think of something clever for the fourth line of this .sig

Matan Lurey

unread,
Mar 14, 2018, 7:07:13 PM3/14/18
to mi...@dartlang.org
Hi Randal.

Nothing is available in this area yet. It wouldn't be much work to get something working (I have a proof of concept that took ~15 minutes). Hopefully we can have, at minimum, some published examples by the final Dart 2.0 release. To be fair, isolates have never been supported in DDC, so it's not much of a breaking change on top of what already isn't supported in Dart 2-dev today.

Thanks for your interest in Dart and Web Workers!

--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/86605ygt4c.fsf%40red.stonehenge.com.

Siggi Cherem

unread,
Mar 14, 2018, 7:15:56 PM3/14/18
to General Dart Discussion
Thanks for your question Randal.

I should have called this out more explicitly in the announcement: this change doesn't drop support for `dart:isolates` in dart2js. We continue to support it, and my hope is that, like Matan suggested, we can have a clear path forward for developers like you when we finally reach the 2.0 release.

Cheers,
Siggi



'Kevin Moore' via Dart Announcements

unread,
Mar 15, 2018, 10:48:21 AM3/15/18
to Dart Announcements
2.0.0-dev.37.0 is now available.

Again, if you run into any issues, please file a bug to let us know.

--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Announcements" group.
Visit this group at https://groups.google.com/a/dartlang.org/group/announce/.
Reply all
Reply to author
Forward
0 new messages