View Source LiveSvelte.SSR behaviour (LiveSvelte v0.13.3)

A behaviour for rendering Svelte components server-side.

To define a custom renderer, change the application config in config.exs:

config :live_svelte, ssr_module: MyCustomSSRModule

Link to this section Summary

Types

A render response which should take the shape

Link to this section Types

@type component_name() :: String.t()
@type props() :: %{optional(String.t() | atom()) => any()}
@type render_response() :: %{
  required(String.t()) =>
    %{required(String.t()) => String.t() | nil} | String.t()
}

A render response which should take the shape:

%{
  "css" => %{
    "code" => String.t | nil,
    "map" => String.t | nil
  },
  "head" => String.t,
  "html" => String.t
}
@type slots() :: %{optional(String.t() | atom()) => any()}

Link to this section Callbacks

Link to this callback

render(component_name, props, slots)

View Source
@callback render(component_name(), props(), slots()) :: render_response() | no_return()

Link to this section Functions

Link to this function

render(name, props, slots)

View Source
@spec render(component_name(), props(), slots()) :: render_response() | no_return()
This function is deprecated. Use LiveSvelte.SSR.NodeJS.server_path/0 instead..