-
Notifications
You must be signed in to change notification settings - Fork 142
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
Resolve the template compiler from ember-source instead of project root #696
Conversation
@thoov - Ready for a rebase (should fix canary failures). |
We cannot assume this will be resolvable from the project root as it might be symlinked. Instead we should the package location and grab the template compiler from it.
c6a1600
to
f693f31
Compare
@rwjblue This is now green |
@@ -317,10 +317,6 @@ class CompatAppAdapter implements AppAdapter<TreeNames> { | |||
return this.configTree.readConfig().rootURL; | |||
} | |||
|
|||
templateCompilerPath(): string { | |||
return 'ember-source/vendor/ember/ember-template-compiler'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this is actually trying to resolve the path relative to the build itself. That is why it is ember-source/vendor/ember-template-compiler.js
instead of where it actually is in the npm package ember-source/dist/ember-template-compiler.js
.
This is where that is done:
let emberSource = this.oldPackage.app.project.findAddonByName('ember-source'); | ||
let templateCompilerPath = emberSource.absolutePaths.templateCompiler; | ||
return templateCompilerPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes away from resolving the template compiler relative to the vendor asset output to resolving it in normal node modules resolution system.
This means that it would be no longer possible for folks to provide a custom / overridden ember-template-compiler asset (before all they needed to do was put it in the right location in their vendor folder).
I think this might be perfectly fine, but I'm not 100% sure...
I debugged this with @thoov this afternoon, and we figured out what is going on. In ember-cli's own test suite (in order to avoid multiple invocations of We have an alternative fix that works better in those cases (allowing the existing symlinked module dereferencing to be smarter). |
Closing in favor of #702 |
We cannot assume this will be resolvable from the project root as it might be symlinked. Instead we should get the addon instance and grab the template compiler location directly from it. This is technically a more stable location of the compiler instead of hard coding a location.
This becomes relevant in ember-cli's test suite as they symlink the entire node_modules directory into a per test tmp directory and looking for a hard coded location fails.