Skip to content

Commit

Permalink
Remove workaround for bug fixed upstream
Browse files Browse the repository at this point in the history
This removes a workaround that was added for a bug in
`babel-helper-compilation-targets` that was fixed upstream and is
included in the version that is required by this addon.

The bugfix in `babel-helpers-compilation-targets` was included in
[`v7.10.2`](https://github.com/babel/babel/releases/tag/v7.10.2)

`ember-cli-babel` began requiring a version of
`babel-helpers-compilation-targets` that includes the bugfix since
[`v7.21.0`](https://github.com/babel/ember-cli-babel/releases/tag/v7.21.0)

---

- [Original bugfix workaround PR](#345)
- [Dependency upgrade PR](#354)
- [`ember-cli-babel@7.21.0` Release notes](https://github.com/babel/ember-cli-babel/releases/tag/v7.21.0)
- [`babel-compilation-targets@7.10.2` Release notes](https://github.com/babel/babel/releases/tag/v7.10.2)
  • Loading branch information
HeroicEric committed Jul 3, 2022
1 parent 315df8a commit 134f5a0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const {
} = require("./lib/babel-options-util");

const VersionChecker = require('ember-cli-version-checker');
const clone = require('clone');
const babel = require('@babel/core');
const path = require('path');
const getBabelOptions = require('./lib/get-babel-options');
Expand Down Expand Up @@ -332,14 +331,7 @@ module.exports = {

let parser = require('@babel/helper-compilation-targets').default;
if (typeof targets === 'object' && targets !== null) {
// babel version 7.10.0 introduced a change that mutates the input:
// https://github.com/babel/babel/pull/11500
// copy the object to guard against it, otherwise subsequent calls to
// _getTargets() will only have a mutated copy and lose all config from `config/targets.js`
// in the host application.
// PR to fix this upstream in babel: https://github.com/babel/babel/pull/11648
const copy = clone(targets);
return parser(copy);
return parser(targets);
} else {
return targets;
}
Expand Down

0 comments on commit 134f5a0

Please sign in to comment.