Skip to content

fix: exclude static component attributes from hydration binding count#72

Merged
mohamedmansour merged 3 commits into
mainfrom
fix/component-hydration-markers
Mar 6, 2026
Merged

fix: exclude static component attributes from hydration binding count#72
mohamedmansour merged 3 commits into
mainfrom
fix/component-hydration-markers

Conversation

@mohamedmansour

@mohamedmansour mohamedmansour commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Static attributes on component tags (e.g., title, data-action) were incorrectly counted as binding attributes, inflating the hydration index counter. This caused FAST-HTML binding comment markers to have wrong indices, breaking client-side hydration.

The fix aligns with the Node.js BTR reference implementation which returns isBindingAttribute=false for static (non-handlebars) component attributes.

Also fixes duplicate blocks when a component is used in multiple parent templates by deduplicating in on_parse_component.

Static attributes on component tags (e.g., title, data-action) were
incorrectly counted as binding attributes, inflating the hydration
index counter. This caused FAST-HTML binding comment markers
(fe-b___BEGIN___COMMAND_DONE_MARKER___$LASTEXITCODEstart/end) to have wrong indices, breaking client-side
hydration.

The fix aligns with the Node.js BTR reference implementation which
returns isBindingAttribute=false for static (non-handlebars) component
attributes.

Also fixes duplicate <f-template> blocks when a component is used in
multiple parent templates by deduplicating in on_parse_component.
@mohamedmansour mohamedmansour requested review from a team, akroshg, janechu and radium-v March 6, 2026 06:20
Comment thread crates/webui-parser/src/plugin/fast.rs Outdated

Copilot AI commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

@mohamedmansour I've opened a new pull request, #73, to work on those changes. Once the pull request is ready, I'll request review from you.

@mohamedmansour mohamedmansour force-pushed the fix/component-hydration-markers branch from 4033665 to dd41785 Compare March 6, 2026 07:16
@mohamedmansour mohamedmansour merged commit 34806fe into main Mar 6, 2026
10 checks passed
@mohamedmansour mohamedmansour deleted the fix/component-hydration-markers branch March 12, 2026 06:22
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.

4 participants