Skip to content

fix(web): release the first value-bound select - #4253

Merged
ryansolid merged 1 commit into
solidjs:nextfrom
steipete:fix/select-insert-retention
Oct 25, 2026
Merged

ryansolid merged 1 commit into
solidjs:nextfrom
steipete:fix/select-insert-retention

Conversation

@steipete

Copy link
Copy Markdown

AI-assisted: prepared and reviewed with AI coding agents; the results below come from the commands shown.

Summary

The first value-bound select, its form, and its first bound value can remain reachable after disposal. writeSelectValue creates the module-global selectInsert callback inside a per-select activation. Both queued closures capture that activation: the nullish branch captures node and value, and the trailing retry captures node. V8 shares that context with the stored callback, retaining the first node and bound value, possibly a multi-select array. Removing only the trailing closure still leaks.

Move the callback to module scope, preserving lazy installation and both microtasks. SSR never reaches this code.

How did you test this change?

  • pnpm --dir packages/web exec vitest run --maxWorkers=1: 161 files, 1,439 tests passed. The inspector-GC regression fails on the original source and passes with the patch, without --expose-gc.
  • JSX_COMPILER=babel pnpm --dir packages/web exec vitest run --config vite.config.hydrate.mjs --maxWorkers=1: 123 files passed, 1 skipped; 520 tests passed, 16 expected failures, 2 skipped.
  • pnpm --dir packages/web exec vitest run --config vite.config.server.mjs --maxWorkers=1: 201 files passed; 1,790 tests passed, 3 expected failures, 2 skipped.

Differential tests covered initial and late options, multi-select, optgroups, and reactive, nullish and same-turn updates. The existing client, hydration and server suites pass unchanged, including select-multiple, select-async-value and server select-value specs.

@changeset-bot

changeset-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fddce9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
test-integration Patch
board-example Patch
canvas-example Patch
server-dbmon-example Patch
todos-server-example Patch
@solidjs/compiler Patch
@solidjs/signals Patch
solid-js Patch
@solidjs/universal Patch

Not sure what this means? Click here to learn what changesets are.

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

@codspeed

codspeed Bot commented Oct 25, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 15.07%

2 warnings

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 195 untouched benchmarks
⏩ 5 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ memo + sync render effect only (reference) 34 ms 29.6 ms +15.07%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing steipete:fix/select-insert-retention (8fddce9) with next (253561e)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@ryansolid
ryansolid merged commit 4eb570e into solidjs:next Oct 25, 2026
8 of 9 checks passed
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