Skip to content

fix(ssr): leave the build order to the host when the client only has the shared server input - #551

Merged
ryansolid merged 1 commit into
mainfrom
claude/project-thread-1zj04f
Nov 17, 2026
Merged

ryansolid merged 1 commit into
mainfrom
claude/project-thread-1zj04f

Conversation

@ryansolid

Copy link
Copy Markdown
Member

With ssr: true, the solid:client-build-first buildApp hook builds the client environment before config-level orchestrators, so server builds can read its manifest. It does this whenever the client has a manifest and an input.

Astro (withastro/astro#17891, @astrojs/solid-js on Solid 2) orders the builds itself: servers and prerender first, then the client, once its islands are known. With a legacy adapter, Astro puts virtual:astro:legacy-ssr-entry in the top-level build.rollupOptions.input. The client inherits that input until Astro replaces it, so this hook built the server entry for the browser and failed (Astro's ssr-large-array test: UNRESOLVED_ENTRY).

Fix: if the client's input deep-equals a server environment's input, it came from the shared top-level config rather than from a client entry. In that case the hook leaves the order to the host. A client with its own input, or with an index.html, still builds first as before.

  • New src/client-build-first.test.ts: a shared server input keeps the host's order (fails without the fix); a client-specific input is still built first.
  • Unit suite: 34 files, 158 tests pass. pnpm build (including tsc) is clean.
  • Checked against the Astro branch with this build dropped into its node_modules and the integration's workaround removed: ssr-large-array, solid-component and Cloudflare with-solid-js all pass.

Patch changeset included. Once this is released, the Astro PR can drop its workaround and bump to the patch.


Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f5238a3

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

This PR includes changesets to release 1 package
Name Type
@solidjs/vite-plugin 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

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/vite-plugin@551

commit: f5238a3

@ryansolid
ryansolid merged commit 7ef54c4 into main Nov 17, 2026
6 checks passed
ryansolid pushed a commit to ryansolid/astro that referenced this pull request Nov 17, 2026
…rkaround

3.0.1 leaves the build order to the host when the client only has the
shared server input (solidjs/solid-vite-plugin#551), so the integration no
longer hides the client manifest flag from client-build-first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0117BoWL7JwK3aqy95RDD2WN
matthewp added a commit to withastro/astro that referenced this pull request Nov 18, 2026
* feat(solid): support Solid 2.0 in @astrojs/solid-js v8

Rewrites the Solid adapter for Solid 2.0's new runtime split
(solid-js + @solidjs/web) and compiler (@solidjs/vite-plugin):

- renderToStream-based SSR with first-class async (no Suspense wrapper)
- asset manifest threaded into server renders so lazy() islands
  resolve, hydrate, and deliver their CSS (deduped per page)
- probe-based check() with caching, foreign-vnode rejection, and
  Proxy-safe source inspection
- client hydration updated to 2.0 signatures
- all Solid fixtures ported to 2.0 APIs; solid-component suite
  un-skipped with new lazy-CSS coverage

Co-authored-by: Cursor <[email protected]>

* feat(solid): server functions support (experimental)

Adds a `serverFunctions` option to @astrojs/solid-js: "use server"
functions in islands compile to typed RPC calls dispatched through an
injected Astro route at the transport endpoint (default /_server), so
requests pass Astro's middleware pipeline in dev and production alike.
The route threads context.locals and the API context into the Solid
request event; island SSR runs inside provideRequestEvent so
getRequestEvent() and direct in-process calls work during rendering.
Normalizes bodyless POSTs (zero-argument calls) that Node-to-web
request conversion gives a non-null body stream.

Covered by a browser e2e fixture: endpoint round trip, middleware
locals via the request event, and SSR direct calls.

Co-authored-by: Cursor <[email protected]>

* feat(solid): server components support (experimental)

Wires the three app-side pieces for serverFunctions.components in the
Astro islands model: the frames render plugin + direct-call result
transform during island SSR (threaded through the manifest virtual so
disabled setups keep a frames-free graph), and installServerComponents()
injected at Astro's before-hydration stage. The endpoint response
transform already rides the handler virtual.

e2e covers t=0 inline SSR, zero-request document adoption at boot, and
endpoint-streamed morphs preserving client slot DOM identity.

Co-authored-by: Cursor <[email protected]>

* chore: drop stale solid-devtools knip ignore (dependency removed in v8)

Co-authored-by: Cursor <[email protected]>

* fix: point the Solid tsconfig preset at @solidjs/web

Solid 2.0 moves JSX namespaces and jsx-runtime type entries into the
renderer packages; solid-js no longer exports one. `astro add solid-js`
now writes jsxImportSource: "@solidjs/web".

Co-authored-by: Cursor <[email protected]>

* chore(solid): bump to Solid 2.0.0-rc.19 and @solidjs/vite-plugin next.51

Also moves the Cloudflare Solid fixtures to Solid 2 (they still resolved
solid-js 1.x, which has no ./refresh export) and turns the empty Options
interface into a type alias for the no-empty-object-type lint rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0117BoWMf7eavBuREH2CFQrJ

* chore(solid): move to Solid 2.0 stable

Bump solid-js, @solidjs/* and Solid 2 primitives off their rc/next tags onto
the stable releases (solid-js ^2.0.0, @solidjs/vite-plugin ^3.0.0) and set the
solid-js peer to ^2.0.0. Where the repo enforces minimumReleaseAge, the
2.0.0 packages are listed in minimumReleaseAgeExclude until they age past it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0117BoWL7JwK3aqy95RDD2WN

* fix(solid): fail a render only on onError's handling "failed"

Solid 2.0's renderToStream onError also hears failures the render handled,
such as an <Errored> boundary rendering its fallback. The renderer treated
every call as a render failure, so a component whose Errored caught a sync
throw failed the page build, and the check() probe rejected it as not a
Solid component. Skip calls whose context.handling is not "failed".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0117BoWL7JwK3aqy95RDD2WN

* chore(solid): use @solidjs/vite-plugin 3.0.1, drop the build-order workaround

3.0.1 leaves the build order to the host when the client only has the
shared server input (solidjs/solid-vite-plugin#551), so the integration no
longer hides the client manifest flag from client-build-first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0117BoWL7JwK3aqy95RDD2WN

* fix(solid): don't manually bump @astrojs/solid-js version, let changesets handle it

The package.json had the version hardcoded to 8.0.0-beta.0. Changesets
already has a 'major' bump changeset (.changeset/solid-2-adapter.md)
for @astrojs/solid-js, so the version will be correctly computed during
the release process. Restoring the version to 7.1.6 (matching main)
avoids a manual, out-of-band version bump.

* fix(solid): migrate framework-solid and framework-multiple examples to Solid 2.0

The smoke tests and astro check CI jobs were failing because reverting
the manual @astrojs/solid-js version bump (back to 7.1.6, matching main)
caused pnpm to workspace-link the rewritten (Solid 2.0) integration into
examples/framework-solid and examples/framework-multiple, which were
still pinned to solid-js@^1.9.19 and the old JSX import source.

Update both examples to Solid 2.0 (solid-js@^2.0.0, @solidjs/web@^2.0.0,
jsxImportSource: '@solidjs/web'), matching every other fixture in the
repo that this PR already migrated. Verified both examples build and
pass astro check locally, along with the full example smoke build.

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Matthew Phillips <[email protected]>
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