Giter Club home page Giter Club logo

Comments (3)

nicolo-ribaudo avatar nicolo-ribaudo commented on May 13, 2024 1

Thanks for the report! I opened ad PR to allow strings.

I thought the goal of babel-polyfills is to get rid of all this?

Yes and no. The goal of babel-polyfills is to avoid injecting imports to unnecessary polyfills. However, if a modern polyfill includes an import to some legacy code, there is nothing that we can do about that.

Atm, the compiled file is actually bigger than what I had before.

Is this compared to core-js 3 with preset-env, or to core-js 2? In the first case it's unexpected, in the second case is because core-js@3 handles many more edge cases.

from babel-polyfills.

agilgur5 avatar agilgur5 commented on May 13, 2024

Just got the same error when passing string targets to polyfill-regenerator too. polyfill-regenerator doesn't even seem to support targets per #36 , but still gets the error, so that makes me think it's a bug in the shared helper all the polyfill plugins use, @babel/helper-define-polyfill-provider.

It also uses @babel/helper-compilation-targets which is used in @babel/preset-env, so it's gotta be somewhere in between then. I think the bug would be in this file, but not totally sure.

from babel-polyfills.

Fuzzyma avatar Fuzzyma commented on May 13, 2024

Is this compared to core-js 3 with preset-env, or to core-js 2? In the first case it's unexpected, in the second case is because core-js@3 handles many more edge cases.

Compared to core-js 3

Yes and no. The goal of babel-polyfills is to avoid injecting imports to unnecessary polyfills. However, if a modern polyfill includes an import to some legacy code, there is nothing that we can do about that.

Is it true that since the polyfill has access to targets now, it should not ship code which is not required? If so, I guess polyfill write needs to catch up first, right?

from babel-polyfills.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.