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

Why does this still use bower? #487

Closed
BryanCrotaz opened this issue Apr 8, 2020 · 11 comments · Fixed by #492
Closed

Why does this still use bower? #487

BryanCrotaz opened this issue Apr 8, 2020 · 11 comments · Fixed by #492

Comments

@BryanCrotaz
Copy link

BryanCrotaz commented Apr 8, 2020

ember-template-compiler is being requested from bower_components. Now that there's an npm package, should we not be using it?

I've upgraded my addon to ember 3.17 with ember upgrade, and I've run codemods. Now I'm getting a build error, Cannot find module ... bower_components/ember/ember-template-compiler.js

From reading the source code, it seems like ember-source is expected to be present. Should this be in the dependencies?

@BryanCrotaz
Copy link
Author

ember install ember-cli-htmlbars neither installs ember-source, nor the required bower package.

@BryanCrotaz
Copy link
Author

ember install ember-source is a working workaround, but the error message doesn't point the dev at this solution

@rwjblue
Copy link
Member

rwjblue commented Apr 8, 2020

I'm not sure I understand the question. We definitely do not use bower_components by default, though we do still have supporting code to discover the template compiler from there if we can't find it as a normal npm package.

@rwjblue
Copy link
Member

rwjblue commented Apr 8, 2020

Specifically, this code:

let ember = this.project.findAddonByName('ember-source');
if (ember) {
return ember.absolutePaths.templateCompiler;
} else if (!templateCompilerPath) {
templateCompilerPath = this.project.bowerDirectory + '/ember/ember-template-compiler';
}

It checks the project for ember-source, then falls back to the older bower_componetns/ember/ember-template-compiler.js location.

@rwjblue
Copy link
Member

rwjblue commented Apr 8, 2020

@BryanCrotaz - In your scenario, is the ember-source not found by this.project.findAddonByName('ember-source')?

@BryanCrotaz
Copy link
Author

Yes, the above code is what led me to the solution, which narrows this down to being a misleading error message:

ember install ember-source is a working workaround, but the error message doesn't point the dev at this solution

@BryanCrotaz
Copy link
Author

We shouldn't need to scour source code to find out how to fix an issue :)

Copy link
Member

rwjblue commented Apr 8, 2020

  1. I disagree that reading code is bad, it is quite wonderful and empowering 😄
  2. I totally agree that we should fail loudly with a message about ember-source (not about bower_components) if we don't find the addon and bower_components/ember/ember-template-compiler.js is not present.

@BryanCrotaz
Copy link
Author

It's wonderful and empowering, but it's not fast when you just want to get your upgrade done. It's fantastic when wanting to learn about Ember, but frameworks are valuable because you don't need to know everything about how they work. They just work.

@BryanCrotaz
Copy link
Author

Also would be interesting to cross post this in ember-cli-update which should have installed ember-source during one of the updates?

@rwjblue
Copy link
Member

rwjblue commented Apr 9, 2020

Closed by #492

@rwjblue rwjblue closed this as completed Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants