Coralite v0.42.0 Released
Coralite v0.42.0 is now available. This release delivers major performance optimizations to page builds via decoupled component manifests, introduces interactive component build reporting to the CLI, stabilizes end-to-end (E2E) testing setups, and exposes the execution environment mode to client and server contexts.
Decoupled Component Manifests #
Previously, Coralite inlined the componentManifest into a script tag on every page. This meant updating a single component could change its hash and force the build system to rebuild all parent pages. Additionally, it could result in intermittent 404 errors in production where pages that were skipped during incremental builds pointed to outdated or deleted component chunks.
To address this, Coralite v0.42.0 externalizes the site-wide componentManifest to a dedicated file at /assets/js/manifest.js, which is included in the page's import map. Consequently, deep component updates (such as script changes) no longer require rebuilding parent pages. This optimization ensures more pages can be skipped during Incremental Static Regeneration (ISR), significantly boosting build speeds and preventing chunk-related 404s.
Component Build Reporting in CLI #
CLI output has been upgraded to display a "Components built" status summary before showing the standard page-building overview. This status reporting tracks completed versus skipped components under the hood, writing the manifest to .coralite/manifest.json to ensure accurate tracking. Development and monorepo builds now benefit from corrected TypeScript definitions for callbacks, and verbose logging is available to inspect build details for individual components.
Exposing Build Mode in Client and Server Contexts #
The compiler now exposes the build environment mode (development, production, or testing) directly to the server rendering context and the client-side options. On the client, this environment state is exposed globally as window.__coralite__.mode. This makes it straightforward for components and third-party plugins to execute conditional logic depending on where they are running.
// Checking the build mode at runtime
if (window.__coralite__.mode === 'development') {
setupDevelopmentHotReload();
}
Declarative and Mode-Aware Testing Attributes #
End-to-end test stability is a major focus of this release. We have introduced a declarative test attribute to target elements in E2E tests, moving away from polluting functional ref attributes. During AST compilation, the testingPlugin (now active across all modes) transforms test="val" into a scoped data-testid="[id]__val". To keep production output clean, the testing plugin strips test attributes in production mode. Additionally, Playwright locators have been refactored, and E2E tests now use stable CSS class selectors instead of brittle data attributes where appropriate.
<button>Submit Form</button>
Minor Enhancements and Refactoring #
- Duplicate Style Prevention: The client runtime now checks for and prevents duplicate style injection when styles have already been inlined by Server-Side Rendering (SSR).
- LLM Configuration: Moved the LLM configuration file to public assets for improved access and decoupling.
Breaking Changes #
- Removal of Mode Parameter from Core Context: The
modeparameter has been reverted and removed from compiler and element definitions. Instead, please use the newly exposed contexts or the globalwindow.__coralite__.modeproperty. - Testing Attribute Migration: The testing plugin no longer auto-generates
data-testidattributes fromrefattributes, and deprecated test properties have been removed. Use the new declarativetestattribute system instead.
How to Upgrade #
To upgrade to the latest version, update your project dependencies:
npm install coralite@0.42.0
npm install coralite-scripts@0.42.0
