Skip to content

feat: add attribute, input, and output visitor methods to R3Visitor#180

Open
Shinigami92 wants to merge 2 commits intovoidzero-dev:mainfrom
Shinigami92:feat-r3-visitor-attribute-methods
Open

feat: add attribute, input, and output visitor methods to R3Visitor#180
Shinigami92 wants to merge 2 commits intovoidzero-dev:mainfrom
Shinigami92:feat-r3-visitor-attribute-methods

Conversation

@Shinigami92
Copy link
Copy Markdown
Contributor

Adds visit_text_attribute, visit_bound_attribute, and visit_bound_event methods to the R3Visitor trait, and updates the default traversal for elements, templates, components, and content nodes to call them.

Previously, visit_element_children and visit_template_children only traversed child nodes, skipping over attributes, inputs, and outputs. This made it impossible to use the visitor pattern to inspect bindings and events without overriding the element visitor and manually iterating those fields.

This is a non-breaking change — all new methods have default no-op implementations, so existing R3Visitor implementations continue to work unchanged.

Motivation: enables using R3Visitor for template linting use cases, where rules need to inspect attributes and bindings (e.g. checking for [property] bindings, (event) handlers, or static attribute values).

@Shinigami92 Shinigami92 marked this pull request as ready for review March 27, 2026 19:06
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