Solid: remove the @solidjs/web patch and move to 2.0.0-rc.21 (branch ready, waits on solidjs/solid#4836)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 15/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, typescript
- Domain
- frontend
Research direction
Start with patches/@[email protected] and the patchedDependencies entry, then the leak spec in the Solid playwright project and apps/playground/src/main.ts, which keeps the attribution engine off the leak page. The branch chore/solid-rc-21 holds the version bumps; the work is blocked until a Solid release includes solidjs/solid#4836, and the size budgets in scripts/size.mjs and the packages/solid compiler peer range are still open. Done means the Solid leak spec passes 47 of 47 on a built playground and the budget and changeset questions are settled by a maintainer.
Written by the indexing model from the issue text.
Description
The repo patches @solidjs/web 2.0.0-rc.14 (patches/@[email protected]) so that delegated events share one currentTarget getter. I have a branch that moves Solid to 2.0.0-rc.21 and removes the patch, and two Solid pull requests that fix the cause. I can't open a pull request here (the repo takes them from collaborators only), so this issue carries it.
Branch: https://github.com/brenelz/ui/tree/chore/solid-rc-21 (compare)
Why the patch is still needed on rc.21
Solid's delegated event handler defines a currentTarget getter on each event, a new closure each time. V8 keeps the first of those getters on the shape that all events of that type share, so one event, its target and the page around it stay alive. rc.19 and later delete the getter after dispatch, but that does not remove it from the shape. On rc.21 without the patch, 4 of the 47 Solid leak tests fail on a built playground: combobox, slider and resizable after 200 cycles, and tabs unmounted right after an arrow key.
solidjs/solid#4836 sets currentTarget as a plain value and creates no getter. With that change applied by hand to the installed @solidjs/web, the Solid leak spec passes 47 of 47.
A second leak on the dev server
@solidjs/vite-plugin 3.0.0-next.57 turns Solid's performance tracks on under vite dev, and the attribution engine behind them keeps every scope that re-ran. apps/playground/src/main.ts keeps that engine off the leak page for this reason, and the tracks turn it on there. On the dev server all 47 Solid leak tests fail on rc.21. CI and pnpm test:pr serve a built playground, which has no tracks.
solidjs/solid#4837 (draft) makes the engine release disposed nodes. With both changes applied by hand, the leak spec passes 47 of 47 on the dev server with the tracks on. The plugin also has a performanceTracks: false option that apps/playground/vite.config.ts could set.
What the branch changes
- Catalog:
solid-jsand@solidjs/webto 2.0.0-rc.21,@solidjs/vite-pluginto 3.0.0-next.57.@solidjs/compilerinpackages/solidto 2.0.0-rc.21. - Removes the patch and
patchedDependencies. - Updates
.agents/experts/solid/decisions.mdandknowledge.md.
It should wait for a Solid release with solidjs/solid#4836, because the four leak tests fail until then.
Checked on the branch
pnpm typecheck,pnpm lint,pnpm buildandpnpm formatpass. Thepackages/solidunit tests pass: 51 files, 1,332 tests.PLAYGROUND_BUILD=1 npx playwright test --project solid --project solid-data --project solid-ssr --retries 0: 5,818 pass, 361 are skipped, 17 fail. Four are the leak tests above. The other 13 are five modal specs across the three projects (csp.spec.ts:83,dialog.spec.ts:601,dialog.enhancements.spec.ts:158,dialog.patterns.spec.ts:68and:240,menu.enhancements.spec.ts:81). They read the scroll lock orinertright after the dialog is visible, and the same specs fail for--project reacton my machine, so I take them to be a local timing difference.- I have not run the built playground with the Solid fix applied.
Open questions
- Size budgets.
node scripts/size.mjslists 60@ui-sdk/solid/*entries over budget, against 2 onmain. Each grows 1.4 to 2.2 kB gzip from the rc.21 runtime, for examplesolid/button26.21 to 27.69 kB. The branch does not update the budgets. - Changeset. The compiler bump changes one published file.
dist/tree.jsno longer callsclaimElementon the tree item's link, because rc.21'sspreadclaims it. The other 65 compiled files are byte-identical, and every import in the compiled output exists in rc.14. The peer range still starts at rc.14, wherespreaddoes not claim the element while hydrating. The choices are to keep@solidjs/compilerat rc.14, to add a changeset, or to raise the peer floor.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 122
- Avg merge
- 3h 12m
- Merged PRs (30d)
- 437
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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 vercel-labs/ui
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel-labs/ui#540 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
vercel-labs/ui#525 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
vercel-labs/ui#521 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel-labs/ui#515 ·
Maintainers usually reply within 1 day
-
`checkPattern('checkbox')` on a `CheckboxGroup` reports the group's own hidden form input as unnamedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel-labs/ui#512 ·
Maintainers usually reply within 1 day
Similar issues
-
area: web
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
inabagumi/shinju-date#6823 ·
Maintainers usually reply within 1 day
-
accepted ai-dev ai-implementing
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
livesport/homer#218 · 1 comment ·
Maintainers usually reply within 1 day
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffixOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
figma/code-connect#419 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day