Coralite v1.4.0 Released
Coralite v1.4.0 trims client hydration payloads by deduplicating shared page state and dropping hydration entries for attributes-only static components, keeping static output free of unnecessary runtime data. This release also publishes a machine-readable diagnostic catalogue via the package root and CLI, alongside targeted fixes for base evaluation, CSP inline styles, E301 auto-fixing, and client context types.
Coralite v1.4.0 shipped on November 21, 2026. This post highlights what changed. The complete list of commits and links is in the changelog entry for v1.4.0.
Machine-Readable Diagnostic Catalogue & `coralite diagnostics` CLI
Coralite publishes DIAGNOSTIC_CATALOG in diagnostic-catalog.js and re-exports it from index.js, providing a single source of truth for all 52 runtime diagnostic codes across component, plugin, page, accessibility, and config families. Each entry exposes code, title, family, severity, fixable, fixActions (when auto-fixable), summary, and fix guidance.
- Adds the
coralite diagnosticscommand in coralite.js with--family,--severity,--fixable,--search, and--format(consoleorjson) flags for CI pipelines, editors, and agent tooling. - Enforces catalogue–runtime parity in diagnostic-catalog.spec.js by scanning
packages/coralite/libfor emittedCORALITE-*codes, backed by CLI coverage in cli.spec.js.
npx coralite diagnostics
npx coralite diagnostics --family plugin --fixable
npx coralite diagnostics --search "client()" --format json
import { DIAGNOSTIC_CATALOG } from 'coralite'
const autoFixableErrors = DIAGNOSTIC_CATALOG.filter(
(entry) => entry.severity === 'error' && entry.fixable
)
for (const { code, title, fixActions } of autoFixableErrors) {
console.log(`${code}: ${title} (${fixActions.join(', ')})`)
}
Deduplicated Page State in Client Hydration Payloads
Coralite now serializes a minimal page descriptor for client hydration, emits shared page state once through the page config, and prunes inherited page state from individual component entries. Hydrated components read shared page state at runtime, and attributes-only static components no longer generate hydration entries.
> [!IMPORTANT]
> Breaking Change: Client-side component state no longer exposes build-only page metadata (page.file, page.script, page.blocks, routeSegments, enumeratedPaths, and has* flags). Expose any required values explicitly through server() state.
Bug Fixes & Improvements
Clean Base Evaluation for Required Attributes
Components declaring required: true attributes previously emitted false missing-attribute warnings and threw errors in getters during base evaluation, forcing a static fallback registration. In component-setup.js, Coralite now detects context.session.buildId === 'base-evaluation', seeds missing required attributes with type-appropriate placeholders ('' for String, 0 for Number, false for Boolean), and suppresses validation warnings. Page renders continue to validate and report missing required attributes normally, verified by new unit tests in attributes-validate.spec.js.
<template id="nav-link">
<a href="{{ normalizedHref }}"><slot></slot></a>
</template>
<script type="module">
export const attributes = {
href: { type: String, required: true }
}
export const getters = {
// Receives '' during base evaluation and the authored value on page render
normalizedHref: ({ state }) => state.href.replace(/\/+$/, '')
}
</script>
Removal of Undocumented `id` Property from `CoraliteClientContext`
Removes the unused id property from the CoraliteClientContext typedef in component.js. The client runtime only injects instanceId, so generated TypeScript declarations now match runtime behavior and prevent accidental destructuring of an undefined property.
Before:
<template id="x-panel">
<div ref="panel"><slot></slot></div>
</template>
<script type="module">
export function client ({ id, refs }) {
refs('panel').dataset.instance = id
}
</script>
After:
<template id="x-panel">
<div ref="panel"><slot></slot></div>
</template>
<script type="module">
export function client ({ instanceId, refs }) {
refs('panel').dataset.instance = instanceId
}
</script>
E301 Auto-Fix Support for Flat Exported `client` Handlers
The E301 dynamic-import fixer previously only matched legacy defineComponent({ client }) wrappers, causing components using flat named exports to lose their static import while retaining an undefined reference. The fixer now detects both defineComponent and flat exported client function or arrow handlers, skips rewriting when neither exists, injects the awaited dynamic import (marking the handler async when required), and validates the result with unit tests covering both flat forms.
CSP Inline `style` Attribute Preservation with `'unsafe-inline'`
Because CSP hashes supersede 'unsafe-inline', appending style hashes alongside a configured 'unsafe-inline' directive silently blocked authored inline style attributes. The renderer now skips appending style hashes when style-src allows 'unsafe-inline', while keeping hash-only enforcement intact when 'unsafe-inline' is absent.
Internal Changes
Client Payload Size Benchmark Suite
Adds an internal benchmark suite that builds component-heavy static and dynamic pages to measure raw and gzipped HTML size, hydration payload size, generated JavaScript size, and per-instance hydration cost, wired into the benchmark runner, reporter, and regression thresholds.
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