Add JSX.ElementChildrenAttribute change to TypeScript 5.8 release notes
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- documentation
Research direction
Review PR 60880 and issue 61354 to confirm the JSX.ElementChildrenAttribute behavior change, then compare it with the TypeScript 5.8 release notes. Update the 5.8 release-notes page to describe the breaking change and its effect on children inference, using the reported twrl example as context.
Written by the indexing model from the issue text.
Description
🔎 Search Terms
tsx, jsx, children, 5.8
🕗 Version & Regression Information
- This changed between versions 5.7.3 and 5.8
- This changed in commit or PR 60880
⏯ Playground Link
No response
💻 Code
declare global {
namespace JSX {
type Element = HTMLElement; /* return type for 'jsx()' */
/* accepted element tags & attributes */
type IntrinsicElements = {
/* All HTML elements */
[Tag in keyof HTMLElementTagNameMap]: {
[T in HTMLElementStringAttributes<Tag>]?: string | Dyn<string>;
} & {
[T in HTMLElementNumberAttributes<Tag>]?: number | Dyn<number>;
} & (Tag extends keyof TwrlOverrides ? TwrlOverrides[Tag] : {}) & {
style?: string /* note: This should probably be CSSStyleDeclaration */;
// BREAKS HERE without this: children?: Children /* defines the type of children */;
};
};
}
}
🙁 Actual behavior
The breaking change is not listed in the 5.8 Release Notes
🙂 Expected behavior
The breaking change should be listed in the 5.8 Release Notes
Additional information about the issue
I ran into issues when upgrading TypeScript and narrowed it down to 5.7.3 to 5.8. The issues is that children is not inferred by default.
Luckily I came across this discussion: https://github.com/microsoft/TypeScript/issues/61354
This led me to this PR: https://github.com/microsoft/TypeScript/pull/60880
It would have been much faster if the (breaking) change had been mentioned in the 5.8 release notes. Moreover, one (apparent?) side effect of #61354 is that children does not have a default anymore (i.e. if JSX.ElementChildrenAttribute is not set, pre-5.8 children would be accepted; post-5.8 not anymore).
Here's the JSX implementation that surfaced the issue for me:
declare global {
namespace JSX {
type Element = HTMLElement; /* return type for 'jsx()' */
/* accepted element tags & attributes */
type IntrinsicElements = {
/* All HTML elements */
[Tag in keyof HTMLElementTagNameMap]: {
[T in HTMLElementStringAttributes<Tag>]?: string | Dyn<string>;
} & {
[T in HTMLElementNumberAttributes<Tag>]?: number | Dyn<number>;
} & (Tag extends keyof TwrlOverrides ? TwrlOverrides[Tag] : {}) & {
style?: string /* note: This should probably be CSSStyleDeclaration */;
children?: Children /* defines the type of children */; // <- this is now REQUIRED
};
};
}
}
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 126
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TypeScript
-
Possible Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64278 · 1 comment · 1 reaction ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/TypeScript#64118 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/TypeScript#64094 ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/TypeScript#63959 · 5 comments ·
-
Domain: lib.d.ts Help Wanted
Difficulty 1/5 Under an hour Newbie friendliness 91/100
microsoft/TypeScript#63722 · 4 comments · 1 reaction ·
All issues in microsoft/TypeScript
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
googleapis/librarian#7670 · 2 comments ·