Coralite v0.30.0 Released

Coralite v0.30.0 is now available. This release stabilizes the framework runtime by introducing a unified error-handling system, replacing the global, document-wide MutationObserver with efficient eager component mapping, and addressing nested declarative elements inside shadow DOM boundaries. It also improves application startup times and implements stricter API boundaries for web component state mutation.

Unified Structured Error and Warning Handling #

This release introduces a framework-wide onError structured callback mechanism. It unifies diagnostic reporting across the HTML parser, style transformation pipelines, build error-handling flows, and developer CLI tools. An internal handleError method safely wraps the user-configured callback, ensuring that errors are safely caught, formatted, and exposed without revealing internal handler implementation details. By default, the logger automatically throws when encountering critical errors (level 'ERR'), enabling reliable CI failure detection.

javascript
Code copied!
  // coralite.config.js
  export default {
    onError(error) {
      if (error.level === 'ERR') {
        console.error(`[Coralite Critical] Code ${error.code}: ${error.message}`);
      } else {
        console.warn(`[Coralite Warning] ${error.message}`);
      }
    }
  };

Eager Component Loading and Shadow DOM Support #

To improve browser rendering performance and eliminate event loop overhead, the global MutationObserver injected into generated pages has been removed. In its place, Coralite now eagerly pre-maps page dependencies. Component script modules serialize child declarative dependencies inside a dependencies manifest, and components query elements directly during execution. An internal loadCache guards against duplicate module network requests and race conditions.

Furthermore, this update adds recursive component instantiation inside imperative web components. A dedicated helper recursively loads components and registers shadow-root-level observers, ensuring declarative child components dynamically inserted into a shadow DOM are automatically processed and hydrated.

Startup and Parser Performance Optimizations #

Framework boot and compile times have been optimized through several structural updates:

Breaking Changes #

javascript
Code copied!
  // Before v0.30.0 (direct property mutation)
  myElement.values.someState = 'new-value';
  
  // In v0.30.0 (standard DOM interaction)
  myElement.setAttribute('some-state', 'new-value');

How to Upgrade #

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

bash
Code copied!
  npm install coralite@0.30.0
bash
Code copied!
  npm install coralite-scripts@0.30.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!