Refactor javascript in decidim core (Part 1)#15045
Merged
greenwoodt merged 38 commits intodecidim:developfrom Aug 14, 2025
Merged
Refactor javascript in decidim core (Part 1)#15045greenwoodt merged 38 commits intodecidim:developfrom
greenwoodt merged 38 commits intodecidim:developfrom
Conversation
decidim-core/app/packs/src/decidim/refactor/implementation/form_validator.js
Fixed
Show fixed
Hide fixed
decidim-core/app/packs/src/decidim/refactor/implementation/form_validator.js
Fixed
Show fixed
Hide fixed
decidim-core/app/packs/src/decidim/refactor/implementation/form_validator.js
Fixed
Show fixed
Hide fixed
bcc2b01 to
4b4f178
Compare
7032ced to
2a009b6
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors JavaScript code in the Decidim core as part of the Hotwire migration. It standardizes form generation to use only decidim_form_for, adds @hotwire/stimulus package, and converts jQuery-based JavaScript classes to vanilla JS with Stimulus controllers.
- Migrates legacy jQuery-based JavaScript components to Stimulus controllers
- Standardizes form helpers to use
decidim_form_forconsistently - Adds extensive test coverage for new JavaScript classes
Reviewed Changes
Copilot reviewed 109 out of 114 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/webpacker/package.json | Adds @hotwired/stimulus dependency |
| packages/core/package.json | Removes @zeitiger/appendaround dependency |
| decidim-system/app/views | Updates forms to use decidim_form_for and data-controller attributes |
| decidim-core/app/views | Converts data attributes to use data-controller pattern |
| decidim-core/app/packs/src/decidim | Removes legacy JavaScript files and adds Stimulus controllers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
decidim-core/app/packs/src/decidim/refactor/integration/user_registration_form.js
Show resolved
Hide resolved
decidim-core/app/packs/src/decidim/refactor/integration/onboarding_pending_action.js
Show resolved
Hide resolved
This was referenced Aug 21, 2025
Draft
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🎩 What? Why?
As part of the Hotwire migration we are presenting this PR that performs the following:
form_foranddecidim_form_for). Now there is only one version allowed so that we can enforms inline for form validationdata-controllerattributedata-clipboard-copybecomesdata-controller="clipboard-copy"data-input-emojibecomesdata-controller="emoji".old-user-passwordbecomesdata-controller="password-toggler"data-scroll-last-childbecomesdata-controller="scroll-to-last"data-sticky-buttonsbecomesdata-controller="sticky-buttons"data-sticky-headerbecomesdata-controller="sticky-header".js-multiple-mentionsbecomesdata-controller="multiple-mentions"formvalidation is now being added withdata-controller="form-validator".js-mentionsbecomesdata-controller="mention"📌 Related Issues
Link your PR to an issue
Testing
Each one of the commits have been tested and reviewed individually by @greenwoodt , so the only constraint is "green pipeline"
📷 Screenshots
Please add screenshots of the changes you are proposing
