Replies: 1 comment
-
I opened a PR that moves the generators into a ViewComponent namespace #2130 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're using Lookbook to preview our partials and Phlex components, and Lookbook pulls in ViewComponent as a dependency. We're not using ViewComponent in this app, but it seems to have registered itself as the Rails 'component' generator, and I'm unable to remove or override it.
Other libraries namespace their generators, like
RSpec::Generators::FooGenerator
, ViewComponent's generators are in theRails
namespaceRelated, ViewComponent kinda pollutes the generator namespace, overall:
It added (in red) all those top-level items, like Haml: Component (we're not using Haml or Slim in this app). Phlex added its generators under the "Phlex" namespace (in yellow), and I added some for our app (in blue). I also added a top-level
ComponentGenerator
to the app, but its not showing up I think because ViewComponent has already claimed the name, and I'm not able to run my generator.I can name mine as
MyApp::Component
, but it'd be nice if I could override the top-levelcomponent
so that myself and other developers working on this app don't try to do the obviousrails g component
and get the wrong files generated.Beta Was this translation helpful? Give feedback.
All reactions