-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Clarify polyfilling and browserlist usage documentation #7308
Comments
I ran to a similar issue myself not too long ago and I think first and foremost it would make sense to fix the instructions on Babel's end first |
I ran into same issue. Actually I want to support IE11 and from what I understand I have to import |
Hi @lukejagodzinski, you'll also need to add |
@petetnt yep I've noticed that. But instead of polyfilling everything I've just polyfilled features that I needed using |
I just tried to modify the browserlist config to polyfill for older versions of Firefox (52) but it didn't work and I and had to do: src/index.tsx // First line in file
import "react-app-polyfill/stable";
// ... other stuff But, unless I'm reading the code wrong, it seems that the current setup should automatically polyfill based on the
(isEnvProduction || isEnvDevelopment) && [
// Latest stable ECMAScript features
require('@babel/preset-env').default,
{
// Allow importing core-js in entrypoint and use browserlist to select polyfills
useBuiltIns: 'entry',
// Set the corejs version we are using to avoid warnings in console
// This will need to change once we upgrade to corejs@3
corejs: 3,
// Do not transform modules to CJS
modules: false,
// Exclude transforms that make all code slower
exclude: ['transform-typeof-symbol'],
},
], We should just be able to do: src/index.tsx // First line in file
import "core-js";
// ... other stuff package.json: "browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all",
"ff >= 52"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"ff >= 52"
]
}, When I tried the above the For example when I removed |
@lukejagodzinski yes that is technically supported in @ksrb it doesn't look like you've followed the directions over at https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/README.md#polyfilling-other-language-features. Try following that and see if it works for you. |
Can someone answer the questions raised by the topic starter one by one? |
Is it possible to deactivate the browserlist config altogether? |
Hi,
The docs about supported browsers is not clear.
After reading it i still dont understand the following :
react-app-polyfill/stable.js
requires the correct packagecore-js/stable
but is browserlist still used using this file ?Thanks for your help
The text was updated successfully, but these errors were encountered: