Skip to content
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

Implement client-side with Stimulus #2447

Merged
merged 1 commit into from
Feb 14, 2024
Merged

Implement client-side with Stimulus #2447

merged 1 commit into from
Feb 14, 2024

Conversation

seanpdoyle
Copy link
Contributor

@seanpdoyle seanpdoyle commented Oct 11, 2023

Depend on @hotwired/stimulus on the client-side. Add the client-side
dependency for @hotwired/stimulus to the package.json, , then
scaffold out the changes to the application.js and
controllers/index.js modules.

Next, migrate the jQuery-powered code into controllers: the select
controller to integrate with selectize.js and the table controller
to manage <table> elements.

Finally, render each necessary field (belongs_to, has_many,
polymorphic, select) with the [data-controller="select"] attribute
(powered by a new Field#html_controller method.

Copy link
Member

@nickcharlton nickcharlton left a comment

Choose a reason for hiding this comment

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

I think this looks good!

Can you foresee any upgrade issues? We'll be able to catch the template changes and warn of those — although I wonder if we've got enough changes we want to explore an upgrade tool? I'm not sure yet.

@seanpdoyle seanpdoyle force-pushed the stimulus branch 2 times, most recently from d920072 to b0bccc4 Compare February 2, 2024 18:44
@seanpdoyle seanpdoyle changed the base branch from importmaps-rails to main February 2, 2024 18:52
@seanpdoyle seanpdoyle force-pushed the stimulus branch 2 times, most recently from a78a5ca to ee358f4 Compare February 2, 2024 19:06
@seanpdoyle seanpdoyle marked this pull request as ready for review February 2, 2024 19:06
@seanpdoyle seanpdoyle force-pushed the stimulus branch 3 times, most recently from 984f9ff to 8e8dbb2 Compare February 14, 2024 00:39
Depend on [@hotwired/stimulus][] on the client-side. Add the client-side
dependency for `@hotwired/stimulus` to the `package.json`, , then
scaffold out the changes to the `application.js` and
`controllers/index.js` modules.

Next, migrate the jQuery-powered code into controllers: the `select`
controller to integrate with `selectize.js` and the `table` controller
to manage `<table>` elements.

Finally, render each necessary field (`belongs_to`, `has_many`,
`polymorphic`, `select`) with the `[data-controller="select"]` attribute
(powered by a new `Field#html_controller` method.

[@hotwired/stimulus]: https://stimulus.hotwired.dev
@nickcharlton
Copy link
Member

Thanks for keeping this up to date! I just did a quick click around in the demo to double-check everything, but I'll merge this once the suite passes again.

@nickcharlton nickcharlton merged commit 9547d64 into main Feb 14, 2024
10 checks passed
@nickcharlton nickcharlton deleted the stimulus branch February 14, 2024 12:33
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