-
Notifications
You must be signed in to change notification settings - Fork 31
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
Namespacing issues #117
Comments
Hi @stevschmid thanks for opening this issue and for your PR :) The idea behind the If you have several components named That's why we chose to keep the whole namespace in the component view filename. About the Ruby module name: we sticked with Does this answer your questions? |
Thanks @Spone for your quick reply, really appreciate it! I don't think the editor behavior when dealing with a lot of files with the same name should dictate such a fundamental design choice. I'm pretty sure there are editors and plugins out there which would expand the display to include the parent directory if two files with the same name are open. Proper namespacing comes with the price of added complexity, I agree. But the current namespacing implementation is a) flawed (since it leads to modules with the same name). See my example above with b) inconsistent with Rails (and since this is a Rails gem, you anticipate the same I understand that changing the generation behavior is a scary thought, but I believe it's the correct way. |
I agree those are valid issues to consider. We'll discuss it and let you know (probably second half of September, I'm going to be on vacation until then). |
No worries. Thanks for getting back to me so quickly. Enjoy your vacation! |
* Fix translation lookup in partials * Address namespacing issue outlined in #117 * Refactor Translation#translate to reduce complexity * Update changelog
Hi @stevschmid, we're considering fixing the issue. Let's discuss how this could work:
Do you see anything else? |
Hey @Spone Thanks for getting back to me. Sounds great! |
* Fix translation lookup in partials * Address namespacing issue outlined in #117 * Refactor Translation#translate to reduce complexity * Update changelog
Hey guys
I just submitted the PR #116 but I stumbled upon a problem with it: I assumed (wrongly) that a component generated via
rails g component 'hello/world'
would create the main view ascomponents/hello/world/_world.html.slim
. Instead, it createscomponents/hello/world/_hello_world.html.slim
is there a rationale behind this? And why is the generated ruby component not properly namespaced as well?
Expected:
module Hello::WorldComponent
Actual:
module HelloWorldComponent
Is this an oversight or deliberate behavior? Because if I execute
rails g component 'foo/bar'
andrails g component 'foo_bar'
I end up with two modules with the same name.The text was updated successfully, but these errors were encountered: