Coralite v0.43.1 Released

Coralite v0.43.1 is now available. This patch release resolves issues with server-side code generation and imperatively created DOM components. Specifically, it ensures correct runtime attribute prefixing during partial parameter destructuring, guarantees instance ID assignment for dynamically created elements, and introduces enhanced environment-specific verification tests.

Client Parameter Destructuring Injection Fix #

When client methods use partial object destructuring, code generation on the server previously omitted the internal instanceId. This omission caused DOM attribute prefixing to fail at runtime. Coralite v0.43.1 solves this by updating the compilation process to explicitly inject instanceId: _coralite_instanceId into the parameter list if it is not present in the destructuring pattern.

javascript
Code copied!
  // Compiled client method signature now guarantees instanceId injection:
  function clientMethod({ someProp, otherProp, instanceId: _coralite_instanceId }) {
    // Correct prefixing is preserved for runtime DOM modifications
  }

Instance ID Assignment for Imperative Elements #

Components instantiated dynamically using native web APIs like document.createElement did not always receive a deterministic instance ID. This resulted in unprefixed data-testid attributes at runtime. This release assigns a deterministic _instanceId to CoraliteElement instances at runtime to ensure scoping and attribute prefix rules are respected for dynamically created elements.

javascript
Code copied!
  // Dynamically created elements now behave consistently:
  const btn = document.createElement('coralite-button');
  btn.setAttribute('data-testid', 'submit-action');
  // data-testid is now correctly prefixed in the DOM

Environment-Specific Attribute Testing #

To avoid regressions in build output, the E2E test suite has been updated to explicitly test how data-testid attributes behave across different environments. This ensures that test IDs are correctly stripped from production builds for optimization, while remaining intact and properly prefixed in development environments. The validation spans boolean attributes, imperatively created elements, and innerHTML rendering pipelines.

How to Upgrade #

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

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

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!