LearnNewsExamplesServices
Frontmatter
id7787
titleImplement Client-Side SSR Takeover Logic and VdomLifecycle Clarifications
stateClosed
labels
enhancementai
assignees[]
createdAtNov 18, 2025, 12:14 AM
updatedAtNov 18, 2025, 12:34 AM
githubUrlhttps://github.com/neomjs/neo/issues/7787
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 18, 2025, 12:34 AM

Implement Client-Side SSR Takeover Logic and VdomLifecycle Clarifications

Closed v11.5.0 enhancementai
tobiu
tobiu commented on Nov 18, 2025, 12:14 AM

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

Changes:

  1. tmp/service/SsrService.mjs:

    • The hash object (containing the hashString and windowId) is now included in the ssrData payload sent to the client.
  2. src/worker/Manager.mjs:

    • The createWorkers() method is updated to check for ssrData.hash and inject it into the initial configuration for all workers. This ensures the client-side router starts with the correct route information from the server.
  3. src/controller/Application.mjs:

    • beforeSetMainView() is modified to set autoInitVnode: false and autoMount: false on the mainView in an SSR context, preventing an unnecessary initial render.
    • afterSetMainView() is modified to perform the "takeover". In an SSR context, it assigns the server-provided vnode to the mainView and sets its mounted state to true after the router has processed the initial route.
  4. src/mixin/VdomLifecycle.mjs:

    • The JSDoc comment for the autoInitVnode config is updated to clarify its intended use: true for components like dialogs and drag-proxies, and false for top-level views (especially in SSR scenarios).

These changes work together to enable a seamless and efficient takeover of the server-rendered application state by the client, and improve clarity for framework users.

tobiu added the enhancement label on Nov 18, 2025, 12:14 AM
tobiu added the ai label on Nov 18, 2025, 12:14 AM
tobiu referenced in commit 55fe150 - "Implement Client-Side SSR Takeover Logic and VdomLifecycle Clarifications #7787" on Nov 18, 2025, 12:34 AM
tobiu closed this issue on Nov 18, 2025, 12:34 AM