Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking change: dropping support for EcmaScript5 #46545

Closed
sigmundch opened this issue Jul 2, 2021 · 27 comments
Closed

breaking change: dropping support for EcmaScript5 #46545

sigmundch opened this issue Jul 2, 2021 · 27 comments
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. breaking-change-request This tracks requests for feedback on breaking changes web-dart2js

Comments

@sigmundch
Copy link
Member

sigmundch commented Jul 2, 2021

Two years ago we announced a plan to deprecate support for ES5. Changes in priorities made us delay our plans until now.

In an upcoming Dart release (likely 2.14), dart2js will start generating code using ES6 features by default.

What can break?
Apps will stop running in old browsers like IE11 that don't support these ES6 features.

Modern browsers will not be affected, dart2js continues to support the last two major releases of Edge, Safari, Firefox, and Chrome.

Mitigation
Users that continue needing support on legacy browsers have two options:

  • Translate the output from dart2js using a tool like BabelJs.
  • Delay migrating to Dart releases that lack ES5 support until they find a viable a migration path. The caveat here is that we only provide bug fixes to the most recent SDK version.

For a short period we will also provide a --legacy-javascript flag that removes the modern ES6 features. The intend of this flag is to make it easy to opt-out in case bugs are discovered after the default changes, but this flag will not be kept around long term and will likely be removed one or two stable releases after this first breaking change.

@Markzipan @franklinyow @vsmenon @mit-mit @kevmoo

@grouma @Hixie - for approvals

@sigmundch sigmundch added web-dart2js breaking-change-request This tracks requests for feedback on breaking changes area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Jul 2, 2021
@sigmundch sigmundch self-assigned this Jul 2, 2021
@vsmenon
Copy link
Member

vsmenon commented Jul 13, 2021

lgtm

@sigmundch
Copy link
Member Author

@grouma @Hixie - friendly ping for approvals

@Hixie
Copy link
Contributor

Hixie commented Jul 13, 2021

What percentage of active web users will remain supported after this change?

@sigmundch
Copy link
Member Author

We are not aware of any apps that currently rely on IE11 support anymore. @kevmoo @mariamhas - do you have any data available to verify this or data to address @Hixie's question?

FWIW, the change would align our compiler support with the messaging about supported browsers in Dart, flutter web, and internal Dart web apps.

@kevmoo
Copy link
Member

kevmoo commented Jul 13, 2021 via email

@Hixie
Copy link
Contributor

Hixie commented Jul 13, 2021

That's not quite what I asked. To evaluate this proposal I am interested in comparing the fraction of users we current support, and the fraction of users we would support after this change.

@vsmenon
Copy link
Member

vsmenon commented Jul 13, 2021

I'm not aware of any data to that affect. We've announced and not gotten any push back.

Do we have the means to collect hard data? E.g., number of app users running with IE?

@Hixie
Copy link
Contributor

Hixie commented Jul 13, 2021

Sorry, I meant web users in general. As in, what percentage of web users use browsers that we would still support, vs what percentage use browsers we used to support but would no longer support plus what percentage of users use browsers we already don't support.

@vsmenon
Copy link
Member

vsmenon commented Jul 13, 2021

I don't believe this changes from a Flutter perspective. Flutter doesn't support IE, and apps I've just tested (e.g., gallery.flutter.dev) choke in IE on the JS in index.html (not dart2js output) from template:

https://github.com/flutter/flutter/blob/76d5e62f42dffe3aba42bba9364c4469af1ff332/packages/flutter_tools/templates/app_shared/web/index.html.tmpl#L58

The number of non-Flutter web users is small, and we've checked with specific teams.

@robrbecker
Copy link

robrbecker commented Jul 14, 2021 via email

@grouma
Copy link
Member

grouma commented Jul 15, 2021

LGTM.

@gmpassos
Copy link
Contributor

FYI:

Browser Support for ES6 (2015)

Browser Version Date
Chrome 51 May 2016
Firefox 52 Mar 2017
Edge 14 Aug 2016
Safari 10 Sep 2016
Opera 38 Jun 2016
  • Internet Explorer does not support ECMAScript 2015.

Source: https://www.w3schools.com/js/js_versions.asp

@sigmundch
Copy link
Member Author

@Hixie - let us know if @vsmenon comments addressed your concerns.

To provide some additional context, we have customers that don't expect their users to be on the latest versions of our supported browsers. For example, we know of a decent volume of users in browsers as old as Chrome 70.

We are evaluating each JS feature individually and advancing cautiously. At this time, we are starting with Symbol and the ES6 method syntax.

@franklinyow
Copy link
Contributor

@Hixie Ping

@msoham123
Copy link

This is looking promising, what are the performance implications of this? Faster loading times? Smaller payload sizes?

@SteveAlexander
Copy link

SteveAlexander commented Jul 20, 2021

@Hixie

My estimate based on the data sources below: around 8% of desktop browser usage is currently unable to use ES6.

Desktop vs mobile is split about 50/50. To estimate mobile will need some data about mobile browser versions or mobile OS versions (seeing as iOS makes you use webkit).

This estimate is based on data from the following data sources:

  1. Worldwide browser version market share may-july 2021 (see CSV file)

https://gs.statcounter.com/browser-version-market-share#monthly-202105-202107-bar

I have no idea how reliable this data source is.

  1. Based on that file, excluding mobile browsers, and for the remainder, figuring out which support ES6. The following resources were helpful:

https://github.com/browserslist/map-to-chrome
https://caniuse.com/?search=es6

@vsmenon
Copy link
Member

vsmenon commented Jul 29, 2021

@Hixie @ferhatb - we're still waiting on a green light on the flutter side. Any further concerns?

We're seeing a modest code size decrease (~3%) on one of our large internal web apps. Per @sigmundch 's comment, this is with fairly conservative use of ES6.

@Hixie
Copy link
Contributor

Hixie commented Jul 30, 2021

Cutting out 8% of the potential audience seems a bit drastic, and is more than we cut off for Android and iOS. (For context, that's about 320,000,000 people and would like cutting out the entire population of the US.)

@vsmenon
Copy link
Member

vsmenon commented Jul 30, 2021

@Hixie - Flutter already doesn't support these browsers on the Web (independent of dart2js):

https://flutter.dev/docs/development/platform-integration/web#which-web-browsers-are-supported-by-flutter

E.g., I wasn't able to run Gallery on IE11 independent of this change.

Are you suggesting that Flutter support these older browsers?

@msoham123
Copy link

@vsmenon Right, so what you are saying is that the only audience that is (potentially) being cut off is non-flutter dart users on older platforms. With that in mind, I feel like this is a reasonable trade-off (3% size decrease for dropping support for a browser replaced by the first generation of edge in 2015, 8 years ago).

@Hixie
Copy link
Contributor

Hixie commented Jul 30, 2021

Certainly on the long term we'd want to support more browsers than we do now, but I don't know when that would happen. We have our hands full dealing with the browsers we officially support as it is.

That said, given https://dart.dev/faq#web-general this seems like something that shouldn't need any kind of approval. We should just judge this mechanically based on our stated policy.

@kevmoo
Copy link
Member

kevmoo commented Jul 30, 2021

@vsmenon
Copy link
Member

vsmenon commented Jul 30, 2021

Thanks, all! Marking this as approved.

@gmpassos
Copy link
Contributor

FYI:

End of IE support by Microsoft 365 online services:

https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666

"the Internet Explorer 11 desktop application will be retired and go out of support on June 15, 2022":

https://blogs.windows.com/windowsexperience/2021/05/19/the-future-of-internet-explorer-on-windows-10-is-in-microsoft-edge/

@bernaferrari
Copy link
Contributor

Should this be closed now that it is in CHANGELOG?

@sigmundch
Copy link
Member Author

Yes thank you!

The change has now landed and will be part of the Dart 2.14 stable release. The --legacy-javascript flag is still available to revert to the old behavior, but we expect to remove that flag in 2.15.

@imcss4html
Copy link

I have practiced it, but the effect is not good. FlutterWeb main.dart.js just reduced from 1.7M to 1.6M. any plan for continuous improvement, or am I using the wrong method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. breaking-change-request This tracks requests for feedback on breaking changes web-dart2js
Projects
None yet
Development

No branches or pull requests