lbee
June 8, 2022, 8:27am
1
Hey all.
I am on the core team for Wagdail (a CMS built on Django/Python).
We have an RFC process for adoption of major-ish new changes in the CMS and I have been working with our UI team over the last few months on options for our JavaScript stack.
Thought I would post here for any feedback or for anyone curious.
wagtail:main
← wagtail:rfc/stimulus
opened 07:59AM - 08 Jun 22 UTC
This RFC proposed adoption of the Stimulus as the lightweight JavaScript framewo… rk in Wagtail to replace the need for jQuery, inline scripts and excessive global usage for per-component usage data.
[📄 Rendered](https://github.com/wagtail/rfcs/blob/rfc/stimulus/text/000-adopt-stimulus-js.md)
I’m hopeful it will be adopted but not sure as it’s a big project and there are lots of facets to consider.
3 Likes
Annnnd Stimulus has gone live in Wagtail!
wagtail:main
← lb-:feature/RFC78-001-initial-stimulus-adoption-v2
opened 11:07AM - 13 Oct 22 UTC
## [RFC 78](https://github.com/wagtail/rfcs/pull/78) - Initial Stimulus adoption…
This PR is a draft for the initial first set of commits to get Stimulus started in Wagtail.
## Overview
* This contains one Stimulus controller for the auto-submit form behaviour in images/documents listing drop-downs (e.g. changing the collection will submit the form) and is intentionally a simple case to get initial feedback
* This is a partial re-implementation of https://github.com/lb-/wagtail/pull/5 - a more fleshed out adoption with more code usage (header search, skip link, upgrade notification).
* This is also a smaller scoped version of https://github.com/wagtail/wagtail/pull/9075 (no docs, and no 'magic' controller inclusions).
* This intentionally includes no documentation for now except for a folder README.md (planned new convention discussed within the UI team) to help guide contributors.
* There are three non-core commits, two of them ignore some linting so that we can adopt Stimulus without more global ignoring of rules we should ignore, it also contains a fix for the draftail types that was causing CI failures previously.
* Builds on https://github.com/wagtail/wagtail/pull/9482 & https://github.com/wagtail/wagtail/pull/9483
### How to evaluate this PR
1. If you have not already, read the RFC https://github.com/wagtail/rfcs/pull/78
2. Read the Stimulus docs (or at least the first few pages of the 'handbook' section) https://stimulus.hotwired.dev/handbook/origin
3. Look at the granular commits, each builds on each other to adopt Stimulus in the code
4. Run the code locally `npm install` `npm start` will be required and check the behaviour of the drop-downs in the images/documents listing actually works
5. Read through the documentation and see if you can add your own controller easily within the bakerydemo
6. If the feedback is general - best to put it on the RFC - otherwise feel free to put implementation specific feedback on this PR and it will be incorporated back into the RFC in due course.
I thought I’d come share an update on this for people interested in Stimulus adoption in the wild.
Wagtail now has official documentation about how our site implementers can leverage Stimulus for their customizations
We showcase this new documentation in the release notes for Wagtail 5.2 , alongside the many refactorings we’ve done for maintainability purposes.
@lbee has been key to this effort, having produced the initial RFC, taken it through review towards being approved, and now leading the refactoring.