-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Map and Set Polyfill clarification #16945
Comments
I think importing the polyfills in You are right the docs are a bit unclear, although I am not sure where it is best to be mentioned. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing! Thanks for being a part of the Gatsby community! 💪💜 |
Would love to help with this. I'll test #16945 (comment) and report back! |
So here's what I've found: Set and Map seem to be polyfilledThe default Gatsby project ( For reference, here's the code included in the generated bundle: n(73)("Set", (function (t) {
return function () {
return t(this, arguments.length > 0 ? arguments[0] : void 0)
}
}), {
add: function (t) {
return r.def(o(this, "Set"), t = 0 === t ? 0 : t, t)
}
}, r) Gatsby should add polyfills for your target browsersThe docs specify that:
More related to this issue, they also make the following example (emphasis mine):
In light of this, I would suggest that we remove the part in the docs that suggests to polyfill Map and Set in order to support IE < 11. It still isn't all that clear how to manually add polyfills to the bundle, as according to the docs Personally, I would try the |
Thanks for doing the leg work @mendaomn so babel (7 and up) ended up doing the polyfilling. 👍 Want me to close this thread now @gatsbybot ? =) |
No problem! What do you think about removing the part in the docs that says you should polyfill Map and Set yourself? As you experienced, it might lead to confusion I think :) |
Thanks for the research on this! It looks like changes were merged that would handle transpilation of If someone would like to take this on and remove that from the docs, and open a PR it'd be much appreciated 🙂 I'll mark this as Hacktoberfest and Help Wanted, if one of you would like to claim it wel can mark it as Hacktoberfest - Claimed |
@gillkyle I've got the time to knock this out today if no one else has claimed it. |
Awesome thanks @jbutz! I see your commit referenced this issue but I don't see a PR yet, feel free to create one and we can get this merged 🙂 |
@gillkyle I threw together the code changes since they were so small, but wanted to give people a chance to respond. No sense stealing Hacktoberfest credit away from people who reported an issue or did the research. 😉 PR is now open |
Yeah good point @jbutz, thanks for being so courteous, since I just barely added the Hacktoberfest label today I'll merge the PR. If anyone else is in this thread is interested in getting something merged for Hacktoberfest I'd be happy to pair with you and get something merged into Gatsby 🙂 |
That would be awesome! I'd love to contribute to Gatsby @gillkyle |
Hey
I was reading the documentation:
https://www.gatsbyjs.org/docs/browser-support/#note-about-ie--11
And it has a note about IE < 11, if I am understanding it correctly I should install core-js and add
Somewhere.
Do I need to do this if I want to support IE 11 and perhaps 10? Or is this handled by Gatsby? If I do add these imports, where would I do so?
gatsby-browser.js
?I've also edited by browserslist:
I just feel like the docs are a little unclear about the actual method for adding polyfills for browser support.
Thanks!
The text was updated successfully, but these errors were encountered: