Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't mutate InputTarget's passed to @babel/helper-compilation-targets #11648

Commits on May 30, 2020

  1. fix: don't mutate InputTarget's passed to @babel/helper-compilation-t…

    …argets
    
    If `@babel/helper-compilation-targets` is called directly, as it is in the
    [Ember-CLI babel](https://github.com/babel/ember-cli-babel/blob/6f76f405b9dd2a48cce394c4826dd50847f74282/index.js#L543-L545)
    and [Vue CLI](https://github.com/vuejs/vue-cli/blob/c8cecffedbf7b19cf930bb2821b5c352bc716a67/packages/%40vue/babel-preset-app/index.js#L17)
    integrations, we don't want to mutate the input passed in. At least in Ember
    CLI, babel could be called multiple times. So, on subsequent passes all
    `browsers` and `esmodules` info would be lost (and losing the `browsers` info
    affects the output in negative ways). Copying the object before dropping keys
    allows callers not have to worry about babel mutating the object they pass in.
    Switching to a more functional approach makes it easier for babel to not worry
    about what consumers are passing in.
    
    Dropping the `browser` property was introduced in: babel#11500
    Dropping the `esmodules` property was introduced in babel#11124
    
    Discussion about dropping the `esmodules` property: babel#11124 (comment)
    fivetanley committed May 30, 2020
    Copy the full SHA
    4446b99 View commit details
    Browse the repository at this point in the history