@expo/router-server 56.0.12 → 56.0.13

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.
@@ -24,6 +24,8 @@ export type GetStreamingContentOptions = {
24
24
  hmrId?: string;
25
25
  }[];
26
26
  js: string[];
27
+ /** Public href of a favicon generated from `web.favicon` in the app config. */
28
+ favicon?: string;
27
29
  };
28
30
  };
29
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"renderStreamingContent.d.ts","sourceRoot":"","sources":["../../src/server/renderStreamingContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAyBzC,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,oEAAoE;QACpE,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,SAAS,EAAE,SAAS,EAAE,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,MAAM,EAAE,CAAC;QACd,4EAA4E;QAC5E,SAAS,CAAC,EAAE;YACV,MAAM,EAAE,MAAM,CAAC;YACf,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;QACJ,EAAE,EAAE,MAAM,EAAE,CAAC;KACd,CAAC;CACH,CAAC;AAkDF;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,GAAG,EACb,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CA0CrC;AAED,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"renderStreamingContent.d.ts","sourceRoot":"","sources":["../../src/server/renderStreamingContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA0BzC,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,oEAAoE;QACpE,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,SAAS,EAAE,SAAS,EAAE,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,MAAM,EAAE,CAAC;QACd,4EAA4E;QAC5E,SAAS,CAAC,EAAE;YACV,MAAM,EAAE,MAAM,CAAC;YACf,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;QACJ,EAAE,EAAE,MAAM,EAAE,CAAC;QACb,+EAA+E;QAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAkDF;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,GAAG,EACb,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CA8CrC;AAED,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -108,13 +108,17 @@ async function getStreamingContent(location, options) {
108
108
  const { headContext, element, getStyleElement, loadedData } = prepareRenderContext(location, options);
109
109
  const { headNodes: headCssNodes } = (0, react_1.createInjectedCssAsNodes)(options?.assets?.css ?? []);
110
110
  const { headNodes: inlineCssNodes } = (0, react_1.createInjectedInlineCssAsNodes)(options?.assets?.inlineCss);
111
+ const faviconNode = options?.assets?.favicon
112
+ ? (0, react_1.createFaviconAsNode)(options?.assets?.favicon)
113
+ : undefined;
111
114
  const serverDocumentData = {
112
115
  headNodes: [
113
116
  ...(options?.metadata?.headNodes ?? []),
117
+ faviconNode,
114
118
  getStyleElement({ key: 'rnw-style-element' }),
115
119
  ...(headCssNodes ?? []),
116
120
  ...(inlineCssNodes ?? []),
117
- ],
121
+ ].filter(Boolean),
118
122
  bodyNodes: [(0, jsx_runtime_1.jsx)(FontResources, {}, "font-resources")],
119
123
  };
120
124
  return await server_2.default.renderToReadableStream((0, jsx_runtime_1.jsx)(server_1.ServerDocument, { data: serverDocumentData, children: (0, jsx_runtime_1.jsx)(head_1.default.Provider, { context: headContext, children: (0, jsx_runtime_1.jsx)(static_1.InnerRoot, { loadedData: loadedData, children: element }) }) }), {
@@ -1 +1 @@
1
- {"version":3,"file":"renderStreamingContent.js","sourceRoot":"","sources":["../../src/server/renderStreamingContent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,kDA6CC;;AA/JD;;;;;GAKG;AACH,kEAAkE;AAClE,gCAAgC;AAEhC,6DAA+C;AAC/C,6CAAuC;AACvC,2CAAuC;AACvC,4DAAoC;AACpC,wDAA6D;AAC7D,wDAAqF;AAErF,8DAA8C;AAE9C,iEAA8D;AAC9D,0CAA6C;AAC7C,0CAKwB;AAExB,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,2CAA2C,CAAC,CAAC;AAEvE,SAAS,4BAA4B;IACnC,iDAAiD;IACjD,0JAA0J;IAE1J,8FAA8F;IAC9F,yJAAyJ;IACzJ,MAAM,QAAQ,GAAG,uCAAuC,CAAC;IACxD,UAAkB,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,EAA8B,CAAC;AACxE,CAAC;AAyBD;;;GAGG;AACH,SAAS,oBAAoB,CAAC,QAAa,EAAE,OAAoC;IAC/E,MAAM,WAAW,GAAqB,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,IAAA,mCAAgB,GAAE,CAAC;IAEhC,MAAM;IACJ,+DAA+D;IAC/D,kDAAkD;IAClD,OAAO,EACP,eAAe,GAChB,GAAG,IAAA,oCAA2B,EAAC,sBAAQ,EAAE;QACx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AAE,SAAS,EAAE,cAAc,EAAE,GAAG,IAAA,sCAA8B,EAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAEjG,MAAM,kBAAkB,GAAG;QACzB,SAAS,EAAE;YACT,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,IAAI,EAAE,CAAC;YACvC,eAAe,CAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC;YAC7C,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;YACvB,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;SAC1B;QACD,SAAS,EAAE,CAAC,uBAAC,aAAa,MAAK,gBAAgB,CAAG,CAAC;KACpD,CAAC;IAEF,OAAO,MAAM,gBAAc,CAAC,sBAAsB,CAChD,uBAAC,uBAAc,IAAC,IAAI,EAAE,kBAAkB,YAEtC,uBAAC,cAAI,CAAC,QAAQ,IAAC,OAAO,EAAE,WAAW,YACjC,uBAAC,kBAAS,IAAC,UAAU,EAAE,UAAU,YAAG,OAAO,GAAa,GAC1C,GACD,EACjB;QACE,6EAA6E;QAC7E,8EAA8E;QAC9E,oBAAoB,EAAE,KAAK,GAAG,CAAC;QAC/B,sBAAsB,EAAE,IAAA,4BAAoB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAC3E,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;QAChC,OAAO,CAAC,KAAK;YACX,IAAI,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;gBACrC,OAAO;YACT,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;KACF,CACF,CAAC;AACJ,CAAC;AAED,uCAA6C;AAApC,2GAAA,eAAe,OAAA","sourcesContent":["/**\n * Copyright © 2026 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// NOTE(@hassankhan): disable when this file is its own entrypoint\n// import '@expo/metro-runtime';\n\nimport * as Font from 'expo-font/build/server';\nimport { ExpoRoot } from 'expo-router';\nimport { ctx } from 'expo-router/_ctx';\nimport Head from 'expo-router/head';\nimport { ServerDocument } from 'expo-router/internal/server';\nimport { InnerRoot, registerStaticRootComponent } from 'expo-router/internal/static';\nimport React, { ReactNode } from 'react';\nimport ReactDOMServer from 'react-dom/server';\n\nimport { getRootComponent } from '../static/getRootComponent';\nimport { createDebug } from '../utils/debug';\nimport {\n createInjectedCssAsNodes,\n createInjectedFontsAsNodes,\n createInjectedInlineCssAsNodes,\n getBootstrapContents,\n} from '../utils/react';\n\nconst debug = createDebug('expo:router:server:renderStreamingContent');\n\nfunction resetReactNavigationContexts() {\n // https://github.com/expo/router/discussions/588\n // https://github.com/react-navigation/react-navigation/blob/9fe34b445fcb86e5666f61e144007d7540f014fa/packages/elements/src/getNamedContext.tsx#LL3C1-L4C1\n\n // React Navigation is storing providers in a global, this is fine for the first static render\n // but subsequent static renders of Stack or Tabs will cause React to throw a warning. To prevent this warning, we'll reset the globals before rendering.\n const contexts = '__react_navigation__elements_contexts';\n (globalThis as any)[contexts] = new Map<string, React.Context<any>>();\n}\n\n// NOTE(@hassankhan): Keep in sync with `expo-server/src/manifest.ts`\nexport type GetStreamingContentOptions = {\n loader?: {\n data?: any;\n /** Unique key for the route. Derived from the route's contextKey */\n key: string;\n };\n metadata?: {\n headNodes: ReactNode[];\n } | null;\n request?: Request;\n /** Assets for hydration bundles and development-only inline CSS. */\n assets?: {\n css: string[];\n /** CSS source to inline into the document head, used by development SSR. */\n inlineCss?: {\n source: string;\n hmrId?: string;\n }[];\n js: string[];\n };\n};\n\n/**\n * Shared setup for both `getStaticContent()` and `getStreamingContent()`. Creates the React element\n * tree, resets server contexts, and computes loader data.\n */\nfunction prepareRenderContext(location: URL, options?: GetStreamingContentOptions) {\n const headContext: { helmet?: any } = {};\n const Root = getRootComponent();\n\n const {\n // NOTE: The `element` that's returned adds two extra Views and\n // the seemingly unused `RootTagContext.Provider`.\n element,\n getStyleElement,\n } = registerStaticRootComponent(ExpoRoot, {\n location,\n context: ctx,\n wrapper: ({ children }: React.ComponentProps<any>) => (\n <Root>\n <div id=\"root\">{children}</div>\n </Root>\n ),\n });\n\n // Clear any existing static resources from the global scope to attempt to prevent leaking between pages.\n // This could break if pages are rendered in parallel or if fonts are loaded outside of the React tree\n Font.resetServerContext();\n\n // This MUST be run before `ReactDOMServer.renderToString` to prevent\n // \"Warning: Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.\"\n resetReactNavigationContexts();\n\n const loaderKey = options?.loader ? options.loader.key + location.search : null;\n\n const loadedData = loaderKey\n ? {\n [loaderKey]: options?.loader?.data ?? null,\n }\n : null;\n\n return { headContext, element, getStyleElement, loadedData };\n}\n\nfunction FontResources() {\n const descriptors = Font.getServerResourceDescriptors();\n debug(`Pushing fonts: (count: ${descriptors.length})`, descriptors);\n return createInjectedFontsAsNodes(descriptors);\n}\n\n/**\n * Streaming SSR renderer using `renderToReadableStream`. Returns a web `ReadableStream`\n * that emits the full HTML document with head injections applied.\n */\nexport async function getStreamingContent(\n location: URL,\n options?: GetStreamingContentOptions\n): Promise<ReadableStream<Uint8Array>> {\n const { headContext, element, getStyleElement, loadedData } = prepareRenderContext(\n location,\n options\n );\n\n const { headNodes: headCssNodes } = createInjectedCssAsNodes(options?.assets?.css ?? []);\n const { headNodes: inlineCssNodes } = createInjectedInlineCssAsNodes(options?.assets?.inlineCss);\n\n const serverDocumentData = {\n headNodes: [\n ...(options?.metadata?.headNodes ?? []),\n getStyleElement({ key: 'rnw-style-element' }),\n ...(headCssNodes ?? []),\n ...(inlineCssNodes ?? []),\n ],\n bodyNodes: [<FontResources key=\"font-resources\" />],\n };\n\n return await ReactDOMServer.renderToReadableStream(\n <ServerDocument data={serverDocumentData}>\n {/* TODO(@hassankhan): Remove `<Head.Provider>` when `unstable_useServerRendering` is stabilized */}\n <Head.Provider context={headContext}>\n <InnerRoot loadedData={loadedData}>{element}</InnerRoot>\n </Head.Provider>\n </ServerDocument>,\n {\n // TODO(@hassankhan): Experiment and see if we can calculate a better default\n // We're doubling the default here so non-JavaScript renders show some content\n progressiveChunkSize: 12800 * 2,\n bootstrapScriptContent: getBootstrapContents({ hydrate: true, loadedData }),\n bootstrapScripts: options?.assets?.js,\n signal: options?.request?.signal,\n onError(error) {\n if (options?.request?.signal.aborted) {\n return;\n }\n\n console.error('SSR streaming render error:', error);\n },\n }\n );\n}\n\nexport { resolveMetadata } from './metadata';\n"]}
1
+ {"version":3,"file":"renderStreamingContent.js","sourceRoot":"","sources":["../../src/server/renderStreamingContent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA,kDAiDC;;AAtKD;;;;;GAKG;AACH,kEAAkE;AAClE,gCAAgC;AAEhC,6DAA+C;AAC/C,6CAAuC;AACvC,2CAAuC;AACvC,4DAAoC;AACpC,wDAA6D;AAC7D,wDAAqF;AAErF,8DAA8C;AAE9C,iEAA8D;AAC9D,0CAA6C;AAC7C,0CAMwB;AAExB,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,2CAA2C,CAAC,CAAC;AAEvE,SAAS,4BAA4B;IACnC,iDAAiD;IACjD,0JAA0J;IAE1J,8FAA8F;IAC9F,yJAAyJ;IACzJ,MAAM,QAAQ,GAAG,uCAAuC,CAAC;IACxD,UAAkB,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,EAA8B,CAAC;AACxE,CAAC;AA2BD;;;GAGG;AACH,SAAS,oBAAoB,CAAC,QAAa,EAAE,OAAoC;IAC/E,MAAM,WAAW,GAAqB,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,IAAA,mCAAgB,GAAE,CAAC;IAEhC,MAAM;IACJ,+DAA+D;IAC/D,kDAAkD;IAClD,OAAO,EACP,eAAe,GAChB,GAAG,IAAA,oCAA2B,EAAC,s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OAAO;YACT,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;KACF,CACF,CAAC;AACJ,CAAC;AAED,uCAA6C;AAApC,2GAAA,eAAe,OAAA","sourcesContent":["/**\n * Copyright © 2026 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// NOTE(@hassankhan): disable when this file is its own entrypoint\n// import '@expo/metro-runtime';\n\nimport * as Font from 'expo-font/build/server';\nimport { ExpoRoot } from 'expo-router';\nimport { ctx } from 'expo-router/_ctx';\nimport Head from 'expo-router/head';\nimport { ServerDocument } from 'expo-router/internal/server';\nimport { InnerRoot, registerStaticRootComponent } from 'expo-router/internal/static';\nimport React, { ReactNode } from 'react';\nimport ReactDOMServer from 'react-dom/server';\n\nimport { getRootComponent } from '../static/getRootComponent';\nimport { createDebug } from '../utils/debug';\nimport {\n createFaviconAsNode,\n createInjectedCssAsNodes,\n createInjectedFontsAsNodes,\n createInjectedInlineCssAsNodes,\n getBootstrapContents,\n} from '../utils/react';\n\nconst debug = createDebug('expo:router:server:renderStreamingContent');\n\nfunction resetReactNavigationContexts() {\n // https://github.com/expo/router/discussions/588\n // https://github.com/react-navigation/react-navigation/blob/9fe34b445fcb86e5666f61e144007d7540f014fa/packages/elements/src/getNamedContext.tsx#LL3C1-L4C1\n\n // React Navigation is storing providers in a global, this is fine for the first static render\n // but subsequent static renders of Stack or Tabs will cause React to throw a warning. To prevent this warning, we'll reset the globals before rendering.\n const contexts = '__react_navigation__elements_contexts';\n (globalThis as any)[contexts] = new Map<string, React.Context<any>>();\n}\n\n// NOTE(@hassankhan): Keep in sync with `expo-server/src/manifest.ts`\nexport type GetStreamingContentOptions = {\n loader?: {\n data?: any;\n /** Unique key for the route. Derived from the route's contextKey */\n key: string;\n };\n metadata?: {\n headNodes: ReactNode[];\n } | null;\n request?: Request;\n /** Assets for hydration bundles and development-only inline CSS. */\n assets?: {\n css: string[];\n /** CSS source to inline into the document head, used by development SSR. */\n inlineCss?: {\n source: string;\n hmrId?: string;\n }[];\n js: string[];\n /** Public href of a favicon generated from `web.favicon` in the app config. */\n favicon?: string;\n };\n};\n\n/**\n * Shared setup for both `getStaticContent()` and `getStreamingContent()`. Creates the React element\n * tree, resets server contexts, and computes loader data.\n */\nfunction prepareRenderContext(location: URL, options?: GetStreamingContentOptions) {\n const headContext: { helmet?: any } = {};\n const Root = getRootComponent();\n\n const {\n // NOTE: The `element` that's returned adds two extra Views and\n // the seemingly unused `RootTagContext.Provider`.\n element,\n getStyleElement,\n } = registerStaticRootComponent(ExpoRoot, {\n location,\n context: ctx,\n wrapper: ({ children }: React.ComponentProps<any>) => (\n <Root>\n <div id=\"root\">{children}</div>\n </Root>\n ),\n });\n\n // Clear any existing static resources from the global scope to attempt to prevent leaking between pages.\n // This could break if pages are rendered in parallel or if fonts are loaded outside of the React tree\n Font.resetServerContext();\n\n // This MUST be run before `ReactDOMServer.renderToString` to prevent\n // \"Warning: Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.\"\n resetReactNavigationContexts();\n\n const loaderKey = options?.loader ? options.loader.key + location.search : null;\n\n const loadedData = loaderKey\n ? {\n [loaderKey]: options?.loader?.data ?? null,\n }\n : null;\n\n return { headContext, element, getStyleElement, loadedData };\n}\n\nfunction FontResources() {\n const descriptors = Font.getServerResourceDescriptors();\n debug(`Pushing fonts: (count: ${descriptors.length})`, descriptors);\n return createInjectedFontsAsNodes(descriptors);\n}\n\n/**\n * Streaming SSR renderer using `renderToReadableStream`. Returns a web `ReadableStream`\n * that emits the full HTML document with head injections applied.\n */\nexport async function getStreamingContent(\n location: URL,\n options?: GetStreamingContentOptions\n): Promise<ReadableStream<Uint8Array>> {\n const { headContext, element, getStyleElement, loadedData } = prepareRenderContext(\n location,\n options\n );\n\n const { headNodes: headCssNodes } = createInjectedCssAsNodes(options?.assets?.css ?? []);\n const { headNodes: inlineCssNodes } = createInjectedInlineCssAsNodes(options?.assets?.inlineCss);\n const faviconNode = options?.assets?.favicon\n ? createFaviconAsNode(options?.assets?.favicon)\n : undefined;\n\n const serverDocumentData = {\n headNodes: [\n ...(options?.metadata?.headNodes ?? []),\n faviconNode,\n getStyleElement({ key: 'rnw-style-element' }),\n ...(headCssNodes ?? []),\n ...(inlineCssNodes ?? []),\n ].filter(Boolean),\n bodyNodes: [<FontResources key=\"font-resources\" />],\n };\n\n return await ReactDOMServer.renderToReadableStream(\n <ServerDocument data={serverDocumentData}>\n {/* TODO(@hassankhan): Remove `<Head.Provider>` when `unstable_useServerRendering` is stabilized */}\n <Head.Provider context={headContext}>\n <InnerRoot loadedData={loadedData}>{element}</InnerRoot>\n </Head.Provider>\n </ServerDocument>,\n {\n // TODO(@hassankhan): Experiment and see if we can calculate a better default\n // We're doubling the default here so non-JavaScript renders show some content\n progressiveChunkSize: 12800 * 2,\n bootstrapScriptContent: getBootstrapContents({ hydrate: true, loadedData }),\n bootstrapScripts: options?.assets?.js,\n signal: options?.request?.signal,\n onError(error) {\n if (options?.request?.signal.aborted) {\n return;\n }\n\n console.error('SSR streaming render error:', error);\n },\n }\n );\n}\n\nexport { resolveMetadata } from './metadata';\n"]}
@@ -14,6 +14,7 @@ export declare function getBootstrapContents({ hydrate, loadedData, }: {
14
14
  hydrate: boolean;
15
15
  loadedData: Record<string, unknown> | null;
16
16
  }): string;
17
+ export declare function createFaviconAsNode(href: string): ReactNode;
17
18
  export declare function createInjectedFontsAsNodes(descriptors: ServerFontResourceDescriptor[]): ReactNode[];
18
19
  export {};
19
20
  //# sourceMappingURL=react.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/utils/react.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,KAAK,gBAAgB,GAAG;IACtB,SAAS,CAAC,EAAE,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wBAAgB,oBAAoB,CAAC,EACnC,OAAc,EACd,UAAU,GACX,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5C,GAAG,MAAM,CAYT;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAE3D;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,4BAA4B,EAAE,GAC1C,SAAS,EAAE,CAyBb"}
@@ -4,6 +4,7 @@ exports.createInjectedCssAsNodes = createInjectedCssAsNodes;
4
4
  exports.createInjectedInlineCssAsNodes = createInjectedInlineCssAsNodes;
5
5
  exports.createInjectedScriptAsNodes = createInjectedScriptAsNodes;
6
6
  exports.getBootstrapContents = getBootstrapContents;
7
+ exports.createFaviconAsNode = createFaviconAsNode;
7
8
  exports.createInjectedFontsAsNodes = createInjectedFontsAsNodes;
8
9
  const jsx_runtime_1 = require("react/jsx-runtime");
9
10
  const html_1 = require("./html");
@@ -36,6 +37,9 @@ function getBootstrapContents({ hydrate = true, loadedData, }) {
36
37
  }
37
38
  return parts.join('\n');
38
39
  }
40
+ function createFaviconAsNode(href) {
41
+ return (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: href }, "favicon");
42
+ }
39
43
  function createInjectedFontsAsNodes(descriptors) {
40
44
  return descriptors.map((descriptor) => {
41
45
  switch (descriptor.type) {
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/utils/react.tsx"],"names":[],"mappings":";;AAUA,4DAOC;AAED,wEAYC;AAED,kEAOC;AAED,oDAkBC;AAED,gEA2BC;;AAtFD,iCAAqF;AAOrF,SAAgB,wBAAwB,CAAC,KAAe;IACtD,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACjC,iCAAkC,GAAG,EAAC,SAAS,EAAC,IAAI,EAAE,IAAI,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kCAA2B,EAAC,UAAU,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAgB,0BAA0B,CACxC,WAA2C;IAE3C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;QACpC,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;YACxB,KAAK,OAAO;gBACV,OAAO,CACL,kCAEE,EAAE,EAAE,UAAU,CAAC,EAAE,EACjB,uBAAuB,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,IAF9C,cAAc,UAAU,CAAC,EAAE,EAAE,CAGlC,CACH,CAAC;YACJ,KAAK,MAAM;gBACT,OAAO,CACL,iCAEE,GAAG,EAAE,UAAU,CAAC,GAAG,EACnB,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,EAAE,EAAE,UAAU,CAAC,EAAE,EACjB,WAAW,EAAE,UAAU,CAAC,WAAW,IAJ9B,aAAa,UAAU,CAAC,IAAI,EAAE,CAKnC,CACH,CAAC;YACJ;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ServerFontResourceDescriptor } from 'expo-font';\nimport { type ReactNode } from 'react';\n\nimport { getHydrationFlagScriptContents, getLoaderDataScriptContents } from './html';\n\ntype CreateNodeResult = {\n headNodes?: ReactNode[];\n bodyNodes?: ReactNode[];\n};\n\nexport function createInjectedCssAsNodes(hrefs: string[]): CreateNodeResult {\n return {\n headNodes: hrefs.flatMap((href) => [\n <link key={`css-preload-${href}`} rel=\"preload\" href={href} as=\"style\" />,\n <link key={`css-stylesheet-${href}`} rel=\"stylesheet\" href={href} />,\n ]),\n };\n}\n\nexport function createInjectedInlineCssAsNodes(\n inlineCss: { source: string; hmrId?: string }[] = []\n): CreateNodeResult {\n return {\n headNodes: inlineCss.map(({ source, hmrId }, index) => (\n <style\n key={hmrId ? `inline-css-${hmrId}` : `inline-css-${index}`}\n data-expo-css-hmr={hmrId}\n dangerouslySetInnerHTML={{ __html: source }}\n />\n )),\n };\n}\n\nexport function createInjectedScriptAsNodes(srcs: string[]): CreateNodeResult {\n return {\n headNodes: srcs.map((src) => (\n <link key={`script-preload-${src}`} rel=\"preload\" href={src} as=\"script\" />\n )),\n bodyNodes: srcs.map((src) => <script key={`script-src-${src}`} defer src={src} />),\n };\n}\n\nexport function getBootstrapContents({\n hydrate = true,\n loadedData,\n}: {\n hydrate: boolean;\n loadedData: Record<string, unknown> | null;\n}): string {\n const parts = [];\n\n if (hydrate) {\n parts.push(getHydrationFlagScriptContents());\n }\n\n if (loadedData) {\n parts.push(getLoaderDataScriptContents(loadedData));\n }\n\n return parts.join('\\n');\n}\n\nexport function createInjectedFontsAsNodes(\n descriptors: ServerFontResourceDescriptor[]\n): ReactNode[] {\n return descriptors.map((descriptor) => {\n switch (descriptor.type) {\n case 'style':\n return (\n <style\n key={`font-style-${descriptor.id}`}\n id={descriptor.id}\n dangerouslySetInnerHTML={{ __html: descriptor.css }}\n />\n );\n case 'link':\n return (\n <link\n key={`font-link-${descriptor.href}`}\n rel={descriptor.rel}\n href={descriptor.href}\n as={descriptor.as}\n crossOrigin={descriptor.crossOrigin}\n />\n );\n default:\n return null;\n }\n });\n}\n"]}
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/utils/react.tsx"],"names":[],"mappings":";;AAUA,4DAOC;AAED,wEAYC;AAED,kEAOC;AAED,oDAkBC;AAED,kDAEC;AAED,gEA2BC;;AA1FD,iCAAqF;AAOrF,SAAgB,wBAAwB,CAAC,KAAe;IACtD,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACjC,iCAAkC,GAAG,EAAC,SAAS,EAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAC,OAAO,IAA3D,eAAe,IAAI,EAAE,CAAyC;YACzE,iCAAq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AAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,OAAO,iCAAoB,GAAG,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,IAA/B,SAAS,CAA0B,CAAC;AACvD,CAAC;AAED,SAAgB,0BAA0B,CACxC,WAA2C;IAE3C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;QACpC,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;YACxB,KAAK,OAAO;gBACV,OAAO,CACL,kCAEE,EAAE,EAAE,UAAU,CAAC,EAAE,EACjB,uBAAuB,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,IAF9C,cAAc,UAAU,CAAC,EAAE,EAAE,CAGlC,CACH,CAAC;YACJ,KAAK,MAAM;gBACT,OAAO,CACL,iCAEE,GAAG,EAAE,UAAU,CAAC,GAAG,EACnB,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,EAAE,EAAE,UAAU,CAAC,EAAE,EACjB,WAAW,EAAE,UAAU,CAAC,WAAW,IAJ9B,aAAa,UAAU,CAAC,IAAI,EAAE,CAKnC,CACH,CAAC;YACJ;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ServerFontResourceDescriptor } from 'expo-font';\nimport { type ReactNode } from 'react';\n\nimport { getHydrationFlagScriptContents, getLoaderDataScriptContents } from './html';\n\ntype CreateNodeResult = {\n headNodes?: ReactNode[];\n bodyNodes?: ReactNode[];\n};\n\nexport function createInjectedCssAsNodes(hrefs: string[]): CreateNodeResult {\n return {\n headNodes: hrefs.flatMap((href) => [\n <link key={`css-preload-${href}`} rel=\"preload\" href={href} as=\"style\" />,\n <link key={`css-stylesheet-${href}`} rel=\"stylesheet\" href={href} />,\n ]),\n };\n}\n\nexport function createInjectedInlineCssAsNodes(\n inlineCss: { source: string; hmrId?: string }[] = []\n): CreateNodeResult {\n return {\n headNodes: inlineCss.map(({ source, hmrId }, index) => (\n <style\n key={hmrId ? `inline-css-${hmrId}` : `inline-css-${index}`}\n data-expo-css-hmr={hmrId}\n dangerouslySetInnerHTML={{ __html: source }}\n />\n )),\n };\n}\n\nexport function createInjectedScriptAsNodes(srcs: string[]): CreateNodeResult {\n return {\n headNodes: srcs.map((src) => (\n <link key={`script-preload-${src}`} rel=\"preload\" href={src} as=\"script\" />\n )),\n bodyNodes: srcs.map((src) => <script key={`script-src-${src}`} defer src={src} />),\n };\n}\n\nexport function getBootstrapContents({\n hydrate = true,\n loadedData,\n}: {\n hydrate: boolean;\n loadedData: Record<string, unknown> | null;\n}): string {\n const parts = [];\n\n if (hydrate) {\n parts.push(getHydrationFlagScriptContents());\n }\n\n if (loadedData) {\n parts.push(getLoaderDataScriptContents(loadedData));\n }\n\n return parts.join('\\n');\n}\n\nexport function createFaviconAsNode(href: string): ReactNode {\n return <link key=\"favicon\" rel=\"icon\" href={href} />;\n}\n\nexport function createInjectedFontsAsNodes(\n descriptors: ServerFontResourceDescriptor[]\n): ReactNode[] {\n return descriptors.map((descriptor) => {\n switch (descriptor.type) {\n case 'style':\n return (\n <style\n key={`font-style-${descriptor.id}`}\n id={descriptor.id}\n dangerouslySetInnerHTML={{ __html: descriptor.css }}\n />\n );\n case 'link':\n return (\n <link\n key={`font-link-${descriptor.href}`}\n rel={descriptor.rel}\n href={descriptor.href}\n as={descriptor.as}\n crossOrigin={descriptor.crossOrigin}\n />\n );\n default:\n return null;\n }\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/router-server",
3
- "version": "56.0.12",
3
+ "version": "56.0.13",
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",
@@ -24,12 +24,12 @@
24
24
  "expo"
25
25
  ],
26
26
  "peerDependencies": {
27
- "@expo/metro-runtime": "^56.0.13",
27
+ "@expo/metro-runtime": "^56.0.14",
28
28
  "expo": "*",
29
- "expo-constants": "^56.0.16",
29
+ "expo-constants": "^56.0.17",
30
30
  "expo-font": "^56.0.5",
31
31
  "expo-router": "*",
32
- "expo-server": "^56.0.4",
32
+ "expo-server": "^56.0.5",
33
33
  "react": "*",
34
34
  "react-dom": "*",
35
35
  "react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1"
@@ -59,8 +59,8 @@
59
59
  "react-server-dom-webpack": "~19.0.6",
60
60
  "tsd": "^0.33.0",
61
61
  "tsd-lite": "^0.9.0",
62
- "expo": "56.0.5",
63
- "expo-router": "56.2.7"
62
+ "expo": "56.0.9",
63
+ "expo-router": "56.2.9"
64
64
  },
65
65
  "dependencies": {
66
66
  "debug": "^4.3.4"
@@ -68,7 +68,7 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "f67a101bcbe56114e982184834b93da7bbed00af",
71
+ "gitHead": "175f1e78e3444ca99ddea473faea6777a0656668",
72
72
  "scripts": {
73
73
  "build": "expo-module build",
74
74
  "clean": "expo-module clean",