Coralite v0.28.0 Released

Coralite v0.28.0 is now available. This release enhances generated web components with native, reactive attribute observation and template data-binding. It also simplifies the build pipeline by generating standalone components unconditionally, updates command-line flags, and refines test coverage for standalone components.

Reactive Web Components with Dynamic Attribute Binding #

The code generation engine in script-manager.js has been enhanced to produce more reactive web components. Generated elements now include an observedAttributes() getter and an attributeChangedCallback() to synchronize outer HTML attribute modifications with internal component context in real-time.

Additionally, a lightweight text node walker has been implemented. This engine finds and replaces template tokens (e.g. {{ attributeName }}) inside text content and CSS bindings within the shadow DOM, bypassing the need for a full AST compiler for standalone components.

javascript
Code copied!
  // Example structure of generated reactive elements in v0.28.0
  class CoraliteComponent extends HTMLElement {
    static get observedAttributes() {
      return ['label', 'status'];
    }
  
    attributeChangedCallback(name, oldValue, newValue) {
      if (oldValue !== newValue) {
        this._context[name] = newValue;
        this._updateTemplateTokens();
      }
    }
  }

Unconditional Standalone Component Builds #

Standalone components are now generated unconditionally. Previously, standalone component compilation was tied to configuration options. Starting in v0.28.0, the compiler always yields components as standard .js files. If the standaloneOutput option is omitted, assets default to outputting relative to the main build directory inside a components folder.

CLI Simplifications and Component Option Rename #

The CLI options and documentation have been streamlined. The option -t has been renamed to -c (or --components) to clearer align its name with its purpose of pointing to the components directory. In addition, setup documentation has been trimmed down to highlight npm installation commands directly.

Breaking Changes #

How to Upgrade #

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

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