Coralite v0.40.0 Released
Coralite v0.40.0 is now available, delivering improvements to component observability, development builds, and the asset pipeline. This release introduces a granular lifecycle manager for tracking element hydration, provides richer options for configuring static assets through the CLI, and implements dual-build E2E testing to guarantee consistency between development and production outputs.
Granular Lifecycle Management #
We have transitioned the framework's initialization tracker from the legacy window.__coralite_ready__ global flag to a centralized window.__coralite__.lifecycle namespace. Powered by the new CoraliteLifecycleManager, components now progress through explicit defined, rendered, and hydrated phases.
The manager is inlined directly in the document head for early availability. Developers can leverage the new waitFor API to track dynamic or asynchronously loaded elements programmatically:
window.__coralite__.lifecycle.waitFor(element).then(() => {
console.log('Component is fully hydrated and interactive.');
});
Enhanced Assets Support #
The coralite-scripts command-line interface now supports an -a or --assets option. This allows defining asset mappings directly from the shell using either src:dest or pkg:path:dest syntax. These CLI flags are merged using a selective override strategy on top of configurations defined in defineConfig.
This update also whitelists assets during clean builds, preventing them from being swept away during incremental rebuilds.
# Map local source directory to destination, and package assets to a custom path
coralite-scripts build -a src/assets:dist/assets -a my-package:src/icons:dist/icons
Development Cache Fixes and Dual-Build E2E Testing #
We resolved an issue with imperative component caching during development where updates failed to invalidate the builder context properly. Unit and integration tests have been added to cover esbuild context resets and incremental additions.
Additionally, the testing infrastructure has been expanded to validate projects in both development and production environments. The E2E test suite now builds isolated outputs into .coralite-dev and .coralite-prod directories, executing Playwright tests against both targets via a programmatic server.
Breaking Changes #
- Lifecycle Namespace Migration: The legacy global indicator
window.__coralite_ready__has been removed in favor ofwindow.__coralite__.lifecycle. Dynamic waiting must now use the newlifecycle.waitFor(element)API or the E2E helperwaitForHydration.
How to Upgrade #
To upgrade to the latest version, update your project dependencies:
npm install coralite@0.40.0
npm install coralite-scripts@0.40.0
