question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colocated components within folders do not render

See original GitHub issue

I’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:closed
  • Created 2 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dcyrillercommented, Oct 19, 2021

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 😃

1reaction
dcyrillercommented, Oct 18, 2021

Nice catch @lifeart! But unfortunately it doesn’t seem to fix the issue (the tests are still failing).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found