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
🎛️ RFC 78 - Initial Stimulus adoption v2 #9337
🎛️ RFC 78 - Initial Stimulus adoption v2 #9337
Conversation
Manage this branch in SquashTest this branch here: https://lb-featurerfc78-001-initial-st-bgqfq.squash.io |
4155601
to
59a2276
Compare
With RFC 78 merged - will mark this as ready for review. |
Stimulus 3.1.1 out. Should update - https://github.com/hotwired/stimulus/releases/tag/v3.1.1 |
59a2276
to
4b32e2b
Compare
Rebased & updated to Stimulus 3.1.1 |
Stimulus 3.2.0 is now out - making it easier to write keyboard shortcuts (without an external library), a nice outlets API (will help for things like bulk actions and search results) and a way to call a static method on registration of the controller (will help for backwards compatible global function creation). https://github.com/hotwired/stimulus/releases/tag/v3.2.0 I'll aim to update and rebase this PR soon. |
4b32e2b
to
bcfa2fc
Compare
Rebased & updated to Stimulus 3.2 |
CI failure is unrelated to this change.
|
bcfa2fc
to
69d555c
Compare
Another release - will try to update if I get the time. https://github.com/hotwired/stimulus/releases/tag/v3.2.1 Just a bug fix |
69d555c
to
79374eb
Compare
Just a side note. I'm working with Django & Stimulus (well it's not binded in any way) and I'm so so so so happy with it. HTML-over-the-wire it is so simple and flexible approach. I'm very happy it's going to be used inside Wagtail (one of the best CMS/F on the market). It would be much easier to extend Admin panel having Stimulus integrated. |
Thanks @pySilver - very glad to hear that - if you have not already, be sure to have a read of the early draft documentation in the RFC. Here is the direct link https://github.com/wagtail/rfcs/blob/main/text/078-adopt-stimulus-js.md#a-documentation-for-developers The target audience of that section is those using Wagtail and wanting to customise parts of the admin and/or use the Stimulus application instance provided for their own JS widgets. With or without a Node tooling setup. |
79374eb
to
16afa19
Compare
Rebased on latest (a few items have been merged in) thanks Thibuad. |
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.
All working exactly as intended as far as I can tell! There are a few things I’d like to suggest simplifications for, keen to hear what you think.
2b0ab9e
to
48d5195
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.
@thibaudcolas - this is ready for another review.
I've added one comment for myself, the JSDoc is alll cleaned up also and I've intentionally avoided an example of createController / Wagtail hook usage for now
48d5195
to
5c72740
Compare
- used to provide the ability for an input element to submit its form once changed or interacted with
5c72740
to
f4d91c4
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’m surprised you removed all of the initialisation events – aside from that all good!
Note while testing this I got a PropTypes error from Storybook saying the React checked
prop was submitted as the string "true" rather than a boolean. As far as I can tell this is a Storybook bug but thought I’d mention just in case.
Tested in Chrome 108 macOS 13, Firefox 102 Windows 11, Edge 102 Windows 11, Safari 14.1 macOS 12.1.
source-map-explorer
output with Stimulus added for reference (nothing outstanding): https://leafy-centaur-e7a959.netlify.app/
Aaand it's in! Thank you very much @lb- and @thibaudcolas, can't wait to use this for new code and some refactoring 🥳 |
@thibaudcolas thank you for the thoughtful feedback on this, it's great to see it go in. As for the events - I figured they may become helpful in the future, if so we can add them if needed. I've got a backup of the branch before removing them. |
RFC 78 - Initial Stimulus adoption
This PR is a draft for the initial first set of commits to get Stimulus started in Wagtail.
Overview
How to evaluate this PR
npm install
npm start
will be required and check the behaviour of the drop-downs in the images/documents listing actually works