@cedarjs/router 4.0.0-canary.13803 → 4.0.0-rc.129
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/dist/cjs/rsc/RscCache.d.ts.map +1 -1
- package/dist/cjs/rsc/RscCache.js +1 -11
- package/dist/cjs/rsc/clientSsr.d.ts +0 -7
- package/dist/cjs/rsc/clientSsr.d.ts.map +1 -1
- package/dist/cjs/rsc/clientSsr.js +4 -52
- package/dist/cjs/rsc/utils.d.ts +3 -3
- package/dist/cjs/rsc/utils.d.ts.map +1 -1
- package/dist/cjs/rsc/utils.js +5 -20
- package/dist/rsc/RscCache.d.ts.map +1 -1
- package/dist/rsc/RscCache.js +1 -11
- package/dist/rsc/clientSsr.d.ts +0 -7
- package/dist/rsc/clientSsr.d.ts.map +1 -1
- package/dist/rsc/clientSsr.js +5 -53
- package/dist/rsc/utils.d.ts +3 -3
- package/dist/rsc/utils.d.ts.map +1 -1
- package/dist/rsc/utils.js +5 -20
- package/package.json +9 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RscCache.d.ts","sourceRoot":"","sources":["../../../src/rsc/RscCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RscCache.d.ts","sourceRoot":"","sources":["../../../src/rsc/RscCache.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,iBAAiB,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED;;;;;;GAMG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,KAAK,CAAwC;IACrD,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,WAAW,CAAI;IAEvB,OAAO,CAAC,SAAS,CAAQ;;IAgDzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS;IAMhD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC;IA2B1C,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,qBAAqB;CAW9B"}
|
package/dist/cjs/rsc/RscCache.js
CHANGED
|
@@ -21,16 +21,6 @@ __export(RscCache_exports, {
|
|
|
21
21
|
RscCache: () => RscCache
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(RscCache_exports);
|
|
24
|
-
class DummyWS {
|
|
25
|
-
readyState = WebSocket?.OPEN;
|
|
26
|
-
addEventListener() {
|
|
27
|
-
}
|
|
28
|
-
send() {
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (typeof globalThis.WebSocket === "undefined") {
|
|
32
|
-
globalThis.WebSocket = DummyWS;
|
|
33
|
-
}
|
|
34
24
|
class RscCache {
|
|
35
25
|
cache = /* @__PURE__ */ new Map();
|
|
36
26
|
socket;
|
|
@@ -99,7 +89,7 @@ class RscCache {
|
|
|
99
89
|
} else if (this.sendRetries >= 10) {
|
|
100
90
|
console.error("Exhausted retries to send message to WebSocket server.");
|
|
101
91
|
} else {
|
|
102
|
-
console.error("
|
|
92
|
+
console.error("WebSocket connection is closed.");
|
|
103
93
|
}
|
|
104
94
|
}
|
|
105
95
|
sendUpdateToWebSocket() {
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Render the RW App's Routes.{tsx,jsx} component.
|
|
3
|
-
* In production, this function will read the Routes component from the App's
|
|
4
|
-
* dist directory.
|
|
5
|
-
* During dev, this function will use Vite to load the Routes component from
|
|
6
|
-
* the App's src directory.
|
|
7
|
-
*/
|
|
8
1
|
export declare function renderRoutesSsr(pathname: string): Promise<any>;
|
|
9
2
|
//# sourceMappingURL=clientSsr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientSsr.d.ts","sourceRoot":"","sources":["../../../src/rsc/clientSsr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clientSsr.d.ts","sourceRoot":"","sources":["../../../src/rsc/clientSsr.ts"],"names":[],"mappings":"AAuEA,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,gBA2DrD"}
|
|
@@ -32,31 +32,16 @@ __export(clientSsr_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(clientSsr_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
|
-
var import_node_url = require("node:url");
|
|
36
35
|
var import_project_config = require("@cedarjs/project-config");
|
|
37
36
|
var import_ssrModuleMap = require("./ssrModuleMap.js");
|
|
38
37
|
var import_utils = require("./utils.js");
|
|
39
38
|
var import_utils2 = require("./utils.js");
|
|
40
39
|
async function getEntries() {
|
|
41
|
-
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
42
|
-
return {
|
|
43
|
-
serverEntries: {
|
|
44
|
-
__cedarjs__Routes: "../../src/Routes.tsx"
|
|
45
|
-
},
|
|
46
|
-
ssrEntries: {}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
40
|
const entriesPath = (0, import_project_config.getPaths)().web.distRscEntries;
|
|
50
41
|
const entries = await import((0, import_utils2.makeFilePath)(entriesPath));
|
|
51
42
|
return entries;
|
|
52
43
|
}
|
|
53
44
|
async function getRoutesComponent() {
|
|
54
|
-
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
55
|
-
const routesMod = await globalThis.__cedarjs__vite_rsc_runtime.import(
|
|
56
|
-
(0, import_project_config.getPaths)().web.routes
|
|
57
|
-
);
|
|
58
|
-
return routesMod.default;
|
|
59
|
-
}
|
|
60
45
|
const { serverEntries } = await getEntries();
|
|
61
46
|
const entryPath = import_node_path.default.join(
|
|
62
47
|
(0, import_project_config.getPaths)().web.distRsc,
|
|
@@ -106,52 +91,19 @@ async function renderRoutesSsr(pathname) {
|
|
|
106
91
|
get(_target, encodedId) {
|
|
107
92
|
console.log("Proxy get encodedId", encodedId);
|
|
108
93
|
const [filePath, name] = encodedId.split("#");
|
|
109
|
-
const id =
|
|
94
|
+
const id = resolveClientEntryForProd(filePath, clientEntries);
|
|
110
95
|
console.log("clientSsr.ts::Proxy id", id);
|
|
111
96
|
return { id, chunks: [id], name, async: true };
|
|
112
97
|
}
|
|
113
98
|
}
|
|
114
99
|
);
|
|
115
|
-
const serverModuleMap = new Proxy(
|
|
116
|
-
{},
|
|
117
|
-
{
|
|
118
|
-
get(_target, encodedId) {
|
|
119
|
-
console.log("serverModuleMap Proxy get encodedId", encodedId);
|
|
120
|
-
const [filePath, name] = encodedId.split("#");
|
|
121
|
-
const id = (0, import_node_url.pathToFileURL)(filePath).href;
|
|
122
|
-
console.log("serverModuleMap::Proxy id", id);
|
|
123
|
-
return { id, chunks: [id], name, async: true };
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
100
|
const { createElement } = await (0, import_utils.importReact)();
|
|
128
101
|
const { renderToReadableStream } = await (0, import_utils.importRsdwServer)();
|
|
129
102
|
console.log("clientSsr.ts right before renderToReadableStream");
|
|
130
|
-
const
|
|
131
|
-
createElement(Routes),
|
|
132
|
-
bundlerConfig
|
|
133
|
-
);
|
|
134
|
-
const [streamForLogging, streamForRendering] = originalStream.tee();
|
|
135
|
-
(async () => {
|
|
136
|
-
const reader = streamForLogging.getReader();
|
|
137
|
-
const decoder = new TextDecoder();
|
|
138
|
-
let logContent = "";
|
|
139
|
-
while (true) {
|
|
140
|
-
const { done, value } = await reader.read();
|
|
141
|
-
if (done) {
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
logContent += decoder.decode(value, { stream: true });
|
|
145
|
-
}
|
|
146
|
-
console.log("Stream content:", logContent);
|
|
147
|
-
})();
|
|
103
|
+
const stream = renderToReadableStream(createElement(Routes), bundlerConfig);
|
|
148
104
|
const { createFromReadableStream } = await (0, import_utils.importRsdwClient)();
|
|
149
|
-
const data = createFromReadableStream(
|
|
150
|
-
|
|
151
|
-
moduleMap: import_ssrModuleMap.moduleMap,
|
|
152
|
-
serverModuleMap,
|
|
153
|
-
moduleLoading: null
|
|
154
|
-
}
|
|
105
|
+
const data = createFromReadableStream(stream, {
|
|
106
|
+
ssrManifest: { moduleMap: import_ssrModuleMap.moduleMap, moduleLoading: null }
|
|
155
107
|
});
|
|
156
108
|
rscCache.set(pathname, data);
|
|
157
109
|
return data;
|
package/dist/cjs/rsc/utils.d.ts
CHANGED
|
@@ -6,15 +6,15 @@ export declare function makeFilePath(path: string): string;
|
|
|
6
6
|
/**
|
|
7
7
|
* See vite/streamHelpers.ts.
|
|
8
8
|
*
|
|
9
|
-
* This function ensures we load the
|
|
9
|
+
* This function ensures we load the same version of rsdw_client to prevent
|
|
10
10
|
* multiple instances of React
|
|
11
11
|
*/
|
|
12
12
|
export declare function importReact(): Promise<any>;
|
|
13
13
|
/**
|
|
14
14
|
* See vite/streamHelpers.ts.
|
|
15
15
|
*
|
|
16
|
-
* This function ensures we load the same version of rsdw_client
|
|
17
|
-
*
|
|
16
|
+
* This function ensures we load the same version of rsdw_client to prevent
|
|
17
|
+
* multiple instances of React
|
|
18
18
|
*/
|
|
19
19
|
export declare function importRsdwClient(): Promise<RSDWClientType>;
|
|
20
20
|
export declare function importRsdwServer(): Promise<RSDWServerType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/rsc/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvF,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAIvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAC7C,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAExC;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/rsc/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvF,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAIvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAC7C,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAExC;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,iBAKhC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,CAOhE;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,CAWhE"}
|
package/dist/cjs/rsc/utils.js
CHANGED
|
@@ -41,19 +41,11 @@ function makeFilePath(path2) {
|
|
|
41
41
|
return (0, import_node_url.pathToFileURL)(path2).href;
|
|
42
42
|
}
|
|
43
43
|
async function importReact() {
|
|
44
|
-
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
45
|
-
const reactMod = await import("react");
|
|
46
|
-
return reactMod.default;
|
|
47
|
-
}
|
|
48
44
|
const distSsr = (0, import_project_config.getPaths)().web.distSsr;
|
|
49
45
|
const reactPath = makeFilePath(import_node_path.default.join(distSsr, "__cedarjs__react.mjs"));
|
|
50
46
|
return (await import(reactPath)).default;
|
|
51
47
|
}
|
|
52
48
|
async function importRsdwClient() {
|
|
53
|
-
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
54
|
-
const rsdwcMod = await import("react-server-dom-webpack/client.edge");
|
|
55
|
-
return rsdwcMod.default;
|
|
56
|
-
}
|
|
57
49
|
const distSsr = (0, import_project_config.getPaths)().web.distSsr;
|
|
58
50
|
const rsdwClientPath = makeFilePath(
|
|
59
51
|
import_node_path.default.join(distSsr, "__cedarjs__rsdw-client.mjs")
|
|
@@ -61,18 +53,11 @@ async function importRsdwClient() {
|
|
|
61
53
|
return (await import(rsdwClientPath)).default;
|
|
62
54
|
}
|
|
63
55
|
async function importRsdwServer() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} else {
|
|
70
|
-
const dynamicImport = "";
|
|
71
|
-
return import(
|
|
72
|
-
/* @vite-ignore */
|
|
73
|
-
dynamicImport + "react-server-dom-webpack/server.edge"
|
|
74
|
-
);
|
|
75
|
-
}
|
|
56
|
+
const dynamicImport = "";
|
|
57
|
+
return import(
|
|
58
|
+
/* @vite-ignore */
|
|
59
|
+
dynamicImport + "react-server-dom-webpack/server.edge"
|
|
60
|
+
);
|
|
76
61
|
}
|
|
77
62
|
// Annotate the CommonJS export names for ESM import in node:
|
|
78
63
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RscCache.d.ts","sourceRoot":"","sources":["../../src/rsc/RscCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RscCache.d.ts","sourceRoot":"","sources":["../../src/rsc/RscCache.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,iBAAiB,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED;;;;;;GAMG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,KAAK,CAAwC;IACrD,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,WAAW,CAAI;IAEvB,OAAO,CAAC,SAAS,CAAQ;;IAgDzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS;IAMhD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC;IA2B1C,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,qBAAqB;CAW9B"}
|
package/dist/rsc/RscCache.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
class DummyWS {
|
|
2
|
-
readyState = WebSocket?.OPEN;
|
|
3
|
-
addEventListener() {
|
|
4
|
-
}
|
|
5
|
-
send() {
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
if (typeof globalThis.WebSocket === "undefined") {
|
|
9
|
-
globalThis.WebSocket = DummyWS;
|
|
10
|
-
}
|
|
11
1
|
class RscCache {
|
|
12
2
|
cache = /* @__PURE__ */ new Map();
|
|
13
3
|
socket;
|
|
@@ -76,7 +66,7 @@ class RscCache {
|
|
|
76
66
|
} else if (this.sendRetries >= 10) {
|
|
77
67
|
console.error("Exhausted retries to send message to WebSocket server.");
|
|
78
68
|
} else {
|
|
79
|
-
console.error("
|
|
69
|
+
console.error("WebSocket connection is closed.");
|
|
80
70
|
}
|
|
81
71
|
}
|
|
82
72
|
sendUpdateToWebSocket() {
|
package/dist/rsc/clientSsr.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Render the RW App's Routes.{tsx,jsx} component.
|
|
3
|
-
* In production, this function will read the Routes component from the App's
|
|
4
|
-
* dist directory.
|
|
5
|
-
* During dev, this function will use Vite to load the Routes component from
|
|
6
|
-
* the App's src directory.
|
|
7
|
-
*/
|
|
8
1
|
export declare function renderRoutesSsr(pathname: string): Promise<any>;
|
|
9
2
|
//# sourceMappingURL=clientSsr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientSsr.d.ts","sourceRoot":"","sources":["../../src/rsc/clientSsr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clientSsr.d.ts","sourceRoot":"","sources":["../../src/rsc/clientSsr.ts"],"names":[],"mappings":"AAuEA,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,gBA2DrD"}
|
package/dist/rsc/clientSsr.js
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
3
2
|
import { getPaths } from "@cedarjs/project-config";
|
|
4
3
|
import { moduleMap } from "./ssrModuleMap.js";
|
|
5
|
-
import { importRsdwClient,
|
|
4
|
+
import { importRsdwClient, importRsdwServer, importReact } from "./utils.js";
|
|
6
5
|
import { makeFilePath } from "./utils.js";
|
|
7
6
|
async function getEntries() {
|
|
8
|
-
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
9
|
-
return {
|
|
10
|
-
serverEntries: {
|
|
11
|
-
__cedarjs__Routes: "../../src/Routes.tsx"
|
|
12
|
-
},
|
|
13
|
-
ssrEntries: {}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
7
|
const entriesPath = getPaths().web.distRscEntries;
|
|
17
8
|
const entries = await import(makeFilePath(entriesPath));
|
|
18
9
|
return entries;
|
|
19
10
|
}
|
|
20
11
|
async function getRoutesComponent() {
|
|
21
|
-
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
22
|
-
const routesMod = await globalThis.__cedarjs__vite_rsc_runtime.import(
|
|
23
|
-
getPaths().web.routes
|
|
24
|
-
);
|
|
25
|
-
return routesMod.default;
|
|
26
|
-
}
|
|
27
12
|
const { serverEntries } = await getEntries();
|
|
28
13
|
const entryPath = path.join(
|
|
29
14
|
getPaths().web.distRsc,
|
|
@@ -73,52 +58,19 @@ async function renderRoutesSsr(pathname) {
|
|
|
73
58
|
get(_target, encodedId) {
|
|
74
59
|
console.log("Proxy get encodedId", encodedId);
|
|
75
60
|
const [filePath, name] = encodedId.split("#");
|
|
76
|
-
const id =
|
|
61
|
+
const id = resolveClientEntryForProd(filePath, clientEntries);
|
|
77
62
|
console.log("clientSsr.ts::Proxy id", id);
|
|
78
63
|
return { id, chunks: [id], name, async: true };
|
|
79
64
|
}
|
|
80
65
|
}
|
|
81
66
|
);
|
|
82
|
-
const serverModuleMap = new Proxy(
|
|
83
|
-
{},
|
|
84
|
-
{
|
|
85
|
-
get(_target, encodedId) {
|
|
86
|
-
console.log("serverModuleMap Proxy get encodedId", encodedId);
|
|
87
|
-
const [filePath, name] = encodedId.split("#");
|
|
88
|
-
const id = pathToFileURL(filePath).href;
|
|
89
|
-
console.log("serverModuleMap::Proxy id", id);
|
|
90
|
-
return { id, chunks: [id], name, async: true };
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
67
|
const { createElement } = await importReact();
|
|
95
68
|
const { renderToReadableStream } = await importRsdwServer();
|
|
96
69
|
console.log("clientSsr.ts right before renderToReadableStream");
|
|
97
|
-
const
|
|
98
|
-
createElement(Routes),
|
|
99
|
-
bundlerConfig
|
|
100
|
-
);
|
|
101
|
-
const [streamForLogging, streamForRendering] = originalStream.tee();
|
|
102
|
-
(async () => {
|
|
103
|
-
const reader = streamForLogging.getReader();
|
|
104
|
-
const decoder = new TextDecoder();
|
|
105
|
-
let logContent = "";
|
|
106
|
-
while (true) {
|
|
107
|
-
const { done, value } = await reader.read();
|
|
108
|
-
if (done) {
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
logContent += decoder.decode(value, { stream: true });
|
|
112
|
-
}
|
|
113
|
-
console.log("Stream content:", logContent);
|
|
114
|
-
})();
|
|
70
|
+
const stream = renderToReadableStream(createElement(Routes), bundlerConfig);
|
|
115
71
|
const { createFromReadableStream } = await importRsdwClient();
|
|
116
|
-
const data = createFromReadableStream(
|
|
117
|
-
|
|
118
|
-
moduleMap,
|
|
119
|
-
serverModuleMap,
|
|
120
|
-
moduleLoading: null
|
|
121
|
-
}
|
|
72
|
+
const data = createFromReadableStream(stream, {
|
|
73
|
+
ssrManifest: { moduleMap, moduleLoading: null }
|
|
122
74
|
});
|
|
123
75
|
rscCache.set(pathname, data);
|
|
124
76
|
return data;
|
package/dist/rsc/utils.d.ts
CHANGED
|
@@ -6,15 +6,15 @@ export declare function makeFilePath(path: string): string;
|
|
|
6
6
|
/**
|
|
7
7
|
* See vite/streamHelpers.ts.
|
|
8
8
|
*
|
|
9
|
-
* This function ensures we load the
|
|
9
|
+
* This function ensures we load the same version of rsdw_client to prevent
|
|
10
10
|
* multiple instances of React
|
|
11
11
|
*/
|
|
12
12
|
export declare function importReact(): Promise<any>;
|
|
13
13
|
/**
|
|
14
14
|
* See vite/streamHelpers.ts.
|
|
15
15
|
*
|
|
16
|
-
* This function ensures we load the same version of rsdw_client
|
|
17
|
-
*
|
|
16
|
+
* This function ensures we load the same version of rsdw_client to prevent
|
|
17
|
+
* multiple instances of React
|
|
18
18
|
*/
|
|
19
19
|
export declare function importRsdwClient(): Promise<RSDWClientType>;
|
|
20
20
|
export declare function importRsdwServer(): Promise<RSDWServerType>;
|
package/dist/rsc/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/rsc/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvF,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAIvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAC7C,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAExC;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/rsc/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvF,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAIvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAC7C,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAExC;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,iBAKhC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,CAOhE;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,CAWhE"}
|
package/dist/rsc/utils.js
CHANGED
|
@@ -5,19 +5,11 @@ function makeFilePath(path2) {
|
|
|
5
5
|
return pathToFileURL(path2).href;
|
|
6
6
|
}
|
|
7
7
|
async function importReact() {
|
|
8
|
-
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
9
|
-
const reactMod = await import("react");
|
|
10
|
-
return reactMod.default;
|
|
11
|
-
}
|
|
12
8
|
const distSsr = getPaths().web.distSsr;
|
|
13
9
|
const reactPath = makeFilePath(path.join(distSsr, "__cedarjs__react.mjs"));
|
|
14
10
|
return (await import(reactPath)).default;
|
|
15
11
|
}
|
|
16
12
|
async function importRsdwClient() {
|
|
17
|
-
if (globalThis.__cedarjs__vite_ssr_runtime) {
|
|
18
|
-
const rsdwcMod = await import("react-server-dom-webpack/client.edge");
|
|
19
|
-
return rsdwcMod.default;
|
|
20
|
-
}
|
|
21
13
|
const distSsr = getPaths().web.distSsr;
|
|
22
14
|
const rsdwClientPath = makeFilePath(
|
|
23
15
|
path.join(distSsr, "__cedarjs__rsdw-client.mjs")
|
|
@@ -25,18 +17,11 @@ async function importRsdwClient() {
|
|
|
25
17
|
return (await import(rsdwClientPath)).default;
|
|
26
18
|
}
|
|
27
19
|
async function importRsdwServer() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} else {
|
|
34
|
-
const dynamicImport = "";
|
|
35
|
-
return import(
|
|
36
|
-
/* @vite-ignore */
|
|
37
|
-
dynamicImport + "react-server-dom-webpack/server.edge"
|
|
38
|
-
);
|
|
39
|
-
}
|
|
20
|
+
const dynamicImport = "";
|
|
21
|
+
return import(
|
|
22
|
+
/* @vite-ignore */
|
|
23
|
+
dynamicImport + "react-server-dom-webpack/server.edge"
|
|
24
|
+
);
|
|
40
25
|
}
|
|
41
26
|
export {
|
|
42
27
|
importReact,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/router",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.129",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -94,17 +94,16 @@
|
|
|
94
94
|
"test:watch": "vitest watch"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@cedarjs/auth": "4.0.0-
|
|
98
|
-
"@cedarjs/server-store": "4.0.0-
|
|
99
|
-
"react": "
|
|
100
|
-
"react-dom": "
|
|
101
|
-
"react-server-dom-webpack": "19.2.4"
|
|
97
|
+
"@cedarjs/auth": "4.0.0-rc.129",
|
|
98
|
+
"@cedarjs/server-store": "4.0.0-rc.129",
|
|
99
|
+
"react": "18.3.1",
|
|
100
|
+
"react-dom": "18.3.1"
|
|
102
101
|
},
|
|
103
102
|
"devDependencies": {
|
|
104
103
|
"@arethetypeswrong/cli": "0.18.2",
|
|
105
104
|
"@babel/cli": "7.28.6",
|
|
106
105
|
"@babel/core": "^7.26.10",
|
|
107
|
-
"@cedarjs/framework-tools": "4.0.0-
|
|
106
|
+
"@cedarjs/framework-tools": "4.0.0-rc.129",
|
|
108
107
|
"@testing-library/jest-dom": "6.9.1",
|
|
109
108
|
"@types/react": "^18.2.55",
|
|
110
109
|
"@types/react-dom": "^18.2.19",
|
|
@@ -116,8 +115,8 @@
|
|
|
116
115
|
"vitest": "3.2.4"
|
|
117
116
|
},
|
|
118
117
|
"peerDependencies": {
|
|
119
|
-
"react": "
|
|
120
|
-
"react-dom": "
|
|
118
|
+
"react": "18.3.1",
|
|
119
|
+
"react-dom": "18.3.1"
|
|
121
120
|
},
|
|
122
121
|
"engines": {
|
|
123
122
|
"node": ">=24"
|
|
@@ -125,5 +124,5 @@
|
|
|
125
124
|
"publishConfig": {
|
|
126
125
|
"access": "public"
|
|
127
126
|
},
|
|
128
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "1c22a801dc9ffcbf09512278c8048160d9338c0a"
|
|
129
128
|
}
|