-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Replace babel-polyfill with transform-runtime #2959
Conversation
My concern here is IE11, |
Ok, so we'd need to test it in IE11 to know for sure. Babel-polyfill is a big blocker for using swagger-ui as a component. Since there can only be one reference. An alternative can be: ignoring the call to babel-polyfill if one has already been called. So tl;dr... we should either ensure our the code works with transform-runtime. Or add a workaround for having two instances. ( Assuming we want swagger-ui as a component... :D ) |
If we can lets use transform-runtime. The alternative is to patch babel-polyfill to run multiple times ( it should be idempotent, but for some reason they decided to throw an error if there are multiple calls to it. I'm curious as to why ). |
480a0dd
to
4a6716f
Compare
An idea is to use https://github.com/amilajack/eslint-plugin-compat to lint the code and detect instance methods that aren't supported. It might work :D |
This is needed for whatwg-fetch + IE11. An alternative is to include "node_modules/whatwg-fetch" in the transform-runtime. But my guess is that someone is likely going to add a lib that in turn uses Promises, without adding it to the whitelist. This is safter.
This now works in IE 11, so we're good for that review @shockey. |
Also need swagger-api/swagger-js#1088 to work |
For integrating this lib into other apps, that already include babel-polyfill