Coralite v1.5.0 Released
Coralite v1.5.0 adds lazy on-demand rendering for dynamic routes in development and route-aware cache keys for incremental static builds. Production builds continue to compile all pages into zero-JS static HTML by default while rebuilding only modified dynamic outputs.
Coralite v1.5.0 shipped on November 22, 2026. This post highlights what changed. The complete list of commits and links is in the changelog entry for v1.5.0.
Lazy Dynamic Route Rendering in Development
coralite dev now renders dynamic routes on request instead of pre-rendering every enumerated output at startup, reducing startup time and memory usage on large sites while leaving production builds uncapped. Test mode uses the same per-output request filtering.
- Dev and test server startup in server.js invokes
coralite.build()with{ dynamicPaths: [] }to skip pre-rendering dynamic routes; incoming requests resolverouteParamsviaresolveSource()and pass{ dynamicPaths: [routeParams] }to the renderer in renderer.js, which filtersenumeratedPathsusingrouteParamsKey()in route.js. createPageCache()in page-cache.js replaces the unboundedMapin server.js with a bounded LRU cache (defaulting to256entries) that tracks and evicts alias keys such aspage.htmlandpage/index.htmltogether.- Development route and cache controls in config.js, create.js, and core.js add
dev.routeFilter,dev.maxPages(aliased asdev.limit), anddev.maxCacheEntries(0disables caching), backed byapplyDevRouteLimits()in route.js. - File-change handling in server.js reloads modified pages and fixture pages (
deleteItemandsetItem) and reapplies dev route limits during HMR so lazy requests do not render stale collection data.
// coralite.config.js
import { defineConfig } from 'coralite'
export default defineConfig({
pages: './src/pages',
components: './src/components',
output: './dist',
dev: {
// Filter enumerated dynamic routes before applying the cap
routeFilter: ({ params }) => params.category !== 'archive',
// Cap total dynamic outputs in development (alias: `limit`)
maxPages: 100,
// Limit the in-memory LRU page cache (0 disables caching)
maxCacheEntries: 128
}
})
Route-Aware Incremental Cache Keys
Incremental builds now track individual dynamic page outputs using route-aware cache keys instead of relying solely on source file hashes. When a single record changes, only that output rebuilds while unchanged routes skip rendering and carry forward their manifest metadata and tracked assets.
- Dynamic routes (
paths()) are keyed by anxxHashof their sortedparams,path,pattern, and deterministically serializedserver()state viastableSerialize()increatePageCacheKey(). - Both dynamic and static pages can export
cacheKey({ route, state })to supply a customstringornumbercache key; returning any other type fails the build withCORALITE-E404. .coralite/manifest.jsonnow recordsversion(MANIFEST_VERSION = 2), automatically invalidating stale manifests from earlier builds.addRenderQueue()andCoraliteCollection.prototype.updateItem()acceptrevision(string | number) as an alias forcacheKeyon virtual pagination entries.
<html>
<head>
<title>{{ title }}</title>
</head>
<body>
<h1>{{ title }}</h1>
</body>
</html>
<script type="module">
export async function paths ({ app }) {
const fs = await import('node:fs/promises')
const path = await import('node:path')
const files = await fs.readdir(path.join(app.options.projectRoot, 'data'))
return files
.filter((file) => file.endsWith('.json'))
.map((file) => ({ id: file.replace('.json', '') }))
}
export async function server ({ route, app }) {
const fs = await import('node:fs/promises')
const path = await import('node:path')
const raw = await fs.readFile(
path.join(app.options.projectRoot, 'data', `${route.params.id}.json`),
'utf8'
)
const record = JSON.parse(raw)
return { title: record.title, revision: record.revision }
}
export function cacheKey ({ route, state }) {
return `${route.params.id}:${state.revision}`
}
</script>
Plugins queuing virtual pagination entries can pass revision directly to addRenderQueue():
await app.addRenderQueue({
pathname: 'posts/page-2.html',
content: '<h1>Page 2</h1>',
revision: 42
}, buildId)
Internal Changes
Documentation Alignment
Updated repository READMEs and the release changelog timeline to reflect the current project state.
Get Started
Scaffold a new project with the create script, then start the development server:
npm create coralite@latest my-app
cd my-app
npm run dev
The same command works with other package managers:
pnpm create coralite my-app
yarn create coralite my-app