LessJS 的默认生产产物是静态 HTML。构建阶段会把页面渲染成带 Declarative Shadow DOM 的文档,并注入必要的 client island entry。
对用户来说,生产构建只有一个入口:
deno task build
结果写入 dist/。如果应用没有动态 API 依赖, 这个目录可以直接部署到 GitHub Pages、Cloudflare Pages、Netlify、Vercel static output 或 S3/CloudFront。
页面组件会在构建时执行 SSR,输出 Web Component host 和 shadow root template。 内容在 JavaScript 下载前就已经存在于 HTML 中。
<page-home>
<template shadowrootmode="open">
<style>/* component styles */</style>
<main>Readable content first.</main>
</template>
</page-home>
| Phase | Input | Output |
|---|---|---|
| SSR bundle | routes, renderers, middleware, API handlers, islands | generated Hono entry and .less/build-metadata.json |
| Client islands | build metadata | island entry and browser chunks under dist/client |
| SSG | generated Hono app | static HTML, copied assets and post-processed document head |
| Capability | Current state |
|---|---|
| First screen | Rendered HTML is visible before client JavaScript runs. |
| Component styles | Styles can be emitted into shadow roots through the Lit adapter path. |
| Interaction | Custom Elements upgrade after the island module is loaded. |
| Nested DSD | v0.6.0: Fully implemented with recursive rendering and slot projection. |
| Safe HTML | v0.6.0: SafeHtml/UnsafeHtml branded types with proper escaping semantics. |
SSG output must preserve security behavior from the generated Hono entry. CSP metadata, nonces, PWA head tags and island scripts should be injected through one shared post-processing path, so static deployment does not silently lose protections that exist in SSR mode.
LessJS 当前稳定交付是 SSG。ISR 需要 route-level revalidate、cache lock、adapter contracts、 failure fallback 和 CDN semantics。它属于 roadmap,而不是当前可依赖的生产能力。