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:
tmp/service/SsrService.mjs:
- The
hash object (containing the hashString and windowId) is now included in the ssrData payload sent to the client.
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.
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.
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.
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:
tmp/service/SsrService.mjs:hashobject (containing thehashStringandwindowId) is now included in thessrDatapayload sent to the client.src/worker/Manager.mjs:createWorkers()method is updated to check forssrData.hashand inject it into the initial configuration for all workers. This ensures the client-side router starts with the correct route information from the server.src/controller/Application.mjs:beforeSetMainView()is modified to setautoInitVnode: falseandautoMount: falseon themainViewin an SSR context, preventing an unnecessary initial render.afterSetMainView()is modified to perform the "takeover". In an SSR context, it assigns the server-providedvnodeto themainViewand sets itsmountedstate totrueafter the router has processed the initial route.src/mixin/VdomLifecycle.mjs:autoInitVnodeconfig is updated to clarify its intended use:truefor components like dialogs and drag-proxies, andfalsefor 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.