Skip to content

3.1.0: accept a component class in cross-controller parser slots - #33

Merged
stevegeek merged 1 commit into
mainfrom
feature/cross-controller-component-refs
May 25, 2026
Merged

3.1.0: accept a component class in cross-controller parser slots#33
stevegeek merged 1 commit into
mainfrom
feature/cross-controller-component-refs

Conversation

@stevegeek

Copy link
Copy Markdown
Owner

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.

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>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying vident with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f95f09
Status: ✅  Deploy successful!
Preview URL: https://47f22d72.vident.pages.dev
Branch Preview URL: https://feature-cross-controller-com.vident.pages.dev

View logs

@stevegeek
stevegeek merged commit 53bcc1d into main May 25, 2026
13 checks passed
@stevegeek
stevegeek deleted the feature/cross-controller-component-refs branch May 25, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant