Skip to content

Conversation

@stephannv
Copy link
Contributor

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.

Copy link
Contributor Author

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

...

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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
Copy link
Contributor Author

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
)

Copy link
Collaborator

@cirdes cirdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep going!!

@stephannv stephannv merged commit 936b739 into ruby-ui:main Nov 14, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants