babel / website

:globe_with_meridians: The Babel documentation website
https://babeljs.io/docs/en/index.html
MIT License
749 stars 1.31k forks source link

Update polyfill.md #2798

Closed keer-tea closed 1 year ago

keer-tea commented 1 year ago

After my testing, it depends on the version of the @babel/plugin-transform-regenerator plugin whether the auxiliary function for the generator will be produced. It is not related to the version of @babel/core.

If the transforme-regenerator plugin version is lower than 7.18.0, the compiled file will not inline the generator auxiliary function. If the version of the transform-regenerator plug-in is higher than or equal to 7.18.0, auxiliary inline function will be generated.

Here is a warehouse address for my testing: https://github.com/keer-tea/babel-regenerator-test

There is one type of warehouse, with versions of both packages less than 7.18.0. In Warehouse 2, the @babel/core version is less than 7.18.0, and the @babel/plugin-transform-regenerator version is greater than 7.18.0. In Warehouse 3, the @babel/core version is greater than 7.18.0, and the @babel/plugin-transform-reenerator version is less than 7.18.0.

I hope to correct this mistake.

netlify[bot] commented 1 year ago

Deploy request for babel-next pending review.

Visit the deploys page to approve it

Name Link
Latest commit 20c80252031205647a20134e551f8e14a66cc7d4
netlify[bot] commented 1 year ago

Deploy Preview for babel ready!

Built without sensitive environment variables

Name Link
Latest commit 20c80252031205647a20134e551f8e14a66cc7d4
Latest deploy log https://app.netlify.com/sites/babel/deploys/64782bb0fad0fb0008ea93b4
Deploy Preview https://deploy-preview-2798--babel.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

nicolo-ribaudo commented 1 year ago

Thanks for this PR! I agree that the current documentation is not precise, however I think it might be good enough.

The real requirement is "you must have at least version 7.18.0 of @babel/plugin-transform-regenerator and @babel/helpers". @babel/helpers is a dependency of @babel/core. @babel/core 7.18.0 depends on @babel/helpers 7.18.0 so it's guaranteed to get a new enough version. However, @babel/core 7.17.12 depends on @babel/helpers ^7.17.9, so it might get an older version.