Coralite v0.28.2 Released

Coralite v0.28.2 is now available. This release introduces a static assets plugin to handle binary dependencies like WebAssembly, refactors client-side script execution parameters, updates the DOM generation behavior for the Refs plugin, and refines programmatic APIs.

Static Assets Plugin for Binary Dependencies #

To support components that rely on compiled assets, we have introduced staticAssetPlugin. The plugin copies binary dependencies (such as .wasm files) from package directories directly into the build output folder during compilation.

Unified Client-Side Script Context #

We have refined the JSDoc comments and TypeScript definitions to clearly differentiate between server-side setup functions and client-side script execution within Coralite modules. In addition, the signature of the client-side script callback has been updated to accept a unified context object instead of separate values and refs parameters. This context includes a helpers property to expose plugin helper methods within scripts.

javascript
Code copied!
  import { defineComponent } from 'coralite';
  
  export default defineComponent({
    setup(props) {
      // Runs on the server during rendering
      return { userId: props.id };
    },
    script(context) {
      // Runs on the client
      const { values, refs, helpers } = context;
      console.log('Client-side script initialized with values:', values);
    }
  });

Internal Options for Coralite Save Method #

The Coralite.prototype.save method has been refactored to read configuration options internally. The builder now checks this.options.output and throws an error if it is missing. This eliminates the need to pass arguments directly to the save function, simplifying CLI usage and test scripts.

javascript
Code copied!
  import Coralite from 'coralite';
  
  const coralite = new Coralite({
    output: './dist'
  });
  
  // No arguments required; output path is read from initialization options
  await coralite.save();

Refs Plugin Output and Testing Patterns #

To improve browser delivery, the Refs plugin now removes ref attributes from the final DOM output during SSR builds in favor of auto-generated IDs. If you are targeting these components in end-to-end testing suites like Playwright or Cypress, avoid using [ref="name"] selectors. Instead, target elements using the structured ID pattern:

text
Code copied!
  <component-id>__<ref-name>-<instance-index>
      </instance-index></ref-name></component-id>

Breaking Changes #

How to Upgrade #

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

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

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!