Skip to content

DL fixes for safari and false negatives for ES6 module support #14716

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

Merged
merged 3 commits into from
Jun 11, 2019
Merged

DL fixes for safari and false negatives for ES6 module support #14716

merged 3 commits into from
Jun 11, 2019

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Jun 10, 2019

fix(@angular-devkit/build-angular): nomodule polyfill for Safari 10.1 and iOS Safari 10.3

The nomodule polyfill needs to be inject prior to any script and be
outside of webpack compilation because otherwise webpack will cause the
script to be wrapped in window["webpackJsonp"] which causes this to
fail.

Also, this ensures that it's loaded and executed prior to any other
nomodule script.

This polyfill will only be injected when the either Safari 10.1 or iOS
Safari 10.3 support is required, which is based on the browsers defined in browserslist file.

Fixes #14680

fix(@angular-devkit/build-angular): browsers that partially support es6 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

@alan-agius4 alan-agius4 requested a review from clydin June 10, 2019 09:58
@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Jun 10, 2019
@alan-agius4 alan-agius4 requested a review from clydin June 11, 2019 05:50
10.1 and iOS Safari 10.3

The nomodule polyfill needs to be loaded prior to any script and be
outside of webpack compilation because otherwise webpack will cause the
script to be wrapped in `window["webpackJsonp"]` which causes it to
fail.

This polyfill will only be injected when the either Safari 10.1 or iOS
Safari 10.3 support is required, which is based on the browsers  defined in browserslist file.

Fixes #14680
@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release and removed target: patch This PR is targeted for the next patch release labels Jun 11, 2019
@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Jun 11, 2019
@alan-agius4
Copy link
Collaborator Author

Patch version of this PR is available here: #14730

…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
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attribute noModule is ignored by Safari 10 Differential loading: Edge not considered ES2015 browser
4 participants