Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #8779
Closed
Open
Issue created Apr 03, 2020 by Administrator@rootContributor

Pin babel-preset-react-app to a minor core-js version as per core-js readme

Created by: Mrman

Is your proposal related to a problem?

I've been trying to polyfill Promise.allSettled for Edge by using react-app-polyfill/stable but failing. My expectation was that it should work since react-app-polyfill@1.0.6 depends on core-js@3.6.4 and Promise.allSettled was moved into core-js/stable on v3.2.0.

I've dug a bit deeper to find that babel-preset-react-app has corejs set to major version 3 (https://github.com/facebook/create-react-app/blob/v3.4.1/packages/babel-preset-react-app/dependencies.js#L91)

Looking at the core-js readme I see this:

Warning! Recommended to specify used minor core-js version, like corejs: '3.6', instead of corejs: 3, since with corejs: 3 will not be injected modules which were added in minor core-js releases.

Locally I've set corejs in babel-preset-react-app to 3.2 (just a proof this is the issue) and I can see Promise.allSettled is now polyfilled correctly.

It's not clear to me why babel-preset-react-app does not follow the advice of core-js and pin to a minor version?

Describe the solution you'd like

Update babel-preset-react-app to pin to a minor version of corejs in it's configuration.

Describe alternatives you've considered

Eject and manage babel-preset-env myself but I'm very reluctant to go down this route.

I look forward to being told why things aren't as simple as changing babel-preset-react-app configuration :)

Assignee
Assign to
Time tracking