Coralite v1.6.0 Released
Coralite v1.6.0 accelerates static HTML builds with pre-render cache hooks, parsed page template reuse, and per-locale client config chunks. Progressive client hydration also gains fast-path HTML skipping alongside fixes for production stylesheet injection, recursive `:host` CSS scoping, and incremental build caching.
Coralite v1.6.0 shipped on November 30, 2026. This post highlights what changed. The complete list of commits and links is in the changelog entry for v1.6.0.
Pre-Render Cache Hooks (`contentKey` and `shouldSkipRender`)
Dynamic pages can now export contentKey({ route, state }) to identify each compiled static HTML output and shouldSkipRender({ route, page, previousContentKey }) to skip server(), HTML parsing, and component rendering before SSR runs. Across 2,000 dynamic pages, warm builds drop from 425.2ms to 109.8ms with zero server() calls, and single-record edits invoke server() once instead of 2,000 times.
- Returning
truefromshouldSkipRender()reuses the cached output stored in the manifest; returning a non-boolean fromshouldSkipRender()or a non-string/non-number fromcontentKey()raisesCORALITE-E404. cacheKey()remains available as a deprecated alias forcontentKey()so v1.5.0 pages continue working without modification.
<main>
<h1>{{ title }}</h1>
</main>
<script type="module">
export function contentKey ({ route, state }) {
return `${route.params.id}:${state.revision}`
}
export function shouldSkipRender ({ route, previousContentKey }) {
return `${route.params.id}:${revisionFor(route.params.id)}` === previousContentKey
}
</script>
Parsed Page Template Reuse
Production builds previously cleared the parsed page root between dynamic outputs and re-ran parseHTML on every route. The renderer in renderer.js now caches a pristine parsed template on each page item and clones it per output, dropping parseHTML calls for 2,000 dynamic outputs from 2,002 to 3 and reducing cold build time from ~686ms to ~560ms.
Per-Locale Client Config Chunks
Opt-in i18n configuration strips each plugin's client.config.locales overrides from the shared client runtime and emits one hashed chunk per locale. Coralite resolves the active locale from route.params.lang or route.params.locale (falling back to defaultLocale), so a dictionary edit rebuilds only pages matching that locale while keeping the shared runtime chunk byte-identical.
- In the two-locale benchmark, editing one locale dictionary drops rebuilt pages from 2 to 1.
- Locale chunks partition plugin
client.config.localesonly; keep SSR template translations in pageserver()state viamessages[lang]for per-locale page invalidation.
// coralite.config.js
import { defineConfig } from 'coralite'
export default defineConfig({
i18n: {
locales: ['en', 'fr'],
defaultLocale: 'en'
}
})
// src/plugins/i18n.js
import { definePlugin } from 'coralite'
export default definePlugin({
name: 'i18n',
client: {
config: {
locales: {
en: { welcome: 'Welcome' },
fr: { welcome: 'Bienvenue' }
}
},
init: ({ config }) => {
window.__coralite__.plugins.i18n = { dictionary: config }
}
}
})
Fast-Path Client HTML Processing and List Store Lookups
For progressive client-side DOM updates, formatCoraliteHTML in inject.js now returns immediately when markup contains no template tokens, ref attributes, or test attributes, and the generated runtime skips custom-element tag scans when no registered tag appears. The lists plugin store also replaces findIndex + getKey scans with direct indexOf lookups for update, remove, swap, and re-add operations.
- Keyed js-framework-benchmark script medians drop from 66.9ms to 26.4ms (
run1k), 74.7ms to 35.7ms (replace1k), and 644ms to 266.6ms (create10k). bindreads an internalvalues()accessor instead of copying arrays throughall(), whileall()retains its defensive copy.
Sharded Incremental Manifest Storage (Experimental)
Coralite adds createManifestStore() in manifest-store.js with a compact single-file default and optional hash-bucketed sharding via build.manifestShards. Existing single-file manifests migrate on the first sharded build without invalidating cache keys.
- Compact single-file saves drop from 153.6ms to 104.5ms at 45,000 entries.
- Manifest sharding carries an experimental label because current benchmarks show no speed advantage over the compact single file.
Bug Fixes & Improvements
Source-Keyed Template Invalidation and Case-Insensitive Attribute Checks
The renderer in renderer.js now stores the exact source string with pageItem._parsedTemplate and reuses the cached AST only when cachedTemplate.content === content, preventing stale HTML after source edits between builds. In inject.js, formatCoraliteHTML replaces case-sensitive .includes() checks with !/ref/i.test(html) and !/test/i.test(html) so uppercase and mixed-case attributes still receive instance scoping and data-testid stripping.
<!-- Mixed-case attributes now match case-insensitively for ref scoping and data-testid stripping -->
<button REF="submitBtn" DATA-TESTID="submit-action">Submit</button>
Production `externalStyles` Configuration Precedence
coralite build previously recomputed externalStyles from config.styles.input and ignored top-level config.externalStyles entries. buildCommand in build.js now applies non-empty config.externalStyles first and falls back to config.styles.input otherwise.
- Applying the stylesheet in the js-framework-benchmark comparison removes an unstyled paint confounder (
03<em>update10th1k</em>x16total drops from 111.2ms to 47.4ms and paint drops from 103.3ms to 39.9ms).
// coralite.config.js
export default {
components: 'src/components',
pages: 'src/pages',
output: 'dist',
externalStyles: ['/css/currentStyle.css']
}
<link rel="stylesheet" href="/css/currentStyle.css">
Recursive `:host` Rewriting in Functional Pseudo-Classes
The scoped CSS compiler previously inspected only direct selector children for :host and :host-context(), leaving literal :host selectors inside :not(:host([open])), :is(:host([open]), :host(.pinned)), and :where(:host-context(.dark)), which browsers drop in Light DOM. The transform now rewrites host pseudos recursively through functional pseudo-classes, preserves argument order when expanding parameterized :host(), and hoists nested rules containing a host selector out of their parent rule.
Incremental Manifest Cleanup, CLI Server Forwarding, and Cache Labels
Several incremental build and CLI configuration edge cases now behave consistently across production, dev, and test runs.
createManifestStore().save()in manifest-store.js deletes leftover shard directories when saving in single-file mode (shards: 1), preventing stale shard resurrection when switching back to sharded mode.- Dev and test servers in server.js now forward
build.concurrency(with top-levelconcurrencyfallback),build.manifestShards, andi18ntocreateCoralite(). - Passing an
i18nconfig object withoutdefaultLocalein create.js now defaultsdefaultLocaleto'en'. coralite buildnow labels unchanged build units ascached.
// coralite.config.js
import { defineConfig } from 'coralite'
export default defineConfig({
build: {
concurrency: 8,
manifestShards: 16
},
i18n: {
locales: ['en', 'fr', 'de']
}
})
Internal Changes
Build Performance Benchmarks, Provenance, and Cold Build Profiling
The benchmark harness adds 07-build-performance (measuring cold, warm, and one-record-change builds of 2,000 synthetic paths() records), repeated cold-build sampling, and a V8 CPU cold-build profiling script. The runner in runner.js now records a 12-character SHA-256 suiteHash and working-tree status (dirty, dirtyEntries) before each run, forwards --iterations with min–max spread columns across suites, and provides --variant=legacy|current for identical-harness comparisons.
node packages/coralite/benchmarks/runner.js \
--suite=build-performance \
--variant=current \
--iterations=5 \
--task-id=incremental-check \
--phase=after \
--save
{
"taskId": "incremental-check",
"phase": "after",
"source": {
"suiteHash": "a1b2c3d4e5f6",
"dirty": false,
"dirtyEntries": 0
},
"results": {
"build-performance": {
"warm": {
"wallMs": 42.3,
"wallSpreadMs": 1.8
}
}
}
}
Documentation and README Refinements
Project READMEs now lead with deterministic fail-fast static builds, native Web Components, and measured benchmark data while updating plugin, slots, Hot CSS, and output directory documentation. Performance guides consolidate identical-fixture cold comparisons (494.4ms vs 511.5ms), clarify i18n state dictionary invalidation boundaries with regression tests, and update the website release changelog timeline.
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