@expo/router-server 55.0.15 → 55.0.17
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/build/rsc/middleware.d.ts.map +1 -1
- package/build/rsc/middleware.js +4 -14
- package/build/rsc/middleware.js.map +1 -1
- package/build/rsc/rsc-renderer.d.ts +2 -0
- package/build/rsc/rsc-renderer.d.ts.map +1 -1
- package/build/rsc/rsc-renderer.js +37 -7
- package/build/rsc/rsc-renderer.js.map +1 -1
- package/build/rsc/server.d.ts.map +1 -1
- package/build/rsc/server.js +7 -34
- package/build/rsc/server.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/rsc/middleware.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/rsc/middleware.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAmDzD,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,OAAO,CAAC,cAAc,6BAA6B,CAAC,CAAC,CAAC;CACrE,CAAC;AAEF,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,SAAS,EAClB,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,aAAa,GAC3F,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAiE9B;AAED,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAY9B"}
|
package/build/rsc/middleware.js
CHANGED
|
@@ -18,22 +18,11 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
18
18
|
const rsc_renderer_1 = require("./rsc-renderer");
|
|
19
19
|
const debug_1 = require("../utils/debug");
|
|
20
20
|
const debug = (0, debug_1.createDebug)('expo:router:server:rsc-renderer');
|
|
21
|
-
// Tracking the implementation in expo/cli's MetroBundlerDevServer
|
|
22
|
-
const rscRenderContext = new Map();
|
|
23
21
|
function serverRequire(...targetOutputModulePath) {
|
|
24
22
|
// NOTE(@kitten): This `__dirname` will be located in the output file system, e.g. `dist/server/*`
|
|
25
23
|
const filePath = node_path_1.default.join(__dirname, ...targetOutputModulePath);
|
|
26
24
|
return $$require_external(filePath);
|
|
27
25
|
}
|
|
28
|
-
function getRscRenderContext(platform) {
|
|
29
|
-
// NOTE(EvanBacon): We memoize this now that there's a persistent server storage cache for Server Actions.
|
|
30
|
-
if (rscRenderContext.has(platform)) {
|
|
31
|
-
return rscRenderContext.get(platform);
|
|
32
|
-
}
|
|
33
|
-
const context = {};
|
|
34
|
-
rscRenderContext.set(platform, context);
|
|
35
|
-
return context;
|
|
36
|
-
}
|
|
37
26
|
function getServerActionManifest(_distFolder, platform) {
|
|
38
27
|
const filePath = `../../rsc/${platform}/action-manifest.js`;
|
|
39
28
|
return serverRequire(filePath);
|
|
@@ -43,12 +32,11 @@ function getSSRManifest(_distFolder, platform) {
|
|
|
43
32
|
return serverRequire(filePath);
|
|
44
33
|
}
|
|
45
34
|
async function renderRscWithImportsAsync(distFolder, imports, { body, platform, searchParams, config, method, input, contentType, headers }) {
|
|
46
|
-
globalThis.__expo_platform_header = platform;
|
|
47
35
|
if (method === 'POST' && !body) {
|
|
48
36
|
throw new Error('Server request must be provided when method is POST (server actions)');
|
|
49
37
|
}
|
|
50
|
-
|
|
51
|
-
context
|
|
38
|
+
// Must stay per-request; sharing this object across renders would leak headers between concurrent requests.
|
|
39
|
+
const context = { __expo_requestHeaders: headers };
|
|
52
40
|
const router = await imports.router();
|
|
53
41
|
const entries = router.default({
|
|
54
42
|
redirects: expo_constants_1.default.expoConfig?.extra?.router?.redirects,
|
|
@@ -61,6 +49,8 @@ async function renderRscWithImportsAsync(distFolder, imports, { body, platform,
|
|
|
61
49
|
context,
|
|
62
50
|
config,
|
|
63
51
|
input,
|
|
52
|
+
method,
|
|
53
|
+
headers,
|
|
64
54
|
contentType,
|
|
65
55
|
decodedBody: searchParams.get('x-expo-params'),
|
|
66
56
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/rsc/middleware.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/rsc/middleware.ts"],"names":[],"mappings":";;;;;AAgEA,8DAqEC;AAED,wCAeC;AAtJD;;;;;;GAMG;AACH,2GAA2G;AAC3G,oEAAuC;AAEvC,0DAA6B;AAE7B,iDAA2C;AAC3C,0CAA6C;AAI7C,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,iCAAiC,CAAC,CAAC;AAE7D,SAAS,aAAa,CAAU,GAAG,sBAAgC;IACjE,kGAAkG;IAClG,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,sBAAsB,CAAC,CAAC;IACjE,OAAO,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,uBAAuB,CAC9B,WAAmB,EACnB,QAAgB;IAWhB,MAAM,QAAQ,GAAG,aAAa,QAAQ,qBAAqB,CAAC;IAC5D,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,cAAc,CACrB,WAAmB,EACnB,QAAgB;IAWhB,MAAM,QAAQ,GAAG,aAAa,QAAQ,kBAAkB,CAAC;IACzD,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAOM,KAAK,UAAU,yBAAyB,CAC7C,UAAkB,EAClB,OAAkB,EAClB,EAAE,IAAI,EAAE,QAAQ,EA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ACJ,CAAC;gBAED,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;gBACzC,OAAO;oBACL,EAAE;oBACF,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;iBAC7B,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,CAAC,IAAI,IAAI,WAAW,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;YAClE,CAAC;YAED,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;YACtC,OAAO;gBACL,EAAE;gBACF,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;aAC7B,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,mBAAmB,CAAC,IAAI;YAC5B,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;YACnC,4FAA4F;YAC5F,OAAO,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,EAAE,OAAQ;KAClB,CACF,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,cAAc,CAClC,UAAkB,EAClB,IAAmB;IAEnB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,OAAO,yBAAyB,CAC9B,UAAU,EACV;QACE,MAAM,EAAE,GAAG,EAAE;YACX,4FAA4F;YAC5F,OAAO,aAAa,CAAC,aAAa,QAAQ,YAAY,CAAC,CAAC;QAC1D,CAAC;KACF,EACD,IAAI,CACL,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Copyright © 2024 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n// This module is bundled with Metro in web/react-server mode and redirects to platform specific renderers.\nimport Constants from 'expo-constants';\nimport type { RenderRscArgs } from 'expo-server/private';\nimport path from 'node:path';\n\nimport { renderRsc } from './rsc-renderer';\nimport { createDebug } from '../utils/debug';\n\ndeclare const $$require_external: typeof require;\n\nconst debug = createDebug('expo:router:server:rsc-renderer');\n\nfunction serverRequire<T = any>(...targetOutputModulePath: string[]): T {\n // NOTE(@kitten): This `__dirname` will be located in the output file system, e.g. `dist/server/*`\n const filePath = path.join(__dirname, ...targetOutputModulePath);\n return $$require_external(filePath);\n}\n\nfunction getServerActionManifest(\n _distFolder: string,\n platform: string\n): Record<\n // Input ID\n string,\n [\n // Metro ID\n string,\n // Chunk location.\n string,\n ]\n> {\n const filePath = `../../rsc/${platform}/action-manifest.js`;\n return serverRequire(filePath);\n}\n\nfunction getSSRManifest(\n _distFolder: string,\n platform: string\n): Record<\n // Input ID\n string,\n [\n // Metro ID\n string,\n // Chunk location.\n string,\n ]\n> {\n const filePath = `../../rsc/${platform}/ssr-manifest.js`;\n return serverRequire(filePath);\n}\n\n// The import map allows us to use external modules from different bundling contexts.\ntype ImportMap = {\n router: () => Promise<typeof import('./router/expo-definedRouter')>;\n};\n\nexport async function renderRscWithImportsAsync(\n distFolder: string,\n imports: ImportMap,\n { body, platform, searchParams, config, method, input, contentType, headers }: RenderRscArgs\n): Promise<ReadableStream<any>> {\n if (method === 'POST' && !body) {\n throw new Error('Server request must be provided when method is POST (server actions)');\n }\n\n // Must stay per-request; sharing this object across renders would leak headers between concurrent requests.\n const context = { __expo_requestHeaders: headers };\n const router = await imports.router();\n const entries = router.default({\n redirects: Constants.expoConfig?.extra?.router?.redirects,\n rewrites: Constants.expoConfig?.extra?.router?.rewrites,\n });\n\n const ssrManifest = getSSRManifest(distFolder, platform);\n const actionManifest = getServerActionManifest(distFolder, platform);\n return renderRsc(\n {\n body: body ?? undefined,\n context,\n config,\n input,\n method,\n headers,\n contentType,\n decodedBody: searchParams.get('x-expo-params'),\n },\n {\n isExporting: true,\n\n resolveClientEntry(file: string, isServer: boolean) {\n debug('resolveClientEntry', file, { isServer });\n\n if (isServer) {\n if (!(file in actionManifest)) {\n throw new Error(\n `Could not find file in server action manifest: ${file}. ${JSON.stringify(actionManifest)}`\n );\n }\n\n const [id, chunk] = actionManifest[file];\n return {\n id,\n chunks: chunk ? [chunk] : [],\n };\n }\n\n if (!(file in ssrManifest)) {\n throw new Error(`Could not find file in SSR manifest: ${file}`);\n }\n\n const [id, chunk] = ssrManifest[file];\n return {\n id,\n chunks: chunk ? [chunk] : [],\n };\n },\n async loadServerModuleRsc(file) {\n debug('loadServerModuleRsc', file);\n // NOTE(@kitten): [WORKAROUND] Assumes __dirname is at `dist/server/_expo/functions/_flight`\n return serverRequire('../../../', file);\n },\n\n entries: entries!,\n }\n );\n}\n\nexport async function renderRscAsync(\n distFolder: string,\n args: RenderRscArgs\n): Promise<ReadableStream<any>> {\n const platform = args.platform;\n return renderRscWithImportsAsync(\n distFolder,\n {\n router: () => {\n // NOTE(@kitten): [WORKAROUND] Assumes __dirname is at `dist/server/_expo/functions/_flight`\n return serverRequire(`../../rsc/${platform}/router.js`);\n },\n },\n args\n );\n}\n"]}
|
|
@@ -19,6 +19,8 @@ export type RenderRscArgs = {
|
|
|
19
19
|
input: string;
|
|
20
20
|
context: Record<string, unknown> | undefined;
|
|
21
21
|
body?: ReadableStream | undefined;
|
|
22
|
+
method?: 'GET' | 'POST';
|
|
23
|
+
headers?: Record<string, string>;
|
|
22
24
|
contentType?: string | undefined;
|
|
23
25
|
decodedBody?: unknown;
|
|
24
26
|
moduleIdCallback?: (module: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-renderer.d.ts","sourceRoot":"","sources":["../../src/rsc/rsc-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,iCAAiC,CAAC;AAOzC,OAAO,EAAsB,KAAK,UAAU,EAAmB,MAAM,UAAU,CAAC;AAOhF,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC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AAa,GAAG;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC;IACpB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACpD,CAAC;AAEF,wBAAsB,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CA8LjG"}
|
|
@@ -127,26 +127,56 @@ async function renderRsc(args, opts) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
const actionId = (0, rsc_1.decodeActionId)(input);
|
|
130
|
-
|
|
130
|
+
// CSRF preflight checks
|
|
131
|
+
// - Enforces Sec-Fetch-Site isn't "cross-site"
|
|
132
|
+
// - Otherwise, we enforce expo-platform to enforce preflight
|
|
133
|
+
const fetchSite = args.headers?.['sec-fetch-site'];
|
|
134
|
+
if (actionId && args.method !== 'POST') {
|
|
135
|
+
throw new Error(`Server action "${actionId}" rejected: Invalid method`);
|
|
136
|
+
}
|
|
137
|
+
else if (actionId && fetchSite === 'cross-site') {
|
|
138
|
+
throw new Error(`Server action "${actionId}" rejected: Cross-site request`);
|
|
139
|
+
}
|
|
140
|
+
else if (actionId && !fetchSite && !args.headers?.['expo-platform']) {
|
|
141
|
+
throw new Error(`Server action "${actionId}" rejected: Missing required header`);
|
|
142
|
+
}
|
|
143
|
+
else if (actionId) {
|
|
131
144
|
if (!opts.isExporting &&
|
|
132
145
|
// @ts-ignore
|
|
133
146
|
!process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS) {
|
|
134
147
|
throw new Error('Experimental support for React Server Functions is not enabled');
|
|
135
148
|
}
|
|
136
|
-
const
|
|
149
|
+
const actionArgs = Array.isArray(decodedBody) ? decodedBody : [];
|
|
137
150
|
const chunkInfo = serverConfig[actionId];
|
|
151
|
+
if (!chunkInfo) {
|
|
152
|
+
throw new Error(`Could not find server action "${actionId}" in the server config.`);
|
|
153
|
+
}
|
|
138
154
|
// Load module into memory.
|
|
139
155
|
await Promise.all(chunkInfo.chunks.map((chunk) => globalThis.__webpack_chunk_load__(chunk)));
|
|
140
156
|
// Import module.
|
|
141
157
|
const mod = globalThis.__webpack_require__(chunkInfo.id);
|
|
142
|
-
|
|
143
|
-
if (
|
|
158
|
+
let fn;
|
|
159
|
+
if (mod == null || (typeof mod !== 'object' && typeof mod !== 'function')) {
|
|
160
|
+
fn = undefined;
|
|
161
|
+
}
|
|
162
|
+
else if (chunkInfo.name === '*' || chunkInfo.name === '') {
|
|
163
|
+
fn = mod.__esModule === true && Object.hasOwn(mod, 'default') ? mod.default : mod;
|
|
164
|
+
}
|
|
165
|
+
else if (Object.hasOwn(mod, chunkInfo.name)) {
|
|
166
|
+
fn = mod[chunkInfo.name];
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
fn = undefined;
|
|
170
|
+
}
|
|
171
|
+
if (typeof fn !== 'function') {
|
|
144
172
|
throw new Error(`Could not find server action: ${actionId}. Module: ${JSON.stringify(chunkInfo, null, 2)}`);
|
|
145
173
|
}
|
|
146
|
-
return renderWithContextWithAction(context, fn,
|
|
174
|
+
return renderWithContextWithAction(context, fn, actionArgs);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
// method === 'GET'
|
|
178
|
+
return renderWithContext(context, input, decodedBody);
|
|
147
179
|
}
|
|
148
|
-
// method === 'GET'
|
|
149
|
-
return renderWithContext(context, input, decodedBody);
|
|
150
180
|
}
|
|
151
181
|
// TODO is this correct? better to use a library?
|
|
152
182
|
const parseFormData = (body, contentType) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-renderer.js","sourceRoot":"","sources":["../../src/rsc/rsc-renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAsDH,8BAwKC;AA5ND,kEAAkE;AAElE,iGAAiG;AACjG,2CAAyC;AAEzC,kDAA0D;AAE1D,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,SAAS,EAAE,CAAC;IAClC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,MAAyC,CAAC;IAC9C,GAAG,CAAC;QACF,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;IACvB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC,CAAC","sourcesContent":["/**\n * Copyright © 2024 650 Industries.\n * Copyright © 2024 dai-shi.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From waku https://github.com/dai-shi/waku/blob/32d52242c1450b5f5965860e671ff73c42da8bd0/packages/waku/src/lib/renderers/rsc-renderer.ts\n */\n\n// This file must remain platform agnostic for production exports.\n\n// Import the runtime to support polyfills for webpack to load modules in the server using Metro.\nimport '@expo/metro-runtime/rsc/runtime';\n\nimport { decodeActionId } from 'expo-router/internal/rsc';\nimport type { ReactNode } from 'react';\nimport { renderToReadableStream, decodeReply } from 'react-server-dom-webpack/server';\n\nimport { fileURLToFilePath } from './path';\nimport { runWithRenderStore, type EntriesDev, type EntriesPrd } from './server';\n\ndeclare namespace globalThis {\n function __webpack_chunk_load__(id: string): Promise<unknown>;\n function __webpack_require__(id: string): any;\n}\n\nexport interface RenderContext<T = unknown> {\n rerender: (input: string, searchParams?: URLSearchParams) => void;\n context: T;\n}\n\ntype ResolvedConfig = any;\n\nexport type RenderRscArgs = {\n // TODO:\n config: ResolvedConfig;\n\n // Done\n input: string;\n context: Record<string, unknown> | undefined;\n body?: ReadableStream | undefined;\n contentType?: string | undefined;\n decodedBody?: unknown;\n moduleIdCallback?: (module: {\n id: string;\n chunks: string[];\n name: string;\n async: boolean;\n }) => void;\n onError?: (err: unknown) => void;\n};\n\ntype ResolveClientEntry = (id: string, server: boolean) => { id: string; chunks: string[] };\n\ntype RenderRscOpts = {\n isExporting: boolean;\n entries: EntriesDev;\n resolveClientEntry: ResolveClientEntry;\n loadServerModuleRsc: (url: string) => Promise<any>;\n};\n\nexport async function renderRsc(args: RenderRscArgs, opts: RenderRscOpts): Promise<ReadableStream> {\n const { input, body, contentType, context, onError } = args;\n const { resolveClientEntry, entries } = opts;\n\n const {\n default: { renderEntries },\n // @ts-expect-error\n buildConfig,\n } = entries as (EntriesDev & { loadModule: never; buildConfig: never }) | EntriesPrd;\n\n function resolveRequest(isServer: boolean, encodedId: string) {\n const [\n // File is the on-disk location of the module, this is injected during the \"use client\" transformation (babel).\n file,\n // The name of the import (e.g. \"default\" or \"\")\n // This will be empty when using `module.exports = ` and `require('...')`.\n name = '',\n ] = encodedId.split('#') as [string, string];\n\n const filePath = file.startsWith('file://') ? fileURLToFilePath(file) : file;\n\n args.moduleIdCallback?.({\n id: filePath,\n chunks: [\n // TODO: Add a lookup later which reads from the SSR manifest to get the correct chunk.\n // NOTE(EvanBacon): This is a placeholder since we need to render RSC to get the client boundaries, which we then inject later.\n 'chunk:' + filePath,\n ],\n name,\n async: true,\n });\n // We'll augment the file path with the incoming RSC request which will forward the metro props required to make a cache hit, e.g. platform=web&...\n // This is similar to how we handle lazy bundling.\n const resolved = resolveClientEntry(filePath, isServer);\n return { id: resolved.id, chunks: resolved.chunks, name, async: true };\n }\n\n const bundlerConfig: Record<string, ReturnType<typeof resolveRequest>> = new Proxy(\n {},\n {\n get(_target, encodedId: string) {\n return resolveRequest(false, encodedId);\n },\n }\n );\n\n const serverConfig: Record<string, ReturnType<typeof resolveRequest>> = new Proxy(\n {},\n {\n get(_target, encodedId: string) {\n return resolveRequest(true, encodedId);\n },\n }\n );\n\n // @ts-ignore: Not part of global types. This is added to support server actions loading more actions.\n global[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`] = opts.loadServerModuleRsc;\n\n const renderWithContext = async (\n context: Record<string, unknown> | undefined,\n input: string,\n params: unknown\n ) => {\n const renderStore = {\n context: context || {},\n rerender: () => {\n throw new Error('Cannot rerender');\n },\n };\n return runWithRenderStore(renderStore, async () => {\n const elements = await renderEntries(input, {\n params,\n buildConfig,\n });\n if (elements === null) {\n const err = new Error('No function component found at: ' + input);\n (err as any).statusCode = 404;\n throw err;\n }\n if (Object.keys(elements).some((key) => key.startsWith('_'))) {\n throw new Error('\"_\" prefix is reserved');\n }\n return renderToReadableStream(elements, bundlerConfig, {\n onError,\n });\n });\n };\n\n const renderWithContextWithAction = async (\n context: Record<string, unknown> | undefined,\n actionFn: (...args: unknown[]) => unknown,\n actionArgs: unknown[]\n ) => {\n let elementsPromise: Promise<Record<string, ReactNode>> = Promise.resolve({});\n let rendered = false;\n const renderStore = {\n context: context || {},\n rerender: async (input: string, params?: unknown) => {\n if (rendered) {\n throw new Error('already rendered');\n }\n elementsPromise = Promise.all([\n elementsPromise,\n renderEntries(input, { params, buildConfig }),\n ]).then(([oldElements, newElements]) => ({\n ...oldElements,\n // FIXME we should actually check if newElements is null and send an error\n ...newElements,\n }));\n },\n };\n return runWithRenderStore(renderStore, async () => {\n const actionValue = await actionFn(...actionArgs);\n const elements = await elementsPromise;\n rendered = true;\n if (Object.keys(elements).some((key) => key.startsWith('_'))) {\n throw new Error('\"_\" prefix is reserved');\n }\n return renderToReadableStream({ ...elements, _value: actionValue }, bundlerConfig, {\n onError,\n });\n });\n };\n\n let decodedBody: unknown | undefined = args.decodedBody;\n if (body) {\n const bodyStr = await streamToString(body);\n if (typeof contentType === 'string' && contentType.startsWith('multipart/form-data')) {\n // XXX This doesn't support streaming unlike busboy\n const formData = parseFormData(bodyStr, contentType);\n decodedBody = await decodeReply(formData, serverConfig);\n } else if (bodyStr) {\n decodedBody = await decodeReply(bodyStr, serverConfig);\n }\n }\n\n const actionId = decodeActionId(input);\n if (actionId) {\n if (\n !opts.isExporting &&\n // @ts-ignore\n !process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS\n ) {\n throw new Error('Experimental support for React Server Functions is not enabled');\n }\n\n const args = Array.isArray(decodedBody) ? decodedBody : [];\n\n const chunkInfo = serverConfig[actionId];\n\n // Load module into memory.\n await Promise.all(chunkInfo.chunks.map((chunk) => globalThis.__webpack_chunk_load__(chunk)));\n\n // Import module.\n const mod: any = globalThis.__webpack_require__(chunkInfo.id);\n const fn = chunkInfo.name === '*' ? chunkInfo.name : mod[chunkInfo.name] || mod;\n\n if (!fn) {\n throw new Error(\n `Could not find server action: ${actionId}. Module: ${JSON.stringify(chunkInfo, null, 2)}`\n );\n }\n\n return renderWithContextWithAction(context, fn, args);\n }\n\n // method === 'GET'\n return renderWithContext(context, input, decodedBody);\n}\n\n// TODO is this correct? better to use a library?\nconst parseFormData = (body: string, contentType: string) => {\n const boundary = contentType.split('boundary=')[1];\n const parts = body.split(`--${boundary}`);\n const formData = new FormData();\n for (const part of parts) {\n if (part.trim() === '' || part === '--') continue;\n const [rawHeaders, content] = part.split('\\r\\n\\r\\n', 2);\n const headers = rawHeaders!.split('\\r\\n').reduce(\n (acc, currentHeader) => {\n const [key, value] = currentHeader.split(': ');\n acc[key!.toLowerCase()] = value!;\n return acc;\n },\n {} as Record<string, string>\n );\n const contentDisposition = headers['content-disposition'];\n const nameMatch = /name=\"([^\"]+)\"/.exec(contentDisposition!);\n const filenameMatch = /filename=\"([^\"]+)\"/.exec(contentDisposition!);\n if (nameMatch) {\n const name = nameMatch[1];\n if (filenameMatch) {\n const filename = filenameMatch[1];\n const type = headers['content-type'] || 'application/octet-stream';\n const blob = new Blob([content!], { type });\n formData.append(name!, blob, filename);\n } else {\n formData.append(name!, content!.trim());\n }\n }\n }\n return formData;\n};\n\nconst streamToString = async (stream: ReadableStream): Promise<string> => {\n const decoder = new TextDecoder();\n const reader = stream.getReader();\n const outs: string[] = [];\n let result: ReadableStreamReadResult<unknown>;\n do {\n result = await reader.read();\n if (result.value) {\n if (!(result.value instanceof Uint8Array)) {\n throw new Error('Unexepected buffer type');\n }\n outs.push(decoder.decode(result.value, { stream: true }));\n }\n } while (!result.done);\n outs.push(decoder.decode());\n return outs.join('');\n};\n"]}
|
|
1
|
+
{"version":3,"file":"rsc-renderer.js","sourceRoot":"","sources":["../../src/rsc/rsc-renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAwDH,8BA8LC;AApPD,kEAAkE;AAElE,iGAAiG;AACjG,2CAAyC;AAEzC,kDAA0D;AAE1D,4DAAsF;AAEtF,iCAA2C;AAC3C,qCAAgF;AA4CzE,KAAK,UAAU,SAAS,CAAC,IAAmB,EAAE,IAAmB;IACtE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5D,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAE7C,MAAM,EACJ,OAAO,EAAE,EAAE,aAAa,EAAE;IAC1B,mBAAmB;IACnB,WAAW,GACZ,GAAG,OAAgF,CAAC;IAErF,SAAS,cAAc,CAAC,QAAiB,EAAE,SAAiB;QAC1D,MAAM;QACJ,+GAA+G;QAC/G,IAAI;QACJ,gDAAgD;QAChD,0EAA0E;QAC1E,IAAI,GAAG,EAAE,EACV,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QAE7C,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,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cesContent":["/**\n * Copyright © 2024 650 Industries.\n * Copyright © 2024 dai-shi.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From waku https://github.com/dai-shi/waku/blob/32d52242c1450b5f5965860e671ff73c42da8bd0/packages/waku/src/lib/renderers/rsc-renderer.ts\n */\n\n// This file must remain platform agnostic for production exports.\n\n// Import the runtime to support polyfills for webpack to load modules in the server using Metro.\nimport '@expo/metro-runtime/rsc/runtime';\n\nimport { decodeActionId } from 'expo-router/internal/rsc';\nimport type { ReactNode } from 'react';\nimport { renderToReadableStream, decodeReply } from 'react-server-dom-webpack/server';\n\nimport { fileURLToFilePath } from './path';\nimport { runWithRenderStore, type EntriesDev, type EntriesPrd } from './server';\n\ndeclare namespace globalThis {\n function __webpack_chunk_load__(id: string): Promise<unknown>;\n function __webpack_require__(id: string): any;\n}\n\nexport interface RenderContext<T = unknown> {\n rerender: (input: string, searchParams?: URLSearchParams) => void;\n context: T;\n}\n\ntype ResolvedConfig = any;\n\nexport type RenderRscArgs = {\n // TODO:\n config: ResolvedConfig;\n\n // Done\n input: string;\n context: Record<string, unknown> | undefined;\n body?: ReadableStream | undefined;\n method?: 'GET' | 'POST';\n headers?: Record<string, string>;\n contentType?: string | undefined;\n decodedBody?: unknown;\n moduleIdCallback?: (module: {\n id: string;\n chunks: string[];\n name: string;\n async: boolean;\n }) => void;\n onError?: (err: unknown) => void;\n};\n\ntype ResolveClientEntry = (id: string, server: boolean) => { id: string; chunks: string[] };\n\ntype RenderRscOpts = {\n isExporting: boolean;\n entries: EntriesDev;\n resolveClientEntry: ResolveClientEntry;\n loadServerModuleRsc: (url: string) => Promise<any>;\n};\n\nexport async function renderRsc(args: RenderRscArgs, opts: RenderRscOpts): Promise<ReadableStream> {\n const { input, body, contentType, context, onError } = args;\n const { resolveClientEntry, entries } = opts;\n\n const {\n default: { renderEntries },\n // @ts-expect-error\n buildConfig,\n } = entries as (EntriesDev & { loadModule: never; buildConfig: never }) | EntriesPrd;\n\n function resolveRequest(isServer: boolean, encodedId: string) {\n const [\n // File is the on-disk location of the module, this is injected during the \"use client\" transformation (babel).\n file,\n // The name of the import (e.g. \"default\" or \"\")\n // This will be empty when using `module.exports = ` and `require('...')`.\n name = '',\n ] = encodedId.split('#') as [string, string];\n\n const filePath = file.startsWith('file://') ? fileURLToFilePath(file) : file;\n\n args.moduleIdCallback?.({\n id: filePath,\n chunks: [\n // TODO: Add a lookup later which reads from the SSR manifest to get the correct chunk.\n // NOTE(EvanBacon): This is a placeholder since we need to render RSC to get the client boundaries, which we then inject later.\n 'chunk:' + filePath,\n ],\n name,\n async: true,\n });\n // We'll augment the file path with the incoming RSC request which will forward the metro props required to make a cache hit, e.g. platform=web&...\n // This is similar to how we handle lazy bundling.\n const resolved = resolveClientEntry(filePath, isServer);\n return { id: resolved.id, chunks: resolved.chunks, name, async: true };\n }\n\n const bundlerConfig: Record<string, ReturnType<typeof resolveRequest>> = new Proxy(\n {},\n {\n get(_target, encodedId: string) {\n return resolveRequest(false, encodedId);\n },\n }\n );\n\n const serverConfig: Record<string, ReturnType<typeof resolveRequest>> = new Proxy(\n {},\n {\n get(_target, encodedId: string) {\n return resolveRequest(true, encodedId);\n },\n }\n );\n\n // @ts-ignore: Not part of global types. This is added to support server actions loading more actions.\n global[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`] = opts.loadServerModuleRsc;\n\n const renderWithContext = async (\n context: Record<string, unknown> | undefined,\n input: string,\n params: unknown\n ) => {\n const renderStore = {\n context: context || {},\n rerender: () => {\n throw new Error('Cannot rerender');\n },\n };\n return runWithRenderStore(renderStore, async () => {\n const elements = await renderEntries(input, {\n params,\n buildConfig,\n });\n if (elements === null) {\n const err = new Error('No function component found at: ' + input);\n (err as any).statusCode = 404;\n throw err;\n }\n if (Object.keys(elements).some((key) => key.startsWith('_'))) {\n throw new Error('\"_\" prefix is reserved');\n }\n return renderToReadableStream(elements, bundlerConfig, {\n onError,\n });\n });\n };\n\n const renderWithContextWithAction = async (\n context: Record<string, unknown> | undefined,\n actionFn: (...args: unknown[]) => unknown,\n actionArgs: unknown[]\n ) => {\n let elementsPromise: Promise<Record<string, ReactNode>> = Promise.resolve({});\n let rendered = false;\n const renderStore = {\n context: context || {},\n rerender: async (input: string, params?: unknown) => {\n if (rendered) {\n throw new Error('already rendered');\n }\n elementsPromise = Promise.all([\n elementsPromise,\n renderEntries(input, { params, buildConfig }),\n ]).then(([oldElements, newElements]) => ({\n ...oldElements,\n // FIXME we should actually check if newElements is null and send an error\n ...newElements,\n }));\n },\n };\n return runWithRenderStore(renderStore, async () => {\n const actionValue = await actionFn(...actionArgs);\n const elements = await elementsPromise;\n rendered = true;\n if (Object.keys(elements).some((key) => key.startsWith('_'))) {\n throw new Error('\"_\" prefix is reserved');\n }\n return renderToReadableStream({ ...elements, _value: actionValue }, bundlerConfig, {\n onError,\n });\n });\n };\n\n let decodedBody: unknown | undefined = args.decodedBody;\n if (body) {\n const bodyStr = await streamToString(body);\n if (typeof contentType === 'string' && contentType.startsWith('multipart/form-data')) {\n // XXX This doesn't support streaming unlike busboy\n const formData = parseFormData(bodyStr, contentType);\n decodedBody = await decodeReply(formData, serverConfig);\n } else if (bodyStr) {\n decodedBody = await decodeReply(bodyStr, serverConfig);\n }\n }\n\n const actionId = decodeActionId(input);\n // CSRF preflight checks\n // - Enforces Sec-Fetch-Site isn't \"cross-site\"\n // - Otherwise, we enforce expo-platform to enforce preflight\n const fetchSite = args.headers?.['sec-fetch-site'];\n if (actionId && args.method !== 'POST') {\n throw new Error(`Server action \"${actionId}\" rejected: Invalid method`);\n } else if (actionId && fetchSite === 'cross-site') {\n throw new Error(`Server action \"${actionId}\" rejected: Cross-site request`);\n } else if (actionId && !fetchSite && !args.headers?.['expo-platform']) {\n throw new Error(`Server action \"${actionId}\" rejected: Missing required header`);\n } else if (actionId) {\n if (\n !opts.isExporting &&\n // @ts-ignore\n !process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS\n ) {\n throw new Error('Experimental support for React Server Functions is not enabled');\n }\n\n const actionArgs = Array.isArray(decodedBody) ? decodedBody : [];\n const chunkInfo = serverConfig[actionId];\n if (!chunkInfo) {\n throw new Error(`Could not find server action \"${actionId}\" in the server config.`);\n }\n\n // Load module into memory.\n await Promise.all(chunkInfo.chunks.map((chunk) => globalThis.__webpack_chunk_load__(chunk)));\n\n // Import module.\n const mod: any = globalThis.__webpack_require__(chunkInfo.id);\n\n let fn: ((...args: unknown[]) => unknown) | undefined;\n if (mod == null || (typeof mod !== 'object' && typeof mod !== 'function')) {\n fn = undefined;\n } else if (chunkInfo.name === '*' || chunkInfo.name === '') {\n fn = mod.__esModule === true && Object.hasOwn(mod, 'default') ? mod.default : mod;\n } else if (Object.hasOwn(mod, chunkInfo.name)) {\n fn = mod[chunkInfo.name];\n } else {\n fn = undefined;\n }\n\n if (typeof fn !== 'function') {\n throw new Error(\n `Could not find server action: ${actionId}. Module: ${JSON.stringify(chunkInfo, null, 2)}`\n );\n }\n\n return renderWithContextWithAction(context, fn, actionArgs);\n } else {\n // method === 'GET'\n return renderWithContext(context, input, decodedBody);\n }\n}\n\n// TODO is this correct? better to use a library?\nconst parseFormData = (body: string, contentType: string) => {\n const boundary = contentType.split('boundary=')[1];\n const parts = body.split(`--${boundary}`);\n const formData = new FormData();\n for (const part of parts) {\n if (part.trim() === '' || part === '--') continue;\n const [rawHeaders, content] = part.split('\\r\\n\\r\\n', 2);\n const headers = rawHeaders!.split('\\r\\n').reduce(\n (acc, currentHeader) => {\n const [key, value] = currentHeader.split(': ');\n acc[key!.toLowerCase()] = value!;\n return acc;\n },\n {} as Record<string, string>\n );\n const contentDisposition = headers['content-disposition'];\n const nameMatch = /name=\"([^\"]+)\"/.exec(contentDisposition!);\n const filenameMatch = /filename=\"([^\"]+)\"/.exec(contentDisposition!);\n if (nameMatch) {\n const name = nameMatch[1];\n if (filenameMatch) {\n const filename = filenameMatch[1];\n const type = headers['content-type'] || 'application/octet-stream';\n const blob = new Blob([content!], { type });\n formData.append(name!, blob, filename);\n } else {\n formData.append(name!, content!.trim());\n }\n }\n }\n return formData;\n};\n\nconst streamToString = async (stream: ReadableStream): Promise<string> => {\n const decoder = new TextDecoder();\n const reader = stream.getReader();\n const outs: string[] = [];\n let result: ReadableStreamReadResult<unknown>;\n do {\n result = await reader.read();\n if (result.value) {\n if (!(result.value instanceof Uint8Array)) {\n throw new Error('Unexepected buffer type');\n }\n outs.push(decoder.decode(result.value, { stream: true }));\n }\n } while (!result.done);\n outs.push(decoder.decode());\n return outs.join('');\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/rsc/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,eAAO,MAAM,eAAe,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/rsc/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAQvD,KAAK,MAAM,GAAG,GAAG,CAAC;AAElB,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACnC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS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;IAC7C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;IAC3D,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,WAAW,GAAK;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAQF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,aAAa,WAAW,EAAE,IAAI,MAAM,CAAC,KAAG,CAE7E,CAAC;AAEF,wBAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,iBAM7D;AAED,wBAAgB,UAAU,CACxB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACjE,UAAU,CAMd"}
|
package/build/rsc/server.js
CHANGED
|
@@ -16,54 +16,27 @@ exports.REQUEST_HEADERS = '__expo_requestHeaders';
|
|
|
16
16
|
function defineEntries(renderEntries, getBuildConfig, getSsrConfig) {
|
|
17
17
|
return { renderEntries, getBuildConfig, getSsrConfig };
|
|
18
18
|
}
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
// In production the shared middleware is web-only and that causes the first version of this module
|
|
24
|
-
// to be bound to web.
|
|
25
|
-
const platform = globalThis.__expo_platform_header ?? process.env.EXPO_OS;
|
|
26
|
-
if (!globalThis.__EXPO_RSC_CACHE__) {
|
|
27
|
-
globalThis.__EXPO_RSC_CACHE__ = new Map();
|
|
28
|
-
}
|
|
29
|
-
if (globalThis.__EXPO_RSC_CACHE__.has(platform)) {
|
|
30
|
-
return globalThis.__EXPO_RSC_CACHE__.get(platform);
|
|
31
|
-
}
|
|
32
|
-
const serverCache = new node_async_hooks_1.AsyncLocalStorage();
|
|
33
|
-
globalThis.__EXPO_RSC_CACHE__.set(platform, serverCache);
|
|
34
|
-
return serverCache;
|
|
19
|
+
// Stashed on globalThis so separately-loaded copies of this module (e.g. the renderer and a
|
|
20
|
+
// server-action module loaded via Metro's ssrLoadModule) share one storage instance.
|
|
21
|
+
function getRenderStorage() {
|
|
22
|
+
return (globalThis.__EXPO_RSC_STORE__ ??= new node_async_hooks_1.AsyncLocalStorage());
|
|
35
23
|
}
|
|
36
|
-
let previousRenderStore;
|
|
37
|
-
let currentRenderStore;
|
|
38
24
|
/**
|
|
39
25
|
* This is an internal function and not for public use.
|
|
40
26
|
*/
|
|
41
27
|
const runWithRenderStore = (renderStore, fn) => {
|
|
42
|
-
|
|
43
|
-
if (renderStorage) {
|
|
44
|
-
return renderStorage.run(renderStore, fn);
|
|
45
|
-
}
|
|
46
|
-
previousRenderStore = currentRenderStore;
|
|
47
|
-
currentRenderStore = renderStore;
|
|
48
|
-
try {
|
|
49
|
-
return fn();
|
|
50
|
-
}
|
|
51
|
-
finally {
|
|
52
|
-
currentRenderStore = previousRenderStore;
|
|
53
|
-
}
|
|
28
|
+
return getRenderStorage().run(renderStore, fn);
|
|
54
29
|
};
|
|
55
30
|
exports.runWithRenderStore = runWithRenderStore;
|
|
56
31
|
async function rerender(input, params) {
|
|
57
|
-
const
|
|
58
|
-
const renderStore = renderStorage.getStore() ?? currentRenderStore;
|
|
32
|
+
const renderStore = getRenderStorage().getStore();
|
|
59
33
|
if (!renderStore) {
|
|
60
34
|
throw new Error('Render store is not available for rerender');
|
|
61
35
|
}
|
|
62
36
|
renderStore.rerender(input, params);
|
|
63
37
|
}
|
|
64
38
|
function getContext() {
|
|
65
|
-
const
|
|
66
|
-
const renderStore = renderStorage.getStore() ?? currentRenderStore;
|
|
39
|
+
const renderStore = getRenderStorage().getStore();
|
|
67
40
|
if (!renderStore) {
|
|
68
41
|
throw new Error('Render store is not available for accessing context');
|
|
69
42
|
}
|
package/build/rsc/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/rsc/server.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/rsc/server.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAwDH,sCAMC;AA+BD,4BAMC;AAED,gCAQC;AA3GD,uDAAqD;AAKxC,QAAA,eAAe,GAAG,uBAAuB,CAAC;AAiDvD,SAAgB,aAAa,CAC3B,aAA4B,EAC5B,cAA+B,EAC/B,YAA2B;IAE3B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;AACzD,CAAC;AAkBD,4FAA4F;AAC5F,qFAAqF;AACrF,SAAS,gBAAgB;IACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,KAAK,IAAI,oCAAiB,EAAe,CAAC,CAAC;AAClF,CAAC;AAED;;GAEG;AACI,MAAM,kBAAkB,GAAG,CAAI,WAAwB,EAAE,EAAW,EAAK,EAAE;IAChF,OAAO,gBAAgB,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,KAAK,UAAU,QAAQ,CAAC,KAAa,EAAE,MAAgB;IAC5D,MAAM,WAAW,GAAG,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC;IAClD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,UAAU;IAGxB,MAAM,WAAW,GAAG,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC;IAClD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,WAAW,CAAC,OAAqB,CAAC;AAC3C,CAAC","sourcesContent":["/**\n * Copyright © 2024 650 Industries.\n * Copyright © 2024 2023 Daishi Kato\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport type { ReactNode } from 'react';\n\nimport type { PathSpec } from './path';\n\nexport const REQUEST_HEADERS = '__expo_requestHeaders';\n\ndeclare let globalThis: {\n __EXPO_RSC_STORE__?: AsyncLocalStorage<RenderStore>;\n __webpack_chunk_load__: (id: string) => Promise<any>;\n __webpack_require__: (id: string) => any;\n};\n\ntype Config = any;\n\ntype Elements = Record<string, ReactNode>;\n\nexport type BuildConfig = {\n pathname: string | PathSpec; // TODO drop support for string?\n isStatic?: boolean | undefined;\n entries?: {\n input: string;\n skipPrefetch?: boolean | undefined;\n isStatic?: boolean | undefined;\n }[];\n context?: Record<string, unknown>;\n customCode?: string; // optional code to inject TODO hope to remove this\n customData?: unknown; // should be serializable with JSON.stringify\n}[];\n\nexport type RenderEntries = (\n input: string,\n options: {\n params: unknown | undefined;\n buildConfig: BuildConfig | undefined;\n }\n) => Promise<Elements | null>;\n\nexport type GetBuildConfig = (\n unstable_collectClientModules: (input: string) => Promise<string[]>\n) => Promise<BuildConfig>;\n\nexport type GetSsrConfig = (\n pathname: string,\n options: {\n searchParams: URLSearchParams;\n buildConfig?: BuildConfig | undefined;\n }\n) => Promise<{\n input: string;\n searchParams?: URLSearchParams;\n html: ReactNode;\n} | null>;\n\nexport function defineEntries(\n renderEntries: RenderEntries,\n getBuildConfig?: GetBuildConfig,\n getSsrConfig?: GetSsrConfig\n) {\n return { renderEntries, getBuildConfig, getSsrConfig };\n}\n\nexport type EntriesDev = {\n default: ReturnType<typeof defineEntries>;\n};\n\nexport type EntriesPrd = EntriesDev & {\n loadConfig: () => Promise<Config>;\n loadModule: (id: string) => Promise<unknown>;\n dynamicHtmlPaths: [pathSpec: PathSpec, htmlHead: string][];\n publicIndexHtml: string;\n};\n\ntype RenderStore<> = {\n rerender: (input: string, params?: unknown) => void;\n context: Record<string, unknown>;\n};\n\n// Stashed on globalThis so separately-loaded copies of this module (e.g. the renderer and a\n// server-action module loaded via Metro's ssrLoadModule) share one storage instance.\nfunction getRenderStorage(): AsyncLocalStorage<RenderStore> {\n return (globalThis.__EXPO_RSC_STORE__ ??= new AsyncLocalStorage<RenderStore>());\n}\n\n/**\n * This is an internal function and not for public use.\n */\nexport const runWithRenderStore = <T>(renderStore: RenderStore, fn: () => T): T => {\n return getRenderStorage().run(renderStore, fn);\n};\n\nexport async function rerender(input: string, params?: unknown) {\n const renderStore = getRenderStorage().getStore();\n if (!renderStore) {\n throw new Error('Render store is not available for rerender');\n }\n renderStore.rerender(input, params);\n}\n\nexport function getContext<\n RscContext extends Record<string, unknown> = Record<string, unknown>,\n>(): RscContext {\n const renderStore = getRenderStorage().getStore();\n if (!renderStore) {\n throw new Error('Render store is not available for accessing context');\n }\n return renderStore.context as RscContext;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/router-server",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.17",
|
|
4
4
|
"description": "Expo Router is a file-based router for React Native and web applications.",
|
|
5
5
|
"author": "650 Industries, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"expo"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@expo/metro-runtime": "^55.0.
|
|
37
|
+
"@expo/metro-runtime": "^55.0.11",
|
|
38
38
|
"react": "*",
|
|
39
39
|
"react-dom": "*",
|
|
40
40
|
"expo": "*",
|
|
41
|
-
"expo-constants": "^55.0.
|
|
42
|
-
"expo-font": "^55.0.
|
|
41
|
+
"expo-constants": "^55.0.16",
|
|
42
|
+
"expo-font": "^55.0.8",
|
|
43
43
|
"expo-router": "*",
|
|
44
|
-
"expo-server": "^55.0.
|
|
44
|
+
"expo-server": "^55.0.10",
|
|
45
45
|
"react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "fcb091766242d53248cd3c5949965961dbc5ec1d"
|
|
72
72
|
}
|