Coralite v0.31.4 Released

Coralite v0.31.4 is now available, introducing key fixes to dynamic imperative references, script packaging, slot computation, and code generation utilities. This release resolves several critical issues affecting dynamically instantiated components and ensures reliable client-side script bundling.

Robust Dynamic Imperative References #

This release updates ScriptManager.registerComponent to properly merge configuration variables—such as defaultValues, styles, slots, imports, and nested components—into existing registered component instances rather than overwriting them. Additionally, we patched the client-side wrapper in coralite.js to map and fallback dynamic ref_ tokens using a unique imperative UUID (this._index). This ensures references resolve correctly even when child components are dynamically instantiated in the DOM.

javascript
Code copied!
  // Dynamic references map to values via their unique imperative index
  const el = document.createElement('my-dynamic-component');
  // The component is initialized with correct config merging and dynamic ref fallback

Script Registration and Packaging Fixes #

Client-side script generation has been corrected to register scripts under renderContext.pagePath rather than the individual component's file path. This adjustment ensures that page generation functions reliably find and bundle all necessary assets. We also resolved a recursive parameter shadowing issue in createComponentElement and normalized shorthand ES6 methods into standard function strings during serialization to prevent invalid JS declarations in the final build output.

Slot Resolution and Validation Improvements #

To improve layout rendering and parsing stability, we addressed light DOM slot nodes being incorrectly overwritten by appending them instead. We also introduced a parent wrapper component for computed-slots-imperative to statically declare dynamic injection contexts and prevent test timeouts. Lastly, the parser now uses original tag names for validation and error messages instead of sanitized names, providing clearer error feedback.

How to Upgrade #

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

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

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!