Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Use babel transform runtime over babel polyfill #429
Projects that depend on babel-polyfill and fetch-mock will crash with the following error.
In short: Libraries should not be using babel-polyfill, but rather babel transform runtime.
Babel team members warn that if you are writing a library - babel polyfill should not be used because it can pollute the globals used by project owners.
As such, Fetch-mock's improper use of babel is causing projects to crash in this fashion. babel/babel#4019 (comment)
Hi. Sorry for the slow response. Not had much time to maintain the library lately.
I agree with your appraisal, but don't think I can release this as a patch - babel polyfilling has been a discussion point in issues before, and I think this will break lots of people's tests. I don't want to deal with the fallout from that.
So I think this should be released as v8 of the library. Please could you search the repo (mainly docs) for mentions of v7 and update to say v7/8 https://github.com/wheresrhys/fetch-mock/search?q=v7&unscoped_q=v7. I will add a changelog note once released to explain what the difference between v7 and 8 is.
Could this be combined with an upgrade to core-js v3?
Or would this remove the need for core-js entirely?
Some users of storybook are hitting the core-js 3 incompatibility with this lib: