Coralite v0.38.4 Released

Coralite version 0.38.4 is now available. This release delivers significant performance and architecture updates, focusing on production CSS optimizations, improved plugin lifecycle hooks, and robust handling of imperative custom elements. Key improvements include a transition to external CSS files using esbuild, minification of production stylesheets, and repositioning of component lifecycle hooks to allow for more powerful plugin extensions.

Transition to External CSS and Patched Element Creation #

In this release, production builds generate external CSS files rather than inline styles. This transition is powered by virtual modules and esbuild, with the ScriptManager updated to extract CSS bundle paths from the build metafile. The client runtime dynamically loads these stylesheets while preventing duplicate injections.

To support imperative elements, we have patched document.createElement. This ensures that imperatively created components upgrade automatically after their styles have loaded, with all components included in the bundle manifest.

Production CSS Minification and Registration Resiliency #

We integrated esbuild to handle CSS minification for production builds, disabling source map generation for styles to minimize final bundle sizes. Component registration within the Coralite core has also been refactored. Scoped styles are now bundled successfully even in cases where script evaluation fails, preventing flash of unstyled content (FOUC) and improving rendering robustness.

Enhanced Plugin Lifecycle Hooks #

The renderer now automatically extracts custom elements from plugin code and includes them in the page manifest. In addition, the execution of the onBeforeComponentRender hook has been moved after attribute and hydration processing. This ordering allows plugins to inspect and override the fully populated initial state of a component before the reactive proxy is created and the initial DOM stamp occurs.

How to Upgrade #

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

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

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!