Update JSXS implementation & Timestamp for client-side cache busting - #1082
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This reverts commit b26b30b.
AbhinRustagi
marked this pull request as ready for review
August 26, 2026 12:37
abhithesys
approved these changes
Aug 26, 2026
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.
What
Each child in a list should have a unique "key" propwarnings the devtools widget threw for plain static JSX (e.g. the Debug splitter's decorative spans).react/jsx-runtimeshim aliasedjsxstojsxand left children insideprops.children, so React key-checked hand-written static children as if they were dynamic lists.@latest, major, minor) so a republished bundle reaches running apps quickly; exact pins stay fully cacheable. Bumps devtools to0.1.2.How the shim maps each case now
Both runtime functions take the same three arguments:
(type, props, key). Children always arrive insideprops.children(a single value for one child, an array for several), andkeyalways arrives as the separate 3rd argument, never inside props. The compiler picks the function:jsxwhen it can't prove the children are static,jsxswhen it counted them in the source.createElementexpects the opposite layout — children positional, key inside props — so the shim relocates both and picks the argument shape that preserves the compiler's static/dynamic verdict:<br />jsx("br", {}, undefined)— no children, no keycreateElement("br", {})<div id="x"><Spinner /></div>jsx("div", {id: "x", children: spinner}, undefined)— one child, sits in propscreateElement("div", {id: "x"}, spinner)— lone positional arg<div><a /><b /></div>jsxs("div", {children: [a, b]}, undefined)—jsxs= compiler-proven static arraycreateElement("div", {}, a, b)— array spread into varargs<ul>{items.map(i => <li />)}</ul>— keys forgottenjsx("ul", {children: [li, li]}, undefined); each item:jsx("li", {}, undefined)createElement("ul", {}, [li, li])— one array arg, elements carry no key<ul>{items.map(i => <li key={i.id} />)}</ul>— keys providedjsxcall; each item:jsx("li", {}, i.id)— key lifted into arg 3createElement("li", {key: i.id})— key merged back into props; outer: same array argSo the two dynamic-list rows differ only in whether the source provided keys — the shim just relays that truthfully: forgotten keys still warn, provided keys still arrive. The earlier per-element
key="..."workarounds inDebugUIare dropped since the shim now translates faithfully.