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:
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.
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.
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.
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:
src/worker/Manager.mjs:createWorkers()method has been enhanced to support the SSR takeover process. It now checks for awindow.__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.windowIdconfig is now initialized directly with the SSR value if it exists.src/main/addon/ServerSideRendering.mjs:<script>tag containing the__NEO_SSR__data from the DOM after it has been consumed.src/Main.mjs:onDomContentLoadedmethod has been updated to conditionally import and register theServerSideRenderingaddon when thewindow.__NEO_SSR__flag is detected.These changes establish the client-side foundation for the new SSR and Static Site Generation (SSG) strategy.