-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix component generator inconsistencies #155
Fix component generator inconsistencies #155
Conversation
The component is generated in `app/views/components/`, not `app/components/`.
Components are generated into `app/views/components`, so this is unneccessary.
Thanks for the PR! I think it was originally |
I’ve long felt like the views directory in Rails is overloaded with views, plus layouts and partials. So… I’m personally a bit enamored with the idea that there could be three separate ‘app’ directories for layouts, views and components. But that’s straying pretty far from Rails, not sure if it would make Phlex more or less approachable. |
Okay, this is a way off-topic for the PR (and maybe even for Phlex), but I had a bit more of a think about this. Yes, the views directory is overloaded, but there's more to it: As I use Phlex more in my app, I'm also finding myself bumping up against Rails-ish naming conventions of appending There's nothing in Phlex dictating this convention, but naming collisions are a thing to consider. That leads me to think about namespacing with
Extrapolating out from that as a naming convention, you'd end up with classes like these, I guess:
I haven't tested all this yet, but one of the nice upsides of this might be fewer files & folders and/or keeping related classes together. Examples:
My current Phlex app is pretty tiny and early stage though, so I'm not really extracting enough from a real world app.
|
I completely agree with you. I think this proposal in |
In terms of this PR, let's fix it for |
I'm new to Phlex, but I noticed a few inconsistencies with the expected location of components. They're generated into
app/views/components
, but the component generatorUSAGE
Tailwind portion ofphlex:install
were referencingapp/components
.I think the changes here match what the code does today, but if it is possible to use
app/components
, I'd be happy to work on a PR to make the clearer and configurable.