To support the SSR "takeover" process, the App worker needs to be aware of the CSS files that were already included in the server-rendered HTML. This prevents the client from redundantly re-requesting the same theme files.
Change:
src/worker/App.mjs -> createThemeMap():
- This method is enhanced to check for
Neo.config.cssMap after the main theme-map.json is loaded.
- If
Neo.config.cssMap exists (meaning it was passed from the SSR process), its contents are merged into the global Neo.cssMap. This ensures that when insertThemeFiles() is called, it correctly recognizes which CSS has already been handled by the server.
- The
Neo.config.cssMap is deleted after the merge to prevent re-processing.
This change ensures efficient and correct CSS management during the SSR takeover process.
To support the SSR "takeover" process, the App worker needs to be aware of the CSS files that were already included in the server-rendered HTML. This prevents the client from redundantly re-requesting the same theme files.
Change:
src/worker/App.mjs->createThemeMap():Neo.config.cssMapafter the maintheme-map.jsonis loaded.Neo.config.cssMapexists (meaning it was passed from the SSR process), its contents are merged into the globalNeo.cssMap. This ensures that wheninsertThemeFiles()is called, it correctly recognizes which CSS has already been handled by the server.Neo.config.cssMapis deleted after the merge to prevent re-processing.This change ensures efficient and correct CSS management during the SSR takeover process.