Skip to content

Commit

Permalink
feat: Improve config handling for polyfillUUID (#9265)
Browse files Browse the repository at this point in the history
* feat: Improve config handling for polyfillUUID

* add polyfillUUID config for graph addon

* remove: duplicate addon-main.js in packages/graph
  • Loading branch information
MehulKChaudhari authored Mar 19, 2024
1 parent f6ae038 commit aa0a34a
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 99 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,8 @@ activate this polyfill:

```ts
let app = new EmberApp(defaults, {
'@embroider/macros': {
setConfig: {
'@ember-data/store': {
polyfillUUID: true,
},
},
emberData: {
polyfillUUID: true
},
});
```
Expand Down
1 change: 1 addition & 0 deletions packages/adapter/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/core-types/addon-main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/graph/addon-main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
93 changes: 0 additions & 93 deletions packages/graph/addon-main.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/json-api/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/legacy-compat/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/model/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function addonBuildConfigForDataPackage(pkg) {
let options = (app.options = app.options || {});
options.emberData = options.emberData || {};
options.emberData.debug = options.emberData.debug || {};
options.emberData.polyfillUUID = options.emberData.polyfillUUID ?? false;
const hostOptions = options.emberData;
const debugOptions = Object.assign(
{
Expand Down Expand Up @@ -157,6 +158,7 @@ function addonBuildConfigForDataPackage(pkg) {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = options.emberData.polyfillUUID;
ownConfig.compatWith = options.emberData.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(
Expand Down
1 change: 1 addition & 0 deletions packages/request/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/schema-record/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/serializer/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/store/addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down
1 change: 1 addition & 0 deletions packages/tracking/addon-main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
Expand Down

0 comments on commit aa0a34a

Please sign in to comment.