Release

Coralite v0.27.0 Released

Coralite v0.27.0 introduces standalone Web Component generation, transitions terminology from templates to components, and refactors ref resolution to target element IDs directly.

TD
Thomas David March 5, 2026

Coralite v0.27.0 is now available. This release introduces support for compiling Coralite components into standalone client-side Web Components, renames "templates" to "components" across the public API to match frontend terminology, and refactors ref resolution to assign values directly to standard element IDs.

Standalone Web Component Generation

This release adds support for generating standalone ES Modules from Coralite components, enabling client-side rendering without requiring a build step on the consumer side. When standalone mode is enabled, the compiler generates custom elements with native Shadow DOM, client-side import resolution, attribute parity emulation, and ref hydration.

To use this feature, specify the new standaloneOutput option in your configuration or use the --standalone command-line option:

javascript
Code copied!
  // coralite.config.js
  module.exports = {
    components: './src/components',
    standaloneOutput: './dist/components'
  };

The standalone compiler also extracts and resolves module imports from Vue-style component script setup blocks. External libraries and JSON configuration files (e.g., imported with attributes: { type: 'json' }) are now compiled and mapped to the component's context.imports object, ensuring they execute correctly in the browser shadow DOM.

Renaming Templates to Components

To avoid confusion with the native HTML <template> element, all public API references to "templates" have been renamed to "components". Coralite files act as Single File Components (SFCs) wrapping HTML markup, styles, and scripts. This semantic change establishes a clean distinction between the container files and the actual HTML tags used within them.

ID-Based Ref Resolution

The refs plugin has been updated to assign ref values directly to the standard HTML id attribute instead of the custom data-coralite-ref attribute. These generated IDs are exposed in the build context under refs, enabling developers to dynamically reference element IDs in scripts using standard tokens:

html
Code copied!
  <!-- my-button.html -->
  <button ref="actionBtn">Click Me</button>
  
  <script>
    // Replaced with the generated ID during build
    const buttonId = '{{ ref_actionBtn }}'
    const button = document.getElementById(buttonId)
    console.log(button)
  </script>

Flexible Attribute Options and Language Extraction

The configuration validation rules for skipRenderByAttribute and ignoreByAttribute have been expanded to accept arrays of strings (e.g., ["data-id"]) in addition to structured attribute objects (e.g., [{ name: "data-id", value: "123" }]). Furthermore, the compiler now extracts the root lang attribute from the page <html> tag and sets the $lang metadata property automatically.

Breaking Changes

  • CoraliteResult Schema: The html property has been renamed to content, and a new required type property ('page' | 'component') has been added to support page and component outputs.
  • Public API Renaming: The templates configuration property is renamed to components. Scaffolded project directories must be changed from src/templates to src/components, and hook registrations have been renamed from onTemplate* to onComponent*.

How to Upgrade

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

bash
Code copied!
  npm install coralite@0.27.0
bash
Code copied!
  npm install coralite-scripts@0.27.0
TD

Thomas David

Creator of Coralite. Writing about the intersection of native web APIs, compiler design, and AI-assisted development.