Installation
Add @sigx/server-renderer to your project and import from the right subpath.
Install
pnpm add @sigx/server-rendererDependency
The only runtime dependency is sigx, the host framework. It is declared as a
regular dependency, so installing @sigx/server-renderer pulls sigx in
automatically — there is no separate install step and no peer dependency to add.
The package is ESM-only ("type": "module", no CommonJS build). Use it from
an ESM project or bundler.
Subpath imports
@sigx/server-renderer ships three tree-shakeable entry points (all with
sideEffects: false). Import from the right one so a browser bundle never pulls
in Node code:
| Import path | Use it for | Notes |
|---|---|---|
@sigx/server-renderer | useHead, createSSR, ssrClientPlugin, shared types | Universal — head + plugin system, re-exports renderToString/renderToStream |
@sigx/server-renderer/server | renderToString, renderToStream, renderToNodeStream, renderToStreamWithCallbacks | Node-only render APIs |
@sigx/server-renderer/client | hydrate, ssrClientPlugin, plugin hooks | Browser-only hydration |
A typical app uses all three across its entry files:
// entry-server.tsx
import { renderToNodeStream } from '@sigx/server-renderer/server';
// entry-client.tsx
import { ssrClientPlugin } from '@sigx/server-renderer/client';
// any component
import { useHead } from '@sigx/server-renderer';
renderToNodeStream and renderToStreamWithCallbacks are exported only from
/server, not from the main entry. Hydration internals (hydrate, hydrateNode,
registerClientPlugin, …) are exported only from /client.
Import side effects
Importing the package runs one-time setup automatically: it augments the SSR
directive types and patches getSSRProps onto built-in directives such as show
so they serialize correctly during SSR. You do not need to call anything to enable
this.
Build / Vite wiring
No special Vite config is required to consume the package — the standard
SignalX JSX/Vite setup for your host app applies. There is no CLI or bin —
the package is a library you import.
Adding islands
@sigx/server-renderer has no concept of client:* directives on its own. To
hydrate only the interactive parts of a page, add the islands package on top:
pnpm add @sigx/ssr-islandsSee @sigx/ssr-islands for the full setup.
