Colocated components within folders do not render
See original GitHub issueI’m trying out Embroider "0.44.2"
with an App with colocated components. So we have them as:
app
- components
- componentA
- template.hbs
- component.js
- componentB
- template.hbs
- component.js
componentA
and componentB
do not render at all nor throw any error. But if I change the structure to:
app
- components
- componentA.hbs
- componentA.js
- componentB.hbs
- componentB.js
That “fixes” it. I don’t want to migrate them all as we have a ton, plus, having them encapsulated in a single folder per name is more manageable.
I already tried disabling staticComponents
. But no look… am I missing something?
Thank you 🙏
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Ability to co-locate non-page files in the pages directory #8454
Something like this behavior is already possible to achieve by having a separate directory holding this structure and then the public routes ...
Read more >next.js - How can I avoid rendering a file in the pages directory ...
@NickVu I like the colocation. If helper.tsx is only used for pages/foo/index.tsx , I like putting it in pages/foo ...
Read more >A solution to having more templates per component collocated ...
To whomever it may concern, here's a link to how I solved the problem of having more than just one template file per...
Read more >Popular React Folder Structures and Screaming Architecture
How do different folder structures compare? This is a journey of a growing codebase with a feature-driven folder structure at its end.
Read more >Best practices for Component Folder structure? - Ember.JS
I am new to ember and from react background. Categorising components in react is flexible, want to know how the same is done...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the pointer @lifeart, I have submitted a possible fix to support pods components when
podModulePrefix === ''
.As two of you mentionned, it might be the good opportunity for our team to move from a pods-based component structure to the colocated. There is a codemod to migrate to the colocated components and it could modified to support the pods components. But it would mean migrating many components in multiple applications shared between many developpers… We will probably end up migrating to colocated components. But if we ran into the issue, it might be a blocker for other teams? Also, this layout is still documented in ember-cli official documentation. This is my reasoning to submit the fix 😃
Nice catch @lifeart! But unfortunately it doesn’t seem to fix the issue (the tests are still failing).