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:

javascript
Code copied!
  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.

bash
Code copied!
  # 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 #

How to Upgrade #

To upgrade to the latest version, update your project dependencies:

bash
Code copied!
  npm install coralite@0.40.0
bash
Code copied!
  npm install coralite-scripts@0.40.0

Related posts

More blog posts

Start Building with Coralite!

Use the scaffolding script to get jump started into your next project with Coralite

Copied commandline!