What the compiler has for it
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 settings:
markup: boolean | "html"insrc/config.ts, the Vite plugin and the browser compiler. - The parser: type parameters of
comp, the type of the result after the properties,needsafter them, andawaitin the bodies of components and decorators; the typecomp(...) T. - The checker: the layers
server-markup.ts(markup of typeHtml, what it can show, what waits),server-components.ts(the result, inferred or written, bodies checked when their result is first needed,Content<T>, the context of a use) andserver-decorators.ts(bodies that wait, guards, wrappers of any value, members read from context);server.tshas the types ofHtml,Content<T>androoklang/server. - The generator: the layers
html-markup.ts(templates of$$html) andserver-components.ts(functions of components, their calls, the context);src/server-context.tssays what a component takes and gives, for the checker and the generator alike. - The runtime:
src/runtime/html.js($$safeHtml,$$html,$$attr,$$need,$$provide) andsrc/runtime/server.js, exported asrooklang/server(handler,serve,reply,html).