question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarify polyfilling and browserlist usage documentation

See original GitHub issue

Hi,

The docs about supported browsers is not clear.

After reading it i still dont understand the following :

  • If the polyfills are not imported, what the browserlist field in package.json is used for ?
  • If i need to support ie11 (and Array.includes for example), what do i need to do exactly ?
  • Is @babel/preset-env used to automatically require polyfills ?
  • Moreover the docs from @babel/preset-env (included with preset react app) indicates to import @babel/polyfill which is now deprecated. react-app-polyfill/stable.js requires the correct package core-js/stable but is browserlist still used using this file ?

Thanks for your help

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:15
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
M0ns1gn0rcommented, Jan 15, 2021

Can someone answer the questions raised by the topic starter one by one?

4reactions
lukejagodzinskicommented, Jul 10, 2019

@petetnt yep I’ve noticed that. But instead of polyfilling everything I’ve just polyfilled features that I needed using core-js and it works. Would assume that when I use browserslists it should automatically polyfill everything that’s needed and also detect what features I’m using and only polyfill them. That would be ideal scenario.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passably Explained - Browserslist - Alexander Morse
Often, some documentation will go on to explain that you're defining a collection of "target browsers" that ensures your code will work on ......
Read more >
Recommended way to add polyfills depending on a list of ...
You likely are looking for browserslist and babel-preset-env - both have pretty great documentation on how they work together.
Read more >
Shimming
In this case, you may only want to deliver those polyfills to the browsers that need ... Let's start with the first use...
Read more >
How to Support IE11 Users as You Move to Angular 13
Update tsconfig.json to use ES5 and update polyfills.ts for ES6/ES7 ... the version of Angular, it will be .browserslistrc or browserslist .
Read more >
babel-preset-env
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found