@solidiom/astrojs-solid-next
v1.0.0
Published
Astro integration that renders Solid 2 components as islands using the Solidiom/Vite Solid 2 toolchain.
Readme
@solidiom/astrojs-solid-next
Astro integration that renders Solid 2 components as islands using the Solidiom/Vite Solid 2 toolchain.
Overview
This integration registers a Solid 2 renderer with Astro so that .tsx Solid
components can be used as Astro islands (client:load, client:idle,
client:only, etc.). It wires up @solidjs/vite-plugin for SSR and aliases
installed @solidiom/* primitive packages to their real Solid JSX source so
they render correctly across every Vite environment and package manager.
Installation
pnpm add @solidiom/astrojs-solid-nextPeer dependencies
Provide these in your project (they are declared as peer dependencies):
| Package | Supported range |
| -------------- | -------------------- |
| astro | ^7.0.0 |
| solid-js | 2.0.4 |
| @solidjs/web | 2.0.4 |
| vite | ^8.0.0 \|\| ^9.0.0 |
@solidjs/vite-plugin@3 peers vite ^8 || ^9, and Astro 5/6 pin Vite 6/7, so they cannot satisfy the toolchain — only Astro 7 (which depends on Vite 8) resolves. The solid-js / @solidjs/web rows are the exact tested pin, not a range: they ship as the concrete version the workspace catalog pins.
Requires Node >=24.
Usage
Add the integration to your astro.config.mjs:
import { defineConfig } from "astro/config"
import solid from "@solidiom/astrojs-solid-next"
export default defineConfig({
integrations: [solid()],
})Options
The default export accepts an optional Options object. Both fields are
forwarded to @solidjs/vite-plugin to scope which modules it transforms:
interface Options {
include?: string | RegExp | (string | RegExp)[]
exclude?: string | RegExp | (string | RegExp)[]
}Set include / exclude when more than one JSX renderer (for example
@astrojs/react or @astrojs/preact) is enabled, so each renderer only
transforms its own components:
import { defineConfig } from "astro/config"
import solid from "@solidiom/astrojs-solid-next"
export default defineConfig({
integrations: [solid({ include: ["**/solid/**"] })],
})Exports
| Entry point | Export |
| ------------------------------------------------- | -------------------------------------------------------------------- |
| @solidiom/astrojs-solid-next | Default: integration factory. Named: getContainerRenderer |
| @solidiom/astrojs-solid-next/container-renderer | getContainerRenderer — returns the Astro container AstroRenderer |
| @solidiom/astrojs-solid-next/client.js | Client-side island hydration entrypoint |
| @solidiom/astrojs-solid-next/server.js | Server-side rendering entrypoint |
getContainerRenderer() returns the renderer descriptor used with Astro's
Container API:
import { getContainerRenderer } from "@solidiom/astrojs-solid-next"License
Apache-2.0
