svelte-realtime 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vite.js +4 -3
package/package.json
CHANGED
package/vite.js
CHANGED
|
@@ -552,13 +552,14 @@ function _generateSsrStubs(filePath, modulePath) {
|
|
|
552
552
|
|
|
553
553
|
for (const name of storeNames) {
|
|
554
554
|
if (dynamicNames.has(name)) {
|
|
555
|
-
// Dynamic stream:
|
|
556
|
-
lines.push(`const _${name} = (...args) => readable(undefined);`);
|
|
555
|
+
// Dynamic stream: factory returns a readable with .hydrate() for SSR rendering
|
|
556
|
+
lines.push(`const _${name} = (...args) => { const s = readable(undefined); s.hydrate = (d) => readable(d); return s; };`);
|
|
557
557
|
lines.push(`_${name}.load = (platform, options) => __directCall(${safeModulePath(name)}, options?.args || [], platform, options);`);
|
|
558
558
|
lines.push(`export { _${name} as ${name} };`);
|
|
559
559
|
} else {
|
|
560
|
-
// Static stream:
|
|
560
|
+
// Static stream: readable with .hydrate() for SSR rendering
|
|
561
561
|
lines.push(`const _${name} = readable(undefined);`);
|
|
562
|
+
lines.push(`_${name}.hydrate = (d) => readable(d);`);
|
|
562
563
|
lines.push(`_${name}.load = (platform, options) => __directCall(${safeModulePath(name)}, options?.args || [], platform, options);`);
|
|
563
564
|
lines.push(`export { _${name} as ${name} };`);
|
|
564
565
|
}
|