Skip to content

Commit

Permalink
[Bugfix release] EmberENV.EXTEND_PROTOTYPES is not always present
Browse files Browse the repository at this point in the history
Newer versions of ember and embroider are not currently compatible, as EmberENV.EXTEND_PROTOTYPES is no longer present.
Luckily, the offending code in embroider is the ember-inflector compact-adapter and as of [email protected] is no longer needed.

To support both pre and post [email protected] we conditionally execute the compatibility code when safe & required
  • Loading branch information
stefanpenner committed Aug 27, 2021
1 parent 2c6eda3 commit b0ab690
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/compat/src/compat-adapters/ember-inflector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Node } from 'broccoli-node-api';
import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
import { removeSync } from 'fs-extra';
import semver from 'semver';

const makeConfigurable = `
if (EmberENV.EXTEND_PROTOTYPES === true || EmberENV.EXTEND_PROTOTYPES.String) {
Expand All @@ -29,4 +30,8 @@ export default class extends V1Addon {
writeFileSync(join(outputDir, 'make-configurable.js'), makeConfigurable);
});
}

shouldApplyAdapter() {
return semver.lt(this.addonInstance.pkg.version, '4.0.0');
}
}

0 comments on commit b0ab690

Please sign in to comment.