Coralite v0.38.2 Released

Coralite v0.38.2 addresses key synchronization issues between server-side rendering (SSR) and the client bundle. This patch release ensures that data returned from the server() function reliably propagates to client state, client getters, and imperative APIs during hydration.

Reliable server() State and Getters Propagation #

In previous versions, data returned by the server-side server() hook occasionally failed to reflect correctly in the initial client state or computed getters during hydration. This release fixes those synchronization gaps with several targeted enhancements:

Here is an example demonstrating how server-evaluated results now correctly overwrite client state default values during initialization:

javascript
Code copied!
  // Server-side logic
  export async function server(context) {
    return {
      theme: 'dark',
      authenticated: true
    };
  }
  
  // Client-side component state definition
  export const state = {
    theme: 'light',       // Overwritten by 'dark' during hydration
    authenticated: false  // Overwritten by true during hydration
  };

How to Upgrade #

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

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