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

Add IE11 polyfills #154

Merged
merged 6 commits into from
Aug 23, 2019
Merged

Add IE11 polyfills #154

merged 6 commits into from
Aug 23, 2019

Conversation

luisrudge
Copy link
Contributor

Description

  • Add IE11 polyfills
  • remove legacy.ts file and .legacy.js bundle file. All bundles will be IE11 compatible, so there's no need to have a separate bundle with polyfills
  • replace qs by qss (saves 3kb gzipped)
  • make index.html file IE11 compatible
  • make all bundles ES5 compatible
  • stop using Set so we don't have to polyfill it (it's a big polyfill)

References

Fix #113

Testing

  • This change adds test coverage for new/changed/fixed functionality

@luisrudge luisrudge requested a review from a team August 16, 2019 00:15
@luisrudge luisrudge merged commit 0e390f9 into master Aug 23, 2019
@keithrz
Copy link

keithrz commented Aug 23, 2019

Great, a fix to IE11 polyfills! Now that it is in master, can we get a new version of auth0 built & packaged with this fix?

@luisrudge
Copy link
Contributor Author

@keithrz next week 🎉

import 'core-js/es/array/from';
import 'core-js/es/typed-array/slice';
import 'core-js/es/array/includes';
import 'core-js/es/promise';
Copy link

@DaleGardner DaleGardner Aug 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried with the fixes in this PR, but was receiving this error in auth0-spa-js:

Zone.js has detected that ZoneAwarePromise (window|global).Promise has been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)

Removing this line "import 'core-js/es/promise';" fixed the issue. The issue seems to be that Angular is already handling this polyfill and auth0 loading it again causes a conflict.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure to import zonejs after our client: angular/angular#11650 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tracking this PR here: zloirock/core-js#608
if they don't get it fixed in a reasonable time frame, I'll fix it in another way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luisrudge Thank you for looking into this. 🙂 I am importing core-js before zone.js as it is default in Angular 7. I'm not sure how to import zone.js after the Auth0 client, as zone.js is imported in the polyfills.ts file whereas Auth0 is imported in a component.

This might be reproducible with a vanilla Angular app (with all IE11 polyfills enabled) and basic Auth0 setup.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on zloirock's response, it seems like core-js-pure would be the ticket:
https://github.com/zloirock/core-js#babelruntime

Either that, or Ponyfill 😄 https://github.com/sindresorhus/ponyfill

@stevehobbsdev stevehobbsdev deleted the fix/add-ie11-polyfills branch November 6, 2019 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polyfills needed for IE 11?
5 participants