Skip to content

Split out helpers from core-js/built-ins #8155

@hzoo

Description

@hzoo

Having the version of babel-runtime be tied to core-js has caused us issues so Logan has suggested we split it out. Just writing down in an issue what I think we can do? (There's plenty of stuff to fix but we can always move things till later since we just want an RC too).

  • @babel/plugin-transform-runtime should only transform the babel helpers (devDep) instead of also doing it for core-js and regenerator. The other two would be in another package like babel-runtime-corejs2? (not sure if regenerator has to be it's own thing again or not)
    • it currently has a few options that we can change.
    • helpers: true: this is the whole point now so we can just remove this option.
    • polyfill false: removing this option
    • regenerator false: removing this option (maybe)?
    • moduleName false: not even sure who is using this anymore maybe CRA?
    • useBuiltIns true: by default?
    • useESModules - true: or remove the option?
  • @babel/runtime should only contain helpers code (dependency)?
    • I think we have 4 copies of helpers: useBuiltIns + useESModules combo.

Yes this is more configuration but you don't have to use it. Ideally with this we would just include @babel/plugin-transform-runtime as part of preset-env by default? and we can combine the logic with preset-env's useBuiltIns.

Hopefully this makes sense, feel free to edit cc @loganfsmyth

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: helpersoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions