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

Codemod for template-only-glimmer-components doesn't support Addons #237

Open
elwayman02 opened this issue Aug 6, 2020 · 3 comments
Open

Comments

@elwayman02
Copy link

It appears that the codemod implementation only runs against components in the app/ directory, which will not work for addons, which store their components in the addon/ directory and may not re-export them at all (since doing so is dangerous and a bad pattern). In order for addons to successfully enable this feature, the codemod needs to be able to create backing classes for addon components.

https://github.com/emberjs/ember-optional-features/blob/master/features/template-only-glimmer-components.js#L55

@elwayman02
Copy link
Author

Following up on discussion with @chancancode to capture some pieces we figured out:

  • This isn't necessarily a concern of ember-optional-features, which was intended to be used by app consumers
  • Addons don't generally have template-only components if they are following the re-export pattern in their app/ directory
  • This codemod is necessary for addons that expect to use Wall St syntax for namespaced component invocation (and will be useful for template imports as well)

Conclusion: It may be better for this codemod to live as a separate project in ember-codemods rather than as part of this project.

@elwayman02
Copy link
Author

Coming full circle on this.

@rwjblue implemented the codemod to fix this here: rwjblue/ember-holy-futuristic-template-namespacing-batman-codemod#58

However, there is a related issue that I believe does impact this project. If you enable template-only-glimmer-components in an addon, it does not create backing classes for template-only components in tests/dummy/templates/components, which is a perfectly valid use-case for addons.

@rwjblue
Copy link
Member

rwjblue commented Nov 9, 2020

which is a perfectly valid use-case for addons

Ya, agreed.

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

No branches or pull requests

2 participants