Skip to content

fix(server): resolve nested Switch children - #4531

Open
clean99 wants to merge 1 commit into
solidjs:mainfrom
clean99:contrib/solid-server-switch-children
Open

clean99 wants to merge 1 commit into
solidjs:mainfrom
clean99:contrib/solid-server-switch-children

Conversation

@clean99

@clean99 clean99 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Summary

A Switch containing a direct Match and an array of matches renders its fallback on the server even when a nested match is true. Accessors returning matches have the same problem; the client selects the matching branch.

Reuse the server's recursive child resolver before selecting a branch, without adding a memo that could swallow a throwing getter's original exception. Match selection and render-prop handling stay unchanged.

How did you test this change?

  • corepack pnpm@9.15.0 --dir packages/solid exec vitest run --config vitest.server.config.mjs test/server/switch-children.spec.ts: 15 passed; reverting only the source changes gives 7 failed / 8 passed. Covers ErrorBoundary error identity and client/server matching.
  • Built entrypoints select nested/accessor matches; renderToString preserves the original error from throwing children.
  • corepack pnpm@9.15.0 run build --force, run test --force, run types --force, and run coverage --force: pass; 492 client and 33 server tests, plus compiler, import and type checks.
  • corepack pnpm@9.15.0 run format and changed-file Prettier checks: exit 0. The nonmutating whole-repo format check reports only unchanged packages/solid/test/array.spec.ts on both base and branch; that file is excluded from this patch.

@changeset-bot

changeset-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 24d616d

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

This PR includes changesets to release 2 packages
Name Type
solid-js Patch
test-integration 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

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 41180735322

Coverage remained the same at 89.14%

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: 1557
Covered Lines: 1458
Line Coverage: 93.64%
Relevant Branches: 1454
Covered Branches: 1226
Branch Coverage: 84.32%
Branches in Coverage %: Yes
Coverage Strength: 139226.99 hits per line

💛 - Coveralls

@ryansolid ryansolid added the 1.x label Oct 31, 2026 — with Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants