LearnNewsExamplesServices
Frontmatter
id7784
titleImplement Client-Side SSR Takeover Logic
stateClosed
labels
enhancementai
assigneestobiu
createdAtNov 17, 2025, 8:54 PM
updatedAtNov 17, 2025, 9:21 PM
githubUrlhttps://github.com/neomjs/neo/issues/7784
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 17, 2025, 9:21 PM

Implement Client-Side SSR Takeover Logic

Closed v11.5.0 enhancementai
tobiu
tobiu commented on Nov 17, 2025, 8:54 PM

This ticket covers the implementation of the client-side logic required for the framework to "take over" a server-rendered page. This process does not involve re-hydrating or modifying the initial DOM.

Changes:

  1. src/worker/Manager.mjs:

    • The createWorkers() method has been enhanced to support the SSR takeover process. It now checks for a window.__NEO_SSR__ object on startup and, if present, injects the SSR data (windowId, vnode, cssMap, idCounters) into the initial configuration messages sent to the appropriate workers. This allows the client-side workers to adopt the server-rendered state seamlessly.
    • The windowId config is now initialized directly with the SSR value if it exists.
  2. src/main/addon/ServerSideRendering.mjs:

    • A new addon has been created to handle client-side logic specific to SSR.
    • Its initial responsibility is to remove the <script> tag containing the __NEO_SSR__ data from the DOM after it has been consumed.
  3. src/Main.mjs:

    • The onDomContentLoaded method has been updated to conditionally import and register the ServerSideRendering addon when the window.__NEO_SSR__ flag is detected.

These changes establish the client-side foundation for the new SSR and Static Site Generation (SSG) strategy.

tobiu added the enhancement label on Nov 17, 2025, 8:54 PM
tobiu added the ai label on Nov 17, 2025, 8:54 PM
tobiu assigned to @tobiu on Nov 17, 2025, 8:55 PM
tobiu referenced in commit 03418d6 - "Implement Client-Side SSR Takeover Logic #7784" on Nov 17, 2025, 8:56 PM
tobiu closed this issue on Nov 17, 2025, 9:21 PM