Release

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.

TD
Thomas David November 22, 2026

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 resolve routeParams via resolveSource() and pass { dynamicPaths: [routeParams] } to the renderer in renderer.js, which filters enumeratedPaths using routeParamsKey() in route.js.
  • createPageCache() in page-cache.js replaces the unbounded Map in server.js with a bounded LRU cache (defaulting to 256 entries) that tracks and evicts alias keys such as page.html and page/index.html together.
  • Development route and cache controls in config.js, create.js, and core.js add dev.routeFilter, dev.maxPages (aliased as dev.limit), and dev.maxCacheEntries (0 disables caching), backed by applyDevRouteLimits() in route.js.
  • File-change handling in server.js reloads modified pages and fixture pages (deleteItem and setItem) and reapplies dev route limits during HMR so lazy requests do not render stale collection data.
js
Code copied!
// 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 an xxHash of their sorted params, path, pattern, and deterministically serialized server() state via stableSerialize() in createPageCacheKey().
  • Both dynamic and static pages can export cacheKey({ route, state }) to supply a custom string or number cache key; returning any other type fails the build with CORALITE-E404.
  • .coralite/manifest.json now records version (MANIFEST_VERSION = 2), automatically invalidating stale manifests from earlier builds.
  • addRenderQueue() and CoraliteCollection.prototype.updateItem() accept revision (string | number) as an alias for cacheKey on virtual pagination entries.
html
Code copied!
<!DOCTYPE html>
<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():

js
Code copied!
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:

bash
Code copied!
npm create coralite@latest my-app
cd my-app
npm run dev

The same command works with other package managers:

bash
Code copied!
pnpm create coralite my-app
yarn create coralite my-app
TD

Thomas David

Creator of Coralite. Writing about the intersection of native web APIs, compiler design, and AI-assisted development.