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: implement cacheKeyForTree that returns null #1424

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ts/addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ export default addon({
return `${__dirname}/blueprints`;
},

/**
* We implement a custom `cacheKeyForTree` here to prevent `ember-engines`
* from deduping this addon. This fixes a bug between `ember-cli-typescript`,
* `ember-engines` dedupe, and `ember-cli-babel`. `ember-cli-babel` uses the
* existence of `ember-cli-typescript` as a dependency to determine whether
* to process `*.ts` files; however, `ember-engines` dedupe is _stateful_
* so it's possible for `ember-cli-typescript` to not be a dependency when
* `ember-cli-babel` is running.
*
* For more info on `ember-engines` dedupe logic:
* https://github.com/ember-engines/ember-engines/blob/master/packages/ember-engines/lib/utils/deeply-non-duplicated-addon.js#L35
*
* For more info on how `ember-cli-babel` determines whether to process `*.ts`:
* https://github.com/babel/ember-cli-babel/blob/master/lib/babel-options-util.js#L407
*/
cacheKeyForTree() {
return null;
},

serverMiddleware({ app, options }) {
if (!options || !options.path) {
debug('Installing typecheck server middleware');
Expand Down