-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
ba82d43
to
51e0302
Compare
51e0302
to
a38f289
Compare
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.
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.
d920072
to
b0bccc4
Compare
a78a5ca
to
ee358f4
Compare
984f9ff
to
8e8dbb2
Compare
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
8e8dbb2
to
d38f8fa
Compare
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. |
Depend on @hotwired/stimulus on the client-side. Add the client-side
dependency for
@hotwired/stimulus
to thepackage.json
, , thenscaffold out the changes to the
application.js
andcontrollers/index.js
modules.Next, migrate the jQuery-powered code into controllers: the
select
controller to integrate with
selectize.js
and thetable
controllerto 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.