astro-solid-next
v0.1.0
Published
Astro renderer integration for Solid 2.0 ([email protected]) — SSR islands rendered with renderToStream and hydrated with the 2.0 runtime
Maintainers
Readme
astro-solid-next
Astro renderer integration for Solid 2.0 ([email protected]). The official
@astrojs/solid-js targets Solid 1.x; this integration renders Astro islands with the
2.0 runtime (@solidjs/web) and the new compiler plugin (@solidjs/vite-plugin).
Usage
npm i astro-solid-next solid-js@rc @solidjs/web@rc --legacy-peer-deps// astro.config.mjs
import { defineConfig } from 'astro/config'
import solidNext from 'astro-solid-next'
export default defineConfig({
integrations: [solidNext()],
})---
import Counter from '../components/Counter.tsx'
---
<Counter start={5} client:load>
<p>slotted content</p>
</Counter>Options: include / exclude (vite filter patterns) to scope which files the Solid
compiler transforms — needed when combining multiple JSX frameworks.
How it maps onto Solid 2.0
- Server islands render with
await renderToStream(fn, { renderId, noScripts })— awaiting the stream resolves the fully settled HTML, so async in the reactive graph (promises increateMemounder aLoadingboundary) settles before the island serializes. Server-only islands render insideNoHydrationwithnoScripts: true. - Hydration uses the same
renderIdon the client (hydrate(fn, el, { renderId })), scoping hydration keys per island. The hydration bootstrap is injected once per page via Astro'srenderHydrationScript→generateHydrationScript(). - Props updates (view transitions) patch a
createStorewithreconcile, same as the official 1.x renderer — stores are part of coresolid-jsin 2.0. - The compiler runs in legacy transform-only mode (
ssr: true, nostart): Astro owns the server and the document, the plugin only provides hydratable client output and string-mode SSR output per Vite environment.
Example
examples/basic — a static Astro build with a server-only island and a hydrated
counter island with slotted content.
cd examples/basic && npm i --legacy-peer-deps && npm run build && npm run previewStatus
Experimental. Tracks the Solid 2.0 RC (peer ^2.0.0-rc.0) and Astro ≥ 5 (tested on
Astro 7 / Vite 8). Expect churn until Solid 2.0 is stable.
