-
Notifications
You must be signed in to change notification settings - Fork 142
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
With strict settings turned on, the template-stack when using the globals resolver becomes less meaningful #1337
Comments
Do you get better results when using components in If no, this is a more general ember problem. If yes, we should figure out how to do a better job naming the functions and/or classes we are emitting that represent these components. For example, it looks like ember's |
Was trying to make a more focused demo / reproduction for this, and found I related error: ( this repo @ fe748867387d995af09abff8321f2ade9f7562ad ) Easy reproduction -- forget to import
The code for this is: // demo.gjs:
import TraditionalTO from './traditional-to';
import ModernTOJS from './modern-to-js';
import ModernTOTS from './modern-to-ts';
<template>
<TraditionalTO /> -- < -- this is the one erroring -- just an hbs file
<ModernTOJS /> -- empty
<ModernTOTS /> -- empty
</template> So, while <ConditionalError @label="Traditional Template-Only">
Yielded
</ConditionalError> and ConditionalError is where the |
with an intentionally thrown error, the template stack includes the gjs file:
though, uses the hyphenated name / file name, rather than the class name. Maybe this is better anyway, since folks using the Ember component generator end up using ridiculous an unmanageable component names. So, good news: gjs files in a template are identifiable with the strict flags turned off. |
Now, when the intermediary component is a gjs/gts, the components with classes have proper names (not using the file name):
But, the template-only gts file has a goofy name with a leading underscore |
Ok, so the |
I think the solution here is quite small and simple if somebody wants to send a PR: In the few places where we emit calls to ember's templateOnlyComponent function, we should be passing its two optional arguments. Right now we don't pass them.
|
The arguments are templateOnlyComponent('my-app/components/fancy-title-bar.js', 'fancy-title-bar') |
This was discovered here: #1336 (comment)
on this repo: https://github.com/rwwagner90/embroider-bug
I turned all the static flags off, got this error:
With the static flags on, some components lose their name:
As an aside, a solution to this problem is to use gjs/gts everywhere
The text was updated successfully, but these errors were encountered: