Module

Solid.Web.SSR

Package
purescript-purs-solid
Repository
arazorda/purs-solid

Server rendering. Run under Node's default export conditions, which select Solid's server build.

#RenderOptions Source

type RenderOptions :: Row Typetype RenderOptions = (noScripts :: Boolean, nonce :: String, onError :: Error -> Effect Unit, renderId :: String)

#StreamOptions Source

type StreamOptions :: Row Typetype StreamOptions = (noScripts :: Boolean, nonce :: String, onCompleteAll :: (String -> Effect Unit) -> Effect Unit, onCompleteShell :: (String -> Effect Unit) -> Effect Unit, onError :: Error -> Effect Unit, renderId :: String, signal :: AbortSignal)

RenderOptions plus what only streaming renders take.

#renderToStringWith Source

renderToStringWith :: forall given missing. Union given missing RenderOptions => Record given -> JSX -> Effect (Either Error String)

Takes any subset of RenderOptions.

#renderToStringWithHead Source

renderToStringWithHead :: forall given missing. Union given missing RenderOptions => Record given -> JSX -> Effect (Either Error { head :: String, html :: String })

Returns head-bound markup (head tags, asset links, styles) separately, for a host that owns the <head> template.

#renderToStringAsync Source

renderToStringAsync :: JSX -> Aff (Either Error String)

Waits for all async work. Left only for errors thrown while starting the render; later render errors go to onError.

#renderToStringAsyncWith Source

renderToStringAsyncWith :: forall given missing. Union given missing StreamOptions => Record given -> JSX -> Aff (Either Error String)

#renderToReadableStream Source

renderToReadableStream :: forall given missing. Union given missing StreamOptions => Record given -> JSX -> Effect (Either Error (ReadableStream Uint8Array))

Streams the HTML: the shell first, then each boundary as it resolves. Left only for errors thrown while starting the render; later render errors go to onError.

#hydrationScript Source

hydrationScript :: Effect (Either Error String)

The script that captures events before hydration; put it in <head>.

#hydrationScriptWith Source

hydrationScriptWith :: forall given missing. Union given missing (eventNames :: Array String, nonce :: String) => Record given -> Effect (Either Error String)

eventNames: the events captured before hydration (Solid's default set when left out).