Skip to main content

Coralite v0.20 Released

Thomas David -

I am thrilled to announce the release of Coralite v0.20.1 and Coralite Scripts v0.20.0! This major update focuses on significantly improving build performance, simplifying the development environment, and introducing powerful new APIs for metadata and DOM manipulation.

Major Performance Improvements #

Build times and page generation have been majorly improved in this release. The core compilation process now parallelizes custom element creation, especially for asynchronous operations. In benchmarks, this resulted in a dramatic speedup (up to 10x faster for complex component trees), reducing build times from seconds to milliseconds.

Additionally, the development server now features in-memory page caching. This means subsequent requests to unchanged pages are served instantly, and multi-page builds are handled more efficiently, making the developer experience smoother and faster.

New Metadata Plugin #

Managing page metadata is now easier than ever with the new built-in Metadata Plugin. This plugin automatically extracts <meta> tags from your HTML head sections and component slots, making them available as variables in your templates.

Metadata variables are now prefixed with meta_ to avoid conflicts and provide a consistent naming convention. For example:

HTML
Code copied!


<meta name="author" content="Thomas"></meta>
<meta name="description" content="A great post"></meta>



<p>Author: {{ meta_author }}</p>
<p>Description: {{ meta_description }}</p>

Enhanced DOM API #

This release includes a refactored internal DOM node creation logic designed for greater robustness and type safety. It also introduces the new factory functions createCoraliteElement and createCoraliteTextNode, which provide a standardized approach for programmatically creating nodes in plugins and scripts.

The new coralite.build API replaces the older compilation methods, offering better error handling and a callback overload for more flexible build scripts.

Simplified Environment Setup #

The system no longer depends on any experimental Node.js flags! You can now run Coralite without the --experimental-vm-modules flag, simplifying your package.json scripts and CI/CD pipelines.

Bug Fixes & Improvements #

This release also includes numerous bug fixes and quality-of-life improvements:

How to Upgrade #

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

bash
Code copied!
  npm install coralite@0.20.1
bash
Code copied!
  npm install coralite-scripts@0.20.0

Check out the full changelog on Codeberg for a complete list of changes.

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!