Turning it on
Components on the server — design
Status: implemented are markup as HTML, components of the server, their results,
Responsegoing up,Content<T>, component values with a result, decorators with guards, wrappers that take the body and the request context, routes, androoklang/server; the server of the site,site/server/main.rk, is written with them, and the guide has a section on them. The decisions are collected at the end of the document, together with what is not decided yet. Server markup, components androoklang/serverremain experimental in 1.x and may change between releases.
This document builds on components.md: components, decorators, context, components as values. It describes only what is different on the server.
The mode of markup is a setting of the package, as markup itself is:
{ "rook": { "markup": "html" } }
"dom"is the markup of the browser;true, as written now, means"dom"."html"turns markup into strings of HTML and components into the components of the server described here.- A server in the same repository as the browser code gets a
package.jsonof its own in its folder, which is how a file finds its settings now (src/config.ts), assite/server/of this repository does. Its"type": "module"keeps the compiled.jsfiles modules. - The Vite plugin takes
rook({ markup: "html" }), the browser compiler{ markup: "html" }. The CLI reads the setting of the package; its--markupis the markup of the browser.