Skip to content

test(web): incidental <Dynamic> uses move to dynamic() - #3509

Merged
ryansolid merged 1 commit into
nextfrom
test/idiomatic-dynamic
Sep 17, 2026
Merged

ryansolid merged 1 commit into
nextfrom
test/idiomatic-dynamic

Conversation

@ryansolid

Copy link
Copy Markdown
Member

<Dynamic> is deprecated in favour of dynamic() (#3436). Six test sites still used it, none to test Dynamic itself — it was a convenient element factory for a <li>/<span>/<button>/<div> tag, or a way to put a component value on the escape resolver's memo path. They now build the same shape on dynamic(), which is what a library writes and what test/harness/polymorphic.tsx already does.

file before after
harness/scenarios.tsx (DynamicElementList) <Dynamic component="li"> hoisted SepLi = dynamic(() => "li")
server/ssr-text-separators.spec.tsx <Dynamic component="span"> dynamic(() => "span")
server/ssr-element-nullish-attrs.spec.tsx <Dynamic component="button" {...props}> dynamic(() => "button")
server/spread-function-source.spec.tsx <Dynamic component="div" {...props}> dynamic(() => "div")
server/escape-late-values.spec.tsx (5 cases) <Dynamic component={Text}> etc. hoisted dynamic(() => Text) etc. — still the memo-yielding resolver path the file pins

One artifact changes: separator-dynamic-element-list.json, hydration keys _hk=110/130/150100/110/120. <Dynamic> was a createComponent layer over dynamic(), so the scenario has one fewer id level; markup is otherwise identical, and the server + hydrate parity checks for the scenario pass against the new artifact.

Left as-is on purpose: dynamic.spec, dynamic-namespace.spec, dynamic-hydration*.spec, dynamic-tag.bench, and the ssr-stream "Dynamic awaits a Promise component prop" case. Their subject is <Dynamic>; they go when it does.

Tests only — no changeset. All three web suites pass (dom 825, server 1001, hydrate 185).

Prompted by the yak-bench polymorphic-chain case having the same non-idiomatic <Dynamic component={props.as}>; on dynamic() that case gains 9% SSR throughput, since the wrapper was an extra omit + merge per instance.

`<Dynamic>` is deprecated in favour of `dynamic()`. Six test sites used it
only as a convenient element factory — a `<li>`/`<span>`/`<button>`/`<div>`
tag, or a component value on the escape resolver path — rather than to test
`Dynamic` itself. They now build the same shape on `dynamic()`, which is what
a library writes and what the polymorphic harness already does.

The `separator-dynamic-element-list` artifact changes its hydration keys
(`_hk=110/130/150` → `100/110/120`): `<Dynamic>` was a `createComponent`
layer over `dynamic()`, so one fewer id level. Markup is otherwise identical.

Files whose subject is `<Dynamic>` — dynamic.spec, dynamic-namespace,
dynamic-hydration*, dynamic-tag.bench, the ssr-stream Promise-component case —
keep it; they are its coverage until it is removed.

Co-authored-by: Claude via Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1b2164e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 35185305440

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 71.46%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1018
Covered Lines: 772
Line Coverage: 75.83%
Relevant Branches: 790
Covered Branches: 520
Branch Coverage: 65.82%
Branches in Coverage %: Yes
Coverage Strength: 14.93 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Sep 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 175 untouched benchmarks


Comparing test/idiomatic-dynamic (1b2164e) with next (edafccb)

Open in CodSpeed

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.

2 participants