Coralite v0.40.2 Released
Coralite version 0.40.2 is now available, delivering stability fixes and performance optimizations to the build process and client-side runtime. The main highlight of this release is a recursive dependency tracking mechanism that ensures incremental builds accurately reflect changes in nested components. This version also resolves runtime errors in collection handlers and refactors custom element registration to reduce startup latency.
Recursive Dependency Tracking for Incremental Builds #
To support architectures utilizing nested Incremental Static Regeneration (ISR), Coralite must accurately map relationships between pages and components. This release implements a recursive walk to track deep component dependencies across both declarative markup and imperative component definitions.
A new directPageComponents side-car registry has been integrated into app._dependencyGraph. To optimize rebuild times, these dependencies are serialized and restored via .coralite/manifest.json. The dependency graph walker handles circular references and automatically refreshes during incremental build checks.
Defensive Collection Handlers #
This release addresses a TypeError that occurred in the onPageDelete handler when cleanups were triggered on missing or partially initialized dependency graphs. The packages/coralite/lib/collection-handlers.js module now includes defensive validation checks for app._dependencyGraph and malformed return values from user hooks. Unit tests have been updated and refactored to verify that pages are safely removed from the side-car registry upon deletion.
Streamlined Custom Element Initialization #
In the runtime environment, we have removed redundant post-definition upgrade logic. Previously, Coralite executed a manual query loop to upgrade existing custom elements after calling customElements.define. Because modern browsers natively upgrade existing elements when a matching definition is registered, this manual loop has been removed to reduce startup latency and simplify initialization.
How to Upgrade #
To upgrade to the latest version, update your project dependencies:
npm install coralite@0.40.2
npm install coralite-scripts@0.40.2
