-
Notifications
You must be signed in to change notification settings - Fork 62
Clean up unnecessary code #195
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users should not use this RubyUI module, they will generate/create the module on their apps, eg.
# config/initializers/ruby_ui.rb
module RubyUI
extend Phlex::Kit
end
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This before_template is already generated by Phlex 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users should eject js to their apps, so we don't need this, they will use their own javascript file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this will come back later to make our generators work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was moved to lib/ruby_ui.rb to make easier autoloading components on test setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this feature anymore since we are ejecting code, so the users can modify module names at will.
| class TestContext < Phlex::HTML | ||
| def view_template(&) | ||
| div(&) | ||
| module RubyUI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed to make RubyUI.ComponentName work. On user apps, we will generate something like:
Rails.autoloaders.main.push_dir(
"#{Rails.root}/app/components/ruby_ui", namespace: RubyUI
)
cirdes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep going!!
Related to #192
This PR remove things that will not be necessary since RubyUI will be an eject-only lib, so we don't need some code here. Some code can be broken right now (like generators), but I will open more PRs to fix them. I will add some comments to changes.
Existing applications pointing to RubyUI main should not update yet, we need to update our docs about ejecting configs/js/components.