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

[Ember] Colocated Template Support #481

Open
chriseppstein opened this issue Aug 26, 2020 · 2 comments
Open

[Ember] Colocated Template Support #481

chriseppstein opened this issue Aug 26, 2020 · 2 comments
Assignees
Labels
@css-blocks/ember-cli Issue with the CSS Blocks ember-cli integration

Comments

@chriseppstein
Copy link
Contributor

We need to support colocated templates, currently there's issues when colocated templates are enabled for a project which causes those templates to be ignored (not rewritten).

@chriseppstein chriseppstein added the @css-blocks/ember-cli Issue with the CSS Blocks ember-cli integration label Aug 26, 2020
@chriseppstein chriseppstein added this to To Do in LinkedIn GA via automation Aug 26, 2020
@ramitha
Copy link
Contributor

ramitha commented Aug 26, 2020

To enable co-located templates, the following packages should exist in the app:

    let hasValidBabelVersion = hasBabel && semver.gte(babelVersion, '7.11.0');
    let hasValidEmberCLIVersion = semver.gte(emberCLIVersion, '3.12.0-beta.2');
    let hasValidEmberVersion = hasEmberSource && semver.gte(emberVersion, '3.13.0');

And the templates should co-exist within the component directory of the app/addon. For example,

app
├── adapters
│   └── application.js
├── app.js
├── components
│   ├── burrito.block.scss
│   ├── burrito.hbs
│   ├── burritos
│   │   ├── filter.hbs
│   │   └── filter.js
│   ├── burritos.js
│   ├── nav-bar.block.scss
│   └── nav-bar.hbs

@ramitha
Copy link
Contributor

ramitha commented Aug 26, 2020

The co-located templates aren't being picked up for compilation by CSSBlocksTemplateCompilerPlugin because there is another plugin in ember-cli-htmlbars called colocated-broccoli-plugin that inlines the contents of the template files with the component js which runs before CSSBlocksTemplateCompilerPlugin. Because of this, the input tree for the CSS Blocks plugin is stripped of .hbs files within the component directory and these files don't enter the CSS blocks build pipeline.

@chriseppstein chriseppstein added this to To do in Ember CLI Rewrite via automation Aug 28, 2020
@chriseppstein chriseppstein removed this from To Do in LinkedIn GA Aug 28, 2020
@chriseppstein chriseppstein moved this from To do to In progress in Ember CLI Rewrite Sep 14, 2020
@chriseppstein chriseppstein self-assigned this Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@css-blocks/ember-cli Issue with the CSS Blocks ember-cli integration
Projects
Ember CLI Rewrite
  
In progress
Development

No branches or pull requests

2 participants