@expo/router-server 55.0.3 → 55.0.4
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/server.d.ts +0 -2
- package/build/rsc/server.d.ts.map +1 -1
- package/build/rsc/server.js +0 -17
- package/build/rsc/server.js.map +1 -1
- package/package.json +11 -8
package/build/rsc/server.d.ts
CHANGED
|
@@ -59,7 +59,5 @@ type RenderStore = {
|
|
|
59
59
|
export declare const runWithRenderStore: <T>(renderStore: RenderStore, fn: () => T) => T;
|
|
60
60
|
export declare function rerender(input: string, params?: unknown): Promise<void>;
|
|
61
61
|
export declare function getContext<RscContext extends Record<string, unknown> = Record<string, unknown>>(): RscContext;
|
|
62
|
-
/** Get the request headers used to make the server component or action request. */
|
|
63
|
-
export declare function unstable_headers(): Promise<Headers>;
|
|
64
62
|
export {};
|
|
65
63
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -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;AASvD,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,CAAC;KAChC,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,OAAO,CAAC,OAAO,CAAC,CAAC;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;AA2BF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,aAAa,WAAW,EAAE,IAAI,MAAM,CAAC,KAAG,CAY7E,CAAC;AAEF,wBAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,iBAO7D;AAED,wBAAgB,UAAU,CACxB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACjE,UAAU,CAOd"}
|
package/build/rsc/server.js
CHANGED
|
@@ -11,7 +11,6 @@ exports.runWithRenderStore = exports.REQUEST_HEADERS = void 0;
|
|
|
11
11
|
exports.defineEntries = defineEntries;
|
|
12
12
|
exports.rerender = rerender;
|
|
13
13
|
exports.getContext = getContext;
|
|
14
|
-
exports.unstable_headers = unstable_headers;
|
|
15
14
|
const node_async_hooks_1 = require("node:async_hooks");
|
|
16
15
|
exports.REQUEST_HEADERS = '__expo_requestHeaders';
|
|
17
16
|
function defineEntries(renderEntries, getBuildConfig, getSsrConfig) {
|
|
@@ -70,20 +69,4 @@ function getContext() {
|
|
|
70
69
|
}
|
|
71
70
|
return renderStore.context;
|
|
72
71
|
}
|
|
73
|
-
/** Get the request headers used to make the server component or action request. */
|
|
74
|
-
async function unstable_headers() {
|
|
75
|
-
const headers = (getContext()[exports.REQUEST_HEADERS] || {});
|
|
76
|
-
return new ReadonlyHeaders(headers);
|
|
77
|
-
}
|
|
78
|
-
class ReadonlyHeaders extends Headers {
|
|
79
|
-
set() {
|
|
80
|
-
throw new Error('Server component Headers are read-only');
|
|
81
|
-
}
|
|
82
|
-
append() {
|
|
83
|
-
throw new Error('Server component Headers are read-only');
|
|
84
|
-
}
|
|
85
|
-
delete() {
|
|
86
|
-
throw new Error('Server component Headers are read-only');
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
72
|
//# sourceMappingURL=server.js.map
|
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;;;AAyDH,sCAMC;AA4DD,4BAOC;AAED,gCASC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/rsc/server.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAyDH,sCAMC;AA4DD,4BAOC;AAED,gCASC;AA3ID,uDAAqD;AAKxC,QAAA,eAAe,GAAG,uBAAuB,CAAC;AAkDvD,SAAgB,aAAa,CAC3B,aAA4B,EAC5B,cAA+B,EAC/B,YAA2B;IAE3B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;AACzD,CAAC;AAkBD,6DAA6D;AAC7D,oIAAoI;AACpI,SAAS,yBAAyB;IAChC,4FAA4F;IAC5F,mGAAmG;IACnG,sBAAsB;IACtB,MAAM,QAAQ,GAAG,UAAU,CAAC,sBAAsB,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAC1E,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC;QACnC,UAAU,CAAC,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5C,CAAC;IAED,IAAI,UAAU,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAS,CAAC,EAAE,CAAC;QACjD,OAAO,UAAU,CAAC,kBAAk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ACjB,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_CACHE__?: Map<string, any>;\n __expo_platform_header?: string;\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// TODO(EvanBacon): This can leak between platforms and runs.\n// We need to share this module between the server action module and the renderer module, per platform, and invalidate on refreshes.\nfunction getGlobalCacheForPlatform() {\n // HACK: This is a workaround for the shared middleware being shared between web and native.\n // In production the shared middleware is web-only and that causes the first version of this module\n // to be bound to web.\n const platform = globalThis.__expo_platform_header ?? process.env.EXPO_OS;\n if (!globalThis.__EXPO_RSC_CACHE__) {\n globalThis.__EXPO_RSC_CACHE__ = new Map();\n }\n\n if (globalThis.__EXPO_RSC_CACHE__.has(platform!)) {\n return globalThis.__EXPO_RSC_CACHE__.get(platform!)!;\n }\n\n const serverCache = new AsyncLocalStorage<RenderStore>();\n\n globalThis.__EXPO_RSC_CACHE__.set(platform!, serverCache);\n\n return serverCache;\n}\n\nlet previousRenderStore: RenderStore | undefined;\nlet currentRenderStore: RenderStore | undefined;\n\n/**\n * This is an internal function and not for public use.\n */\nexport const runWithRenderStore = <T>(renderStore: RenderStore, fn: () => T): T => {\n const renderStorage = getGlobalCacheForPlatform();\n if (renderStorage) {\n return renderStorage.run(renderStore, fn);\n }\n previousRenderStore = currentRenderStore;\n currentRenderStore = renderStore;\n try {\n return fn();\n } finally {\n currentRenderStore = previousRenderStore;\n }\n};\n\nexport async function rerender(input: string, params?: unknown) {\n const renderStorage = getGlobalCacheForPlatform();\n const renderStore = renderStorage.getStore() ?? currentRenderStore;\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 renderStorage = getGlobalCacheForPlatform();\n const renderStore = renderStorage.getStore() ?? currentRenderStore;\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.4",
|
|
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,21 +34,24 @@
|
|
|
34
34
|
"expo"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@expo/metro-runtime": "^55.0.
|
|
37
|
+
"@expo/metro-runtime": "^55.0.4",
|
|
38
38
|
"react": "*",
|
|
39
39
|
"react-dom": "*",
|
|
40
40
|
"expo": "*",
|
|
41
|
-
"expo-constants": "^55.0.
|
|
42
|
-
"expo-font": "
|
|
41
|
+
"expo-constants": "^55.0.3",
|
|
42
|
+
"expo-font": "~55.0.3",
|
|
43
43
|
"expo-router": "*",
|
|
44
|
-
"expo-server": "
|
|
44
|
+
"expo-server": "^55.0.3",
|
|
45
45
|
"react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
|
-
"
|
|
48
|
+
"@expo/metro-runtime": {
|
|
49
|
+
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"expo-router": {
|
|
49
52
|
"optional": true
|
|
50
53
|
},
|
|
51
|
-
"react-
|
|
54
|
+
"react-dom": {
|
|
52
55
|
"optional": true
|
|
53
56
|
},
|
|
54
57
|
"react-server-dom-webpack": {
|
|
@@ -65,5 +68,5 @@
|
|
|
65
68
|
"publishConfig": {
|
|
66
69
|
"access": "public"
|
|
67
70
|
},
|
|
68
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "436ffb4355d5207f4a03fbc3568cd33424a40f3e"
|
|
69
72
|
}
|