Skip to content

Commit

Permalink
@ember-data/model: Simplify @cached transpilation (#7599)
Browse files Browse the repository at this point in the history
* Use patched ember-cached-decorator-polyfill

* Simplify `@cached` transpilation

* Use meber-cached-decorator-polyfill 0.1.4
  • Loading branch information
dcyriller authored and igorT committed Jul 28, 2021
1 parent 01b5b22 commit 69f79c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@ember-data/store": "3.28.0-beta.1",
"@ember/edition-utils": "^1.2.0",
"@ember/string": "^1.0.0",
"ember-cached-decorator-polyfill": "^0.1.3",
"ember-cached-decorator-polyfill": "^0.1.4",
"ember-cli-babel": "^7.26.6",
"ember-cli-string-utils": "^1.1.0",
"ember-cli-test-info": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,10 @@ function addonBuildConfigForDataPackage(PackageName) {
let checker = new VersionChecker(this.project);
let emberVersion = checker.for('ember-source');

const babelOptions = Object.assign({}, this.options.babel);

// we only want to add this to the options passed to the babel transpiler for the rolled up files
// other files get it from the inherited app config
if (this.pkg.dependencies['ember-cached-decorator-polyfill']) {
babelOptions.plugins = babelOptions.plugins.slice();
babelOptions.plugins.push([require.resolve('ember-cached-decorator-polyfill/lib/transpile-modules.js')]); // eslint-disable-line
}

let privateTree = rollupPrivateModule(tree, {
packageName: PackageName,
babelCompiler: babel,
babelOptions,
babelOptions: this.options.babel,
emberVersion: emberVersion,
emberCliBabelOptions: host.options && host.options['ember-cli-babel'] ? host.options['ember-cli-babel'] : {},
onWarn: this._suppressUneededRollupWarnings.bind(this),
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6768,10 +6768,10 @@ ember-cache-primitive-polyfill@^1.0.1:
ember-compatibility-helpers "^1.2.1"
silent-error "^1.1.1"

ember-cached-decorator-polyfill@^0.1.3:
version "0.1.3"
resolved "https://registry.npmjs.org/ember-cached-decorator-polyfill/-/ember-cached-decorator-polyfill-0.1.3.tgz#9da71cacad87330e8bf090f922984cb827588a60"
integrity sha512-I3AJ3sJkPoJdSOnXw8E1ww8h9Ly62djVugLySrQhNerOnTSGmbSx/iAXtojFfepo7q29HfUlFcM7DSFp5shQ7g==
ember-cached-decorator-polyfill@^0.1.4:
version "0.1.4"
resolved "https://registry.npmjs.org/ember-cached-decorator-polyfill/-/ember-cached-decorator-polyfill-0.1.4.tgz#f1e2c65cc78d0d9c4ac0e047e643af477eb85ace"
integrity sha512-JOK7kBCWsTVCzmCefK4nr9BACDJk0owt9oIUaVt6Q0UtQ4XeAHmoK5kQ/YtDcxQF1ZevHQFdGhsTR3JLaHNJgA==
dependencies:
"@glimmer/tracking" "^1.0.4"
ember-cache-primitive-polyfill "^1.0.1"
Expand Down

0 comments on commit 69f79c4

Please sign in to comment.