Repository navigation
fix(types): add declarative shadow DOM attributes to <template> - #5338
Merged
JoviDeCroock merged 4 commits intoOct 28, 2026
Merged
Conversation
`<template shadowrootmode="open">` failed to type check because
TemplateHTMLAttributes had no shadowroot* attributes. Add shadowrootmode
('open' | 'closed') and the shadowrootclonable, shadowrootdelegatesfocus
and shadowrootserializable booleans, each with its camelCase property
form like the other attributes in dom.d.ts.
Fixes preactjs#5337
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rschristian
reviewed
Oct 28, 2026
JoviDeCroock
approved these changes
Oct 28, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per review: these type additions do not need their own tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Makes sense, dropped the tests. Thanks for the quick review! |
My previous commit re-added them by mistake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Fixes #5337
<template shadowrootmode="open">didn't type check becauseTemplateHTMLAttributeshad noshadowroot*attributes. This addsshadowrootmode('open' | 'closed') and the relatedshadowrootclonable,shadowrootdelegatesfocusandshadowrootserializablebooleans, each with its camelCase form like the other attributes indom.d.ts. I added type tests totest/ts/dom-attributes.test-d.tsx, including one that an invalid mode is rejected.I used Claude Code to write this change.