Dart web compilers moving to modern JavaScript in 2019

571 views
Skip to first unread message

Kevin Moore

unread,
Jan 8, 2019, 6:50:44 PM1/8/19
to Dart Announcements

For years we've limited the JavaScript produced by our deployment-focused JavaScript compiler — dart2js — to ECMAScript 5 (ES5). Using ES5 has allowed us to continue supporting Internet Explorer 11, but it has kept us from migrating to the latest JavaScript features.


We plan to remove the ES5 restriction this year, allowing dart2js to use JavaScript features supported by the last two major releases of Chrome, Firefox, Safari, and Edge. These new features have the potential to make generated JavaScript smaller and faster.


Timeline

  • 2019 Q1

    • Introduce a flag to opt into ES6+ generation. ES5 will remain the default.

  • 2019 Q2

    • Change the ES6+ flag to be opt-out. To generate ES5-compatible Javascript, you’ll need to provide a flag.

  • 2019 Q3

    • Drop ES5 support entirely and remove the ES6+ flag.


Supporting IE11 in 2019 and beyond

If you need to continue supporting legacy browsers, you have two options:

  1. Translate the output from dart2js using a tool like Babel. We plan to support community efforts to integrate Babel with our existing build tools.
  2. Delay migrating to Dart releases that lack ES5 support. If your current Dart SDK is working for your needs, wait to upgrade until you've investigated a migration path. Note: we generally provide bug fixes to only the most recent SDK version.

Kevin Moore

unread,
Jan 8, 2019, 6:52:46 PM1/8/19
to Dart Announcements
If you have questions, please post on misc@ discussion group.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages