3.1.0: accept a component class in cross-controller parser slots - #33
Merged
Conversation
Anywhere the Stimulus parsers take a "path/to/controller" String in a cross-controller slot, they now also accept the component class (or instance) itself — Controller.parse builds from its stimulus_identifier rather than re-stimulizing a string. Covers stimulus_target/action/value/ param/class/outlet and stimulus_controllers, via the props, child_element, the value-class .parse methods, and the class-level builders. Outlets keep their class-level Selector requirement. References to another component's controller stay refactor-safe instead of hard-coded identifier strings (e.g. stimulus_target: [Row, :summary]). This extends the 3.0 rule "a bare String is always a controller path" so a component is treated the same way. The String cross-controller form is still rejected by the class-level builders. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying vident with
|
| Latest commit: |
7f95f09
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://47f22d72.vident.pages.dev |
| Branch Preview URL: | https://feature-cross-controller-com.vident.pages.dev |
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.
Anywhere the Stimulus parsers take a "path/to/controller" String in a cross-controller slot, they now also accept the component class (or instance) itself — Controller.parse builds from its stimulus_identifier rather than re-stimulizing a string. Covers stimulus_target/action/value/ param/class/outlet and stimulus_controllers, via the props, child_element, the value-class .parse methods, and the class-level builders. Outlets keep their class-level Selector requirement.
References to another component's controller stay refactor-safe instead of hard-coded identifier strings (e.g. stimulus_target: [Row, :summary]). This extends the 3.0 rule "a bare String is always a controller path" so a component is treated the same way. The String cross-controller form is still rejected by the class-level builders.