-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Differential loading: Edge not considered ES2015 browser #14580
Comments
Hi, I just had a quick look at this, and it seems to be caused by an upstream package. import * as caniuse from 'caniuse-api';
caniuse.isSupported('es6-module', 'Edge 18') -> false I will try to determine in which upstream direct or transitive dependency the problem is to report the problem in the appropriate tracker. |
Thanks a lot for looking into this! :) Yes, I got there because once detected in Angular I was curious how Angular was deciding if it was either a ES5 or ES2015 browser, and saw the |
…S6 modules are being marked as not supported `caniuse-api` only returns `true` for a feature when it's fully supported. This might causes redundant ES5 builds if users opt to support only browsers which do support ES6 modules but either require polyfills such as Safari 10.1 or when both bundles will be downloaded such as `Edge 18` See: https://github.com/Nyalab/caniuse-api/blob/1b74c10257e36877709da4f6630513db10203a78/src/index.js#L49 and Nyalab/caniuse-api#82 Fixes #14580
…s6 modules are being marked as not supported caniuse-api only returns true for a feature when it's fully supported. This might causes redundant ES5 builds if users opt to support only browsers which do support ES6 modules but either require polyfills such as Safari 10.1 or when both bundles will be downloaded such as Edge 18 See: https://github.com/Nyalab/caniuse-api/blob/1b74c10257e36877709da4f6630513db10203a78/src/index.js#L49 and Nyalab/caniuse-api#82 Fixes #14580
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Kind of, due to the introduction of differential loading.
Description
Edge 15-18 are considered non-ES2015 browsers when compiling the app. If you target only Edge 18 in
browserslist
, I'd expect to only generate the ES2015 code (similar to what happens when only targeting the latest Firefox/Chrome release); but ES5 code is also generated. This is specially worrying because, due to a Edge bug, when running the app, the ES5 bundle is downloaded (but not executed), and the ES2015 bundle is downloaded twice (reference philipwalton/webpack-esnext-boilerplate#1 (comment) ).The result is that, while in Angular 7 I already compiled for ES2015 giving Edge users a optimized bundle, in Angular8 they are going to download more than 3 times the previous size to end up running the same ES2015 bundle.
🔬 Minimal Reproduction
Edit browserslist file with only this content:
And run
ng build --prod
🔥 Exception or Error
Both ES5 and ES2015 are generated.
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: