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

If route is named components model types are not inferred #720

Open
aklkv opened this issue May 17, 2024 · 2 comments · May be fixed by #721
Open

If route is named components model types are not inferred #720

aklkv opened this issue May 17, 2024 · 2 comments · May be fixed by #721

Comments

@aklkv
Copy link

aklkv commented May 17, 2024

If we have structure like:

templates/
  components/
    text.hbs
routes/
  components/
    text.ts

and the content of the route.ts:

import Route from '@ember/routing/route';

export default class ComponentsTextRoute extends Route {
 model() {
   return {
     message: 'Components Text Route',
   };
 }
}

we get the following glint error:

Screenshot 2024-05-17 at 12 17 09 PM

Anything outside of template/components folders works just fine.
I am guessing there might be some naming clash.

I can also publish repro if needed

@NullVoxPopuli
Copy link
Contributor

this is an extra troll as well, because templates/components was the folder used for all component hbs files pre-Octane.

It'd be good to drop support for that pattern entirely in Glint so that this bug can be fixed.

@aklkv aklkv linked a pull request May 18, 2024 that will close this issue
@ef4
Copy link
Contributor

ef4 commented May 21, 2024

I would be surprised if glint is the only thing that breaks when using a route named "components".

We're planning to drop support for components putting their template files into templates/components/*.hbs at ember 6.0, but before that point components very much might resolve template files there. In your example, if you happen to have a component named "text", ember will probably try to resolve your templates/components/text.hbs as its template.

It would be good to do a review across the whole stack to see what still treats templates/components as special, since those are all places that can get cleaned up at ember 6.0.

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.

3 participants