fix(dom): set custom element props as properties - #36
Conversation
React 19 assigns a prop on a dashed tag as a property whenever the element
declares one, and only writes an attribute otherwise. setProp had no such
branch: every prop outside the IDL allowlist became an attribute, so an
object value reached a web component as the string "[object Object]".
Components whose API is a property — `<number-flow-react data={...}>` — took
their value only from whatever the library assigned itself on mount and never
saw another update.
The other dashed names React excludes are SVG elements, already ruled out by
`isSvg`; `annotation-xml` is the one that reaches here through MathML.
Budgets move with the measured cost: ~30-60 B gzip on the dist bundles.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jb4ndC7Q2e5LUYo4DdXpZ4
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthrough
ChangesCustom element property assignment
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The custom-element update behavior is covered through the actual Redact rendering path, with no remaining actionable merge risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
React 19 assigns a prop on a dashed tag as a property whenever the element declares one, and only writes an attribute otherwise. setProp had no such branch: every prop outside the IDL allowlist became an attribute, so an object value reached a web component as the string "[object Object]".
Components whose API is a property —
<number-flow-react data={...}>— took their value only from whatever the library assigned itself on mount and never saw another update.The other dashed names React excludes are SVG elements, already ruled out by
isSvg;annotation-xmlis the one that reaches here through MathML.Budgets move with the measured cost: ~30-60 B gzip on the dist bundles.
Summary by CodeRabbit
Bug Fixes
data-*, andaria-*values continue to use attributes, while SVG and MathML behavior remains unchanged.Documentation