-
Notifications
You must be signed in to change notification settings - Fork 14
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
IE11 support #97
Comments
Hey @dave-irvine, no worries, thanks for the report! Yep, I think in order for you to keep moving, it's best to include the polyfill for now. I realise it's annoying you have to deal with this on your side though, so I'll have a think about ways we might be able to handle this within this lib (e.g. changing the build process or rewriting the source). Will let you know how I get on. |
@dave-irvine re:
Would it be possible to see your webpack config? Or better yet, a look at the app you're working on, if it's open source? Asking because last time I used create react app (CRA), it defaulted to |
Hi @tanem, sorry for the delay on this. Please find repo here: https://github.com/dave-irvine/svg-injector-ie11 If you If you open the source and uncomment https://github.com/dave-irvine/svg-injector-ie11/blob/master/src/index.js#L14 so that babel-preset-env picks up me using I guess you could just specify some targets in your babel-preset-env config? https://github.com/tanem/svg-injector/blob/master/rollup.config.js#L37 |
@dave-irvine no problem, thanks for taking the time to create that repo, it really made my life easier! Hopefully the following response gives you a path forward 🙏 (PS I realise you may be familiar with the things I talk about here, but I've kept the detail because I'll likely refer back to this issue in future when helping others). To answer your question:
I did play around with this actually. In the end though, the reasons I don't want to do this are:
Recommendations Here are three options ranging from least to most bloat:
In terms of including the polyfill, the webpack docs have a nice approach via an external I'm guessing that this won't be the first such issue you'll hit if you're going to be running with IE11 in the context of a bigger React app. For that reason I'd recommend option 2 which seems like a nice middle ground. What I'll do now Update the documentation in both this library and |
Beautiful package maintainer skills. A++ would raise issue again :) |
😆 No problem, will update the docs shortly. |
@dave-irvine just linked the two update doc PRs to this issue. Are you happy enough with those changes that I can close this issue now? |
👍 LGTM |
Sorry to be the one that brings up IE support, but I've tracked down
react-svg
not working to here :(https://github.com/tanem/svg-injector/blob/master/src/inject-element.ts#L85 uses
Array.from
which isn't in IE11 yet. I've got core-js in my webpack build but I'm using babel-preset-env withuseBuiltins
set tousage
, but because your code comes from an npm module, webpack never checks it so I don't get the polyfill forArray.from
.Anything you can do to fix, or shall I just force the
Array.from
polyfill from core-js into my build?The text was updated successfully, but these errors were encountered: