| self.__BUILD_MANIFEST = { | ||
| "__rewrites": { | ||
| "afterFiles": [], | ||
| "beforeFiles": [], | ||
| "fallback": [] | ||
| }, | ||
| "sortedPages": [ | ||
| "/_app", | ||
| "/_error" | ||
| ] | ||
| };self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() |
| self.__MIDDLEWARE_MATCHERS = [];self.__MIDDLEWARE_MATCHERS_CB && self.__MIDDLEWARE_MATCHERS_CB() |
| self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() |
@@ -138,3 +138,3 @@ "use strict"; | ||
| }({}); | ||
| const nextVersion = "16.3.0-canary.66"; | ||
| const nextVersion = "16.3.0-canary.67"; | ||
| const ArchName = (0, _os.arch)(); | ||
@@ -141,0 +141,0 @@ const PlatformName = (0, _os.platform)(); |
@@ -96,3 +96,3 @@ "use strict"; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.0-canary.66" | ||
| nextVersion: "16.3.0-canary.67" | ||
| }, { | ||
@@ -99,0 +99,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -118,3 +118,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.0-canary.66" | ||
| nextVersion: "16.3.0-canary.67" | ||
| }; | ||
@@ -121,0 +121,0 @@ const sharedTurboOptions = { |
@@ -6,5 +6,5 @@ 1:"$Sreact.fragment" | ||
| 7:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"34jwQGuQGguC4rW34JeSw"} | ||
| 4:{} | ||
| 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" | ||
| 8:null |
@@ -12,3 +12,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"34jwQGuQGguC4rW34JeSw"} | ||
| 6:{} | ||
@@ -15,0 +15,0 @@ 7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| 4:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"34jwQGuQGguC4rW34JeSw"} |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"34jwQGuQGguC4rW34JeSw"} |
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"34jwQGuQGguC4rW34JeSw"} |
@@ -10,2 +10,2 @@ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0i88bcw_h0tc6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0d4ot_2.1nmew.js"/><script src="/_next/static/chunks/14rcihda6~d~-.js" async=""></script><script src="/_next/static/chunks/0co-gl6-7li6g.js" async=""></script><script src="/_next/static/chunks/turbopack-0gxze4efaysqx.js" async=""></script><script src="/_next/static/chunks/0fef2ar.1bdz..js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Next.js Bundle Analyzer</title><meta name="description" content="Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"/><script> | ||
| })(); | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"gvgGK9YNB3OVevFmOdjbV\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"34jwQGuQGguC4rW34JeSw\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> |
@@ -10,3 +10,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"34jwQGuQGguC4rW34JeSw"} | ||
| d:[] | ||
@@ -13,0 +13,0 @@ 7:"$Wd" |
@@ -10,3 +10,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"34jwQGuQGguC4rW34JeSw"} | ||
| d:[] | ||
@@ -13,0 +13,0 @@ 7:"$Wd" |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| 4:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Next.js Bundle Analyzer"}],["$","meta","1",{"name":"description","content":"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"34jwQGuQGguC4rW34JeSw"} |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"34jwQGuQGguC4rW34JeSw"} |
| 1:"$Sreact.fragment" | ||
| 2:I[94039,["/_next/static/chunks/0fef2ar.1bdz..js"],"OutletBoundary"] | ||
| 3:"$Sreact.suspense" | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"34jwQGuQGguC4rW34JeSw"} | ||
| 4:null |
@@ -5,2 +5,2 @@ 1:"$Sreact.fragment" | ||
| 4:[] | ||
| 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"34jwQGuQGguC4rW34JeSw"} |
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"/_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"/_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"34jwQGuQGguC4rW34JeSw"} |
@@ -10,2 +10,2 @@ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0i88bcw_h0tc6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0d4ot_2.1nmew.js"/><script src="/_next/static/chunks/14rcihda6~d~-.js" async=""></script><script src="/_next/static/chunks/0co-gl6-7li6g.js" async=""></script><script src="/_next/static/chunks/turbopack-0gxze4efaysqx.js" async=""></script><script src="/_next/static/chunks/0fef2ar.1bdz..js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Next.js Bundle Analyzer</title><meta name="description" content="Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"/><script> | ||
| })(); | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"gvgGK9YNB3OVevFmOdjbV\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\na:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nc:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"34jwQGuQGguC4rW34JeSw\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> |
@@ -10,2 +10,2 @@ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0i88bcw_h0tc6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0d4ot_2.1nmew.js"/><script src="/_next/static/chunks/14rcihda6~d~-.js" async=""></script><script src="/_next/static/chunks/0co-gl6-7li6g.js" async=""></script><script src="/_next/static/chunks/turbopack-0gxze4efaysqx.js" async=""></script><script src="/_next/static/chunks/0fef2ar.1bdz..js" async=""></script><script src="/_next/static/chunks/0xl2dc951qps8.js" async=""></script><title>Next.js Bundle Analyzer</title><meta name="description" content="Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis"/><script> | ||
| })(); | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><main class="h-screen flex flex-col bg-background"><div class="flex-none px-4 py-2 border-b border-border flex items-center gap-3"><div class="flex-1 flex"><div class="flex items-center gap-2 min-w-64 max-w-full"><button class="inline-flex items-center gap-2 whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 flex-grow-1 w-full justify-between font-mono text-sm" role="combobox" aria-expanded="false" disabled="" type="button" aria-haspopup="dialog" aria-controls="radix-_R_lbtb_" data-state="closed"><div class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader mr-2 inline animate-spin" aria-hidden="true"><path d="M12 2v4"></path><path d="m16.2 7.8 2.9-2.9"></path><path d="M18 12h4"></path><path d="m16.2 16.2 2.9 2.9"></path><path d="M12 18v4"></path><path d="m4.9 19.1 2.9-2.9"></path><path d="M2 12h4"></path><path d="m4.9 4.9 2.9 2.9"></path></svg>Loading routes...</div><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-up-down h-4 w-4 shrink-0 opacity-50" aria-hidden="true"><path d="m7 15 5 5 5-5"></path><path d="m7 9 5-5 5 5"></path></svg></div></button></div></div><div class="flex items-center gap-2"></div></div><div class="flex-1 flex min-h-0"><div class="flex-1 min-w-0 p-4 bg-background"><div class="h-full w-full grid grid-cols-12 grid-rows-8 gap-2"><div class="animate-pulse rounded-md bg-muted col-span-5 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-1"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div></div></div><button type="button" class="flex-none w-1 bg-border cursor-col-resize transition-colors" disabled="" aria-label="Resize sidebar"></button><div class="flex-none bg-muted border-l border-border overflow-y-auto" style="width:20%"><div class="flex-1 p-3 space-y-4 overflow-y-auto"><div class="animate-pulse rounded-md bg-muted h-4 w-3/4"></div><div class="animate-pulse rounded-md bg-muted h-4 w-full"></div><div class="animate-pulse rounded-md bg-muted h-4 w-5/6"></div><div class="mt-4 space-y-2"><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-4/5"></div></div></div></div></div></main><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[25399,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/0fef2ar.1bdz..js\",\"/_next/static/chunks/0xl2dc951qps8.js\"],\"default\"]\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\nd:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nf:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0xl2dc951qps8.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Le\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"gvgGK9YNB3OVevFmOdjbV\"}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"a:null\ne:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> | ||
| </script><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><main class="h-screen flex flex-col bg-background"><div class="flex-none px-4 py-2 border-b border-border flex items-center gap-3"><div class="flex-1 flex"><div class="flex items-center gap-2 min-w-64 max-w-full"><button class="inline-flex items-center gap-2 whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 flex-grow-1 w-full justify-between font-mono text-sm" role="combobox" aria-expanded="false" disabled="" type="button" aria-haspopup="dialog" aria-controls="radix-_R_lbtb_" data-state="closed"><div class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader mr-2 inline animate-spin" aria-hidden="true"><path d="M12 2v4"></path><path d="m16.2 7.8 2.9-2.9"></path><path d="M18 12h4"></path><path d="m16.2 16.2 2.9 2.9"></path><path d="M12 18v4"></path><path d="m4.9 19.1 2.9-2.9"></path><path d="M2 12h4"></path><path d="m4.9 4.9 2.9 2.9"></path></svg>Loading routes...</div><div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-up-down h-4 w-4 shrink-0 opacity-50" aria-hidden="true"><path d="m7 15 5 5 5-5"></path><path d="m7 9 5-5 5 5"></path></svg></div></button></div></div><div class="flex items-center gap-2"></div></div><div class="flex-1 flex min-h-0"><div class="flex-1 min-w-0 p-4 bg-background"><div class="h-full w-full grid grid-cols-12 grid-rows-8 gap-2"><div class="animate-pulse rounded-md bg-muted col-span-5 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-3"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-1"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-4"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-4 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-2 row-span-2"></div><div class="animate-pulse rounded-md bg-muted col-span-3 row-span-2"></div></div></div><button type="button" class="flex-none w-1 bg-border cursor-col-resize transition-colors" disabled="" aria-label="Resize sidebar"></button><div class="flex-none bg-muted border-l border-border overflow-y-auto" style="width:20%"><div class="flex-1 p-3 space-y-4 overflow-y-auto"><div class="animate-pulse rounded-md bg-muted h-4 w-3/4"></div><div class="animate-pulse rounded-md bg-muted h-4 w-full"></div><div class="animate-pulse rounded-md bg-muted h-4 w-5/6"></div><div class="mt-4 space-y-2"><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-full"></div><div class="animate-pulse rounded-md bg-muted h-3 w-4/5"></div></div></div></div></div></main><!--$--><!--/$--><script src="/_next/static/chunks/0d4ot_2.1nmew.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[85561,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n3:I[39293,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\"]\n4:I[25399,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ClientPageRoot\"]\n5:I[79331,[\"/_next/static/chunks/0fef2ar.1bdz..js\",\"/_next/static/chunks/0xl2dc951qps8.js\"],\"default\"]\n8:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"ViewportBoundary\"]\nd:I[94039,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"MetadataBoundary\"]\nf:I[39586,[\"/_next/static/chunks/0fef2ar.1bdz..js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0fef2ar.1bdz..js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\\n document.documentElement.classList.toggle('dark', theme === 'dark');\\n\\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) =\u003e {\\n document.documentElement.classList.toggle('dark', e.matches);\\n });\\n })();\\n \"}}]}],[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0xl2dc951qps8.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Le\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0i88bcw_h0tc6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"34jwQGuQGguC4rW34JeSw\"}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"a:null\ne:[[\"$\",\"title\",\"0\",{\"children\":\"Next.js Bundle Analyzer\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis\"}]]\n"])</script></body></html> |
@@ -12,3 +12,3 @@ 1:"$Sreact.fragment" | ||
| :HL["/_next/static/chunks/0i88bcw_h0tc6.css","style"] | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"gvgGK9YNB3OVevFmOdjbV"} | ||
| 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0fef2ar.1bdz..js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n document.documentElement.classList.toggle('dark', theme === 'dark');\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {\n document.documentElement.classList.toggle('dark', e.matches);\n });\n })();\n "}}]}],["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0xl2dc951qps8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0i88bcw_h0tc6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"34jwQGuQGguC4rW34JeSw"} | ||
| 6:{} | ||
@@ -15,0 +15,0 @@ 7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" |
@@ -42,3 +42,3 @@ #!/usr/bin/env node | ||
| const nextBuild = async (options, directory)=>{ | ||
| process.title = `next-build (v${"16.3.0-canary.66"})`; | ||
| process.title = `next-build (v${"16.3.0-canary.67"})`; | ||
| process.on('SIGTERM', ()=>{ | ||
@@ -45,0 +45,0 @@ (0, _cpuprofile.saveCpuProfile)(); |
@@ -43,3 +43,3 @@ #!/usr/bin/env node | ||
| const bindings = await (0, _swc.loadBindings)((_config_experimental1 = config.experimental) == null ? void 0 : _config_experimental1.useWasmBinary); | ||
| await bindings.turbo.databaseCompact(cachePath, "16.3.0-canary.66"); | ||
| await bindings.turbo.databaseCompact(cachePath, "16.3.0-canary.67"); | ||
| console.log('Turbopack database compaction complete.'); | ||
@@ -46,0 +46,0 @@ }; |
@@ -18,3 +18,3 @@ /** | ||
| const _setattributesfromprops = require("./set-attributes-from-props"); | ||
| const version = "16.3.0-canary.66"; | ||
| const version = "16.3.0-canary.67"; | ||
| window.next = { | ||
@@ -21,0 +21,0 @@ version, |
@@ -135,4 +135,8 @@ "use strict"; | ||
| // aren't flooded with warnings the moment they enable Cache Components. | ||
| // | ||
| // The warning is suppressed if any segment on the target route exports | ||
| // `instant = false`, which is the explicit API for opting a route out of | ||
| // this validation. | ||
| const link = (0, _links.getLinkForCurrentNavigation)(); | ||
| if (link !== null && link.fetchStrategy === _types.FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & _approutertypes.PrefetchHint.SubtreeHasPartialPrefetching) === 0) { | ||
| if (link !== null && link.fetchStrategy === _types.FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & (_approutertypes.PrefetchHint.SubtreeHasPartialPrefetching | _approutertypes.PrefetchHint.SubtreeHasInstantFalse)) === 0) { | ||
| const error = (0, _instantmessages.createLinkPrefetchPartialError)(url.pathname); | ||
@@ -139,0 +143,0 @@ const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // static shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n PrefetchHint.SubtreeHasPartialPrefetching) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n await new Promise<void>((resolve) => {\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n resolve // _onComplete callback\n )\n })\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["completeHardNavigation","completeSoftNavigation","completeTraverseNavigation","convertServerPatchToFullTree","navigate","navigateToKnownRoute","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","getCurrentNavigationLock","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","createCacheKey","route","readRouteCacheEntry","status","EntryStatus","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","deprecated_requestOptimisticRouteCacheEntry","navigateToUnknownRoute","catch","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","getLinkForCurrentNavigation","fetchStrategy","FetchStrategy","Full","routeTree","prefetchHints","PrefetchHint","SubtreeHasPartialPrefetching","error","createLinkPrefetchPartialError","pathname","ownerStack","undefined","console","stack","name","message","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","startPPRNavigation","metadataVaryPath","data","head","dynamicStaleAt","FreshnessPolicy","Gesture","spawnDynamicRequests","node","renderedSearch","tree","hash","prefetchSeed","metadata","varyPath","computeDynamicStaleAt","UnknownDynamicStaleTime","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","fetchServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","discoverKnownRoute","search","createHrefFromUrl","response","staticStageResponse","isResponsePartial","getStaleAt","s","then","staleAt","buildId","get","NEXT_NAV_DEPLOYMENT_ID_HEADER","b","writePrerenderResponseIntoCache","PPR","f","h","r","processRuntimePrefetchStream","processed","writeDynamicRenderResponseIntoCache","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","isJavaScriptURLString","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","computeChangedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","ScrollBehavior","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","convertRootFlightRouterStateToRouteTree","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","SubtreePrefetchHints","childHints","propagateSubtreeBits","isEmptySeedDataPartial","Promise","resolve","schedulePrefetchTask","PrefetchPriority","updateCapturedSPAToTree"],"mappings":";;;;;;;;;;;;;;;;;;;IAwmBgBA,sBAAsB;eAAtBA;;IAmCAC,sBAAsB;eAAtBA;;IA0IAC,0BAA0B;eAA1BA;;IA4CAC,4BAA4B;eAA5BA;;IAvwBAC,QAAQ;eAARA;;IA4JAC,oBAAoB;eAApBA;;;gCA1MT;qCAE6B;gCAQ7B;mCAC2B;2BACY;uBAYvC;kCAC4B;0BACmB;2BACjB;uBACW;uBACJ;oCAGb;oCACI;+BACG;yBACyB;iCAChB;AAUxC,SAASD,SACdE,KAAqB,EACrBC,GAAQ,EACRC,UAAe,EACfC,qBAA6B,EAC7BC,gBAAkC,EAClCC,wBAA2C,EAC3CC,OAAsB,EACtBC,eAAgC,EAChCC,cAA8B,EAC9BC,YAAgC;IAEhC,IAAIC,iBAAiC;IAErC,oEAAoE;IACpE,0EAA0E;IAC1E,wEAAwE;IACxE,sEAAsE;IACtE,oEAAoE;IACpE,aAAa;IACb,IAAIC,QAAQC,GAAG,CAACC,yBAAyB,EAAE;QACzC,MAAM,EAAEC,kBAAkB,EAAE,GAC1BC,QAAQ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C,MAAMjG,SAAS,MAAM1E,aACnBlB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;IAGF,6EAA6E;IAC7E,+EAA+E;IAC/E,+CAA+C;IAC/C,IAAI,CAACkF,OAAOyC,OAAO,CAACE,aAAa,EAAE;QACjC,MAAM,EAAEyD,uBAAuB,EAAE,GAC/BjL,QAAQ;QACViL,wBAAwB3L,0BAA0BuF,OAAOjB,IAAI;IAC/D;IAEA,OAAOiB;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // static shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n //\n // The warning is suppressed if any segment on the target route exports\n // `instant = false`, which is the explicit API for opting a route out of\n // this validation.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n (PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasInstantFalse)) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n await new Promise<void>((resolve) => {\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n resolve // _onComplete callback\n )\n })\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["completeHardNavigation","completeSoftNavigation","completeTraverseNavigation","convertServerPatchToFullTree","navigate","navigateToKnownRoute","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","getCurrentNavigationLock","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","createCacheKey","route","readRouteCacheEntry","status","EntryStatus","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","deprecated_requestOptimisticRouteCacheEntry","navigateToUnknownRoute","catch","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","getLinkForCurrentNavigation","fetchStrategy","FetchStrategy","Full","routeTree","prefetchHints","PrefetchHint","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","error","createLinkPrefetchPartialError","pathname","ownerStack","undefined","console","stack","name","message","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","startPPRNavigation","metadataVaryPath","data","head","dynamicStaleAt","FreshnessPolicy","Gesture","spawnDynamicRequests","node","renderedSearch","tree","hash","prefetchSeed","metadata","varyPath","computeDynamicStaleAt","UnknownDynamicStaleTime","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","fetchServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","discoverKnownRoute","search","createHrefFromUrl","response","staticStageResponse","isResponsePartial","getStaleAt","s","then","staleAt","buildId","get","NEXT_NAV_DEPLOYMENT_ID_HEADER","b","writePrerenderResponseIntoCache","PPR","f","h","r","processRuntimePrefetchStream","processed","writeDynamicRenderResponseIntoCache","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","isJavaScriptURLString","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","computeChangedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","ScrollBehavior","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","convertRootFlightRouterStateToRouteTree","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","SubtreePrefetchHints","childHints","propagateSubtreeBits","isEmptySeedDataPartial","Promise","resolve","schedulePrefetchTask","PrefetchPriority","updateCapturedSPAToTree"],"mappings":";;;;;;;;;;;;;;;;;;;IA6mBgBA,sBAAsB;eAAtBA;;IAmCAC,sBAAsB;eAAtBA;;IA0IAC,0BAA0B;eAA1BA;;IA4CAC,4BAA4B;eAA5BA;;IA5wBAC,QAAQ;eAARA;;IA4JAC,oBAAoB;eAApBA;;;gCA1MT;qCAE6B;gCAQ7B;mCAC2B;2BACY;uBAYvC;kCAC4B;0BACmB;2BACjB;uBACW;uBACJ;oCAGb;oCACI;+BACG;yBACyB;iCAChB;AAUxC,SAASD,SACdE,KAAqB,EACrBC,GAAQ,EACRC,UAAe,EACfC,qBAA6B,EAC7BC,gBAAkC,EAClCC,wBAA2C,EAC3CC,OAAsB,EACtBC,eAAgC,EAChCC,cAA8B,EAC9BC,YAAgC;IAEhC,IAAIC,iBAAiC;IAErC,oEAAoE;I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oBAAa,CAAC2E,GAAG;IAE5E,MAAMlG,WAAWC,IAAAA,wBAAc,EAACtB,IAAIoB,IAAI,EAAEf;IAE1C,MAAM,IAAIuL,QAAc,CAACC;QACvBC,IAAAA,+BAAoB,EAClBzK,UACAjB,0BACAuC,eACAoJ,uBAAgB,CAAC3G,OAAO,EACxB,MACAyG,QAAQ,uBAAuB;;IAEnC;IAEA,uEAAuE;IACvE,wCAAwC;IACxC,MAAMjG,SAAS,MAAM3E,aACnBlB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;IAGF,6EAA6E;IAC7E,+EAA+E;IAC/E,+CAA+C;IAC/C,IAAI,CAACmF,OAAOyC,OAAO,CAACE,aAAa,EAAE;QACjC,MAAM,EAAEyD,uBAAuB,EAAE,GAC/BlL,QAAQ;QACVkL,wBAAwB5L,0BAA0BwF,OAAOjB,IAAI;IAC/D;IAEA,OAAOiB;AACT","ignoreList":[0]} |
@@ -63,3 +63,3 @@ /* global location */ // imports polyfill from `@next/polyfill-module` after build. | ||
| const _isnextroutererror = require("./components/is-next-router-error"); | ||
| const version = "16.3.0-canary.66"; | ||
| const version = "16.3.0-canary.67"; | ||
| let router; | ||
@@ -66,0 +66,0 @@ const emitter = (0, _mitt.default)(); |
@@ -21,10 +21,25 @@ --- | ||
| ## Use the adoption skill (recommended) | ||
| The [`next-cache-components-adoption`](https://github.com/vercel/next.js/tree/canary/skills/next-cache-components-adoption) skill drives this migration with a coding agent, one feature at a time, checking in at every feature boundary. It supports two modes: | ||
| - **Incremental.** Opens a single mechanical PR that opts every route out of validation, then ships each feature as a follow-up PR. | ||
| - **Direct.** Adopts every route in place on one branch. | ||
| Install the skill: | ||
| ```bash filename="Terminal" | ||
| npx skills add vercel/next.js --skill next-cache-components-adoption | ||
| ``` | ||
| Prompt the agent: | ||
| ```text | ||
| Adopt Cache Components in this project using the next-cache-components-adoption skill. | ||
| ``` | ||
| ## Or migrate by hand | ||
| Start by removing the route segment configs (`dynamic`, `revalidate`, `fetchCache`), then follow the validation insights and errors. Each one names the code to fix, most often uncached data to cache with [`use cache`](/docs/app/api-reference/directives/use-cache) or runtime data to wrap in [`<Suspense>`](https://react.dev/reference/react/Suspense). If a route needs more work than you want to take on right now, you can [opt it out of validation](#opting-out-of-validation) and come back to it later. | ||
| > **Good to know:** For agents working on larger apps, the [`next-cache-components-adoption`](https://github.com/vercel/next.js/tree/canary/skills/next-cache-components-adoption) skill drives this guide route by route. It can blanket-opt-out the app with `instant = false` to unblock the build, work each opt-out back off, help decide what becomes instant and what stays blocking, and walk the dev-overlay validation insights with you. Install with: | ||
| > | ||
| > ```bash filename="Terminal" | ||
| > npx skills add https://github.com/vercel/next.js/tree/canary/skills/next-cache-components-adoption | ||
| > ``` | ||
| Your existing `fetch` and `unstable_cache` caching keeps working as a separate layer, so let the insights and errors guide what to change. | ||
@@ -31,0 +46,0 @@ |
@@ -177,9 +177,11 @@ --- | ||
| // Load the font once at module scope. process.cwd() is the Next.js project | ||
| // directory. Reading it inside the component would be treated as dynamic I/O | ||
| // under Cache Components and opt the route out of static generation. | ||
| const interSemiBold = await readFile( | ||
| join(process.cwd(), 'assets/Inter-SemiBold.ttf') | ||
| ) | ||
| // Image generation | ||
| export default async function Image() { | ||
| // Font loading, process.cwd() is Next.js project directory | ||
| const interSemiBold = await readFile( | ||
| join(process.cwd(), 'assets/Inter-SemiBold.ttf') | ||
| ) | ||
| return new ImageResponse( | ||
@@ -186,0 +188,0 @@ ( |
@@ -50,5 +50,89 @@ --- | ||
| > - `next/root-params` can be used in Server Components. It cannot be used in Client Components, Server Actions, or [Route Handlers](/docs/app/api-reference/file-conventions/route). Support for Route Handlers is planned for a future release. | ||
| > - With [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents) enabled, [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params) must return at least one value for each root parameter. Providing values makes them static route parameters, required for prerendering static shells. | ||
| > - The examples on this page use [`PageProps`](/docs/app/api-reference/file-conventions/page#page-props-helper) and [`LayoutProps`](/docs/app/api-reference/file-conventions/layout#layout-props-helper), which are auto-generated type helpers based on your route structure. | ||
| > - Types for the `next/root-params` exports are generated during `next dev`, `next build`, or [`next typegen`](/docs/app/api-reference/cli/next#next-typegen-options), the same as [`PageProps` and `LayoutProps`](/docs/app/api-reference/config/typescript#route-aware-type-helpers). | ||
| ## Root parameters and `generateStaticParams` | ||
| Root parameters are available as soon as you create the routes that define them. A [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params) function is only required with [Cache Components](/docs/app/api-reference/config/next-config-js/cacheComponents), where each root parameter must have at least one value or the build fails. | ||
| With a single root parameter: | ||
| ```tsx filename="app/[lang]/layout.tsx" highlight={11,12,13} switcher | ||
| import { lang } from 'next/root-params' | ||
| export default async function RootLayout(props: LayoutProps<'/[lang]'>) { | ||
| return ( | ||
| <html lang={await lang()}> | ||
| <body>{props.children}</body> | ||
| </html> | ||
| ) | ||
| } | ||
| export async function generateStaticParams() { | ||
| return [{ lang: 'en' }, { lang: 'fr' }] | ||
| } | ||
| ``` | ||
| ```jsx filename="app/[lang]/layout.js" highlight={11,12,13} switcher | ||
| import { lang } from 'next/root-params' | ||
| export default async function RootLayout({ children }) { | ||
| return ( | ||
| <html lang={await lang()}> | ||
| <body>{children}</body> | ||
| </html> | ||
| ) | ||
| } | ||
| export async function generateStaticParams() { | ||
| return [{ lang: 'en' }, { lang: 'fr' }] | ||
| } | ||
| ``` | ||
| With multiple root parameters, return a value for each: | ||
| ```tsx filename="app/[lang]/[locale]/layout.tsx" | ||
| export async function generateStaticParams() { | ||
| return [ | ||
| { lang: 'en', locale: 'us' }, | ||
| { lang: 'en', locale: 'uk' }, | ||
| ] | ||
| } | ||
| ``` | ||
| ### Reading root parameters in a nested `generateStaticParams` | ||
| Inside a nested segment's [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params), you can read a root parameter directly with its getter, instead of destructuring it from the `params` argument: | ||
| ```tsx filename="app/[lang]/posts/[slug]/page.tsx" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ```jsx filename="app/[lang]/posts/[slug]/page.js" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ## Root parameters and other route parameters | ||
@@ -203,38 +287,2 @@ | ||
| ## Use in `generateStaticParams` for nested segments | ||
| Inside a nested segment's [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params), you can read a root parameter directly with its getter, instead of destructuring it from the `params` argument: | ||
| ```tsx filename="app/[lang]/posts/[slug]/page.tsx" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ```jsx filename="app/[lang]/posts/[slug]/page.js" highlight={1,4} switcher | ||
| import { lang } from 'next/root-params' | ||
| export async function generateStaticParams() { | ||
| const language = await lang() | ||
| const posts = await fetch( | ||
| `https://api.example.com/posts?lang=${language}` | ||
| ).then((res) => res.json()) | ||
| return posts.map((post) => ({ slug: post.slug })) | ||
| } | ||
| export default async function Page() { | ||
| // ... | ||
| } | ||
| ``` | ||
| ## Multiple root layouts | ||
@@ -241,0 +289,0 @@ |
@@ -14,3 +14,3 @@ import path from 'path'; | ||
| }({}); | ||
| const nextVersion = "16.3.0-canary.66"; | ||
| const nextVersion = "16.3.0-canary.67"; | ||
| const ArchName = arch(); | ||
@@ -17,0 +17,0 @@ const PlatformName = platform(); |
@@ -69,3 +69,3 @@ import path from 'path'; | ||
| isPersistentCachingEnabled: persistentCaching, | ||
| nextVersion: "16.3.0-canary.66" | ||
| nextVersion: "16.3.0-canary.67" | ||
| }, { | ||
@@ -72,0 +72,0 @@ turbopackMemoryEviction: config.experimental.turbopackMemoryEvictionMode, |
@@ -87,3 +87,3 @@ // Import cpu-profile first to start profiling early if enabled | ||
| deferredEntries: config.experimental.deferredEntries, | ||
| nextVersion: "16.3.0-canary.66" | ||
| nextVersion: "16.3.0-canary.67" | ||
| }; | ||
@@ -90,0 +90,0 @@ const sharedTurboOptions = { |
@@ -8,3 +8,3 @@ /** | ||
| import { setAttributesFromProps } from './set-attributes-from-props'; | ||
| const version = "16.3.0-canary.66"; | ||
| const version = "16.3.0-canary.67"; | ||
| window.next = { | ||
@@ -11,0 +11,0 @@ version, |
@@ -104,4 +104,8 @@ import { PrefetchHint, SubtreePrefetchHints, propagateSubtreeBits } from '../../../shared/lib/app-router-types'; | ||
| // aren't flooded with warnings the moment they enable Cache Components. | ||
| // | ||
| // The warning is suppressed if any segment on the target route exports | ||
| // `instant = false`, which is the explicit API for opting a route out of | ||
| // this validation. | ||
| const link = getLinkForCurrentNavigation(); | ||
| if (link !== null && link.fetchStrategy === FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & PrefetchHint.SubtreeHasPartialPrefetching) === 0) { | ||
| if (link !== null && link.fetchStrategy === FetchStrategy.Full && (navigationSeed.routeTree.prefetchHints & (PrefetchHint.SubtreeHasPartialPrefetching | PrefetchHint.SubtreeHasInstantFalse)) === 0) { | ||
| const error = createLinkPrefetchPartialError(url.pathname); | ||
@@ -108,0 +112,0 @@ const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // static shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n PrefetchHint.SubtreeHasPartialPrefetching) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n await new Promise<void>((resolve) => {\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n resolve // _onComplete callback\n )\n })\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["PrefetchHint","SubtreePrefetchHints","propagateSubtreeBits","fetchServerResponse","startPPRNavigation","spawnDynamicRequests","FreshnessPolicy","getCurrentNavigationLock","createHrefFromUrl","NEXT_NAV_DEPLOYMENT_ID_HEADER","EntryStatus","readRouteCacheEntry","deprecated_requestOptimisticRouteCacheEntry","convertRootFlightRouterStateToRouteTree","getStaleAt","writePrerenderResponseIntoCache","processRuntimePrefetchStream","writeDynamicRenderResponseIntoCache","discoverKnownRoute","createCacheKey","schedulePrefetchTask","PrefetchPriority","FetchStrategy","getLinkForCurrentNavigation","ScrollBehavior","computeChangedPath","isJavaScriptURLString","UnknownDynamicStaleTime","computeDynamicStaleAt","createLinkPrefetchPartialError","navigate","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","route","status","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","navigateToUnknownRoute","catch","navigateToKnownRoute","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","fetchStrategy","Full","routeTree","prefetchHints","SubtreeHasPartialPrefetching","error","pathname","ownerStack","undefined","console","stack","name","message","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","metadataVaryPath","data","head","dynamicStaleAt","Gesture","completeSoftNavigation","node","renderedSearch","completeHardNavigation","tree","hash","prefetchSeed","metadata","varyPath","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","convertServerPatchToFullTree","search","response","staticStageResponse","isResponsePartial","s","then","staleAt","buildId","get","b","PPR","f","h","r","processed","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","completeTraverseNavigation","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","childHints","isEmptySeedDataPartial","Promise","resolve","updateCapturedSPAToTree"],"mappings":"AAQA,SACEA,YAAY,EACZC,oBAAoB,EACpBC,oBAAoB,QACf,uCAAsC;AAE7C,SAASC,mBAAmB,QAAQ,0CAAyC;AAC7E,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,eAAe,EACfC,wBAAwB,QAGnB,oCAAmC;AAC1C,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,SAASC,6BAA6B,QAAQ,yBAAwB;AACtE,SACEC,WAAW,EACXC,mBAAmB,EACnBC,2CAA2C,EAC3CC,uCAAuC,EACvCC,UAAU,EACVC,+BAA+B,EAC/BC,4BAA4B,EAC5BC,mCAAmC,QAG9B,UAAS;AAChB,SAASC,kBAAkB,QAAQ,sBAAqB;AACxD,SAASC,cAAc,QAA+B,cAAa;AACnE,SAASC,oBAAoB,QAAQ,cAAa;AAClD,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,UAAS;AACzD,SAASC,2BAA2B,QAAQ,WAAU;AAGtD,SAASC,cAAc,QAAQ,yCAAwC;AACvE,SAASC,kBAAkB,QAAQ,yCAAwC;AAC3E,SAASC,qBAAqB,QAAQ,2BAA0B;AAChE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,YAAW;AAC1E,SAASC,8BAA8B,QAAQ,uCAAsC;AAErF;;;;;;;CAOC,GACD,OAAO,SAASC,SACdC,KAAqB,EACrBC,GAAQ,EACRC,UAAe,EACfC,qBAA6B,EAC7BC,gBAAkC,EAClCC,wBAA2C,EAC3CC,OAAsB,EACtBC,eAAgC,EAChCC,cAA8B,EAC9BC,YAAgC;IAEhC,IA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AAuB,EAAE,GAC/BxJ,QAAQ;QACVwJ,wBAAwBlK,0BAA0B2E,OAAOd,IAAI;IAC/D;IAEA,OAAOc;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n ScrollRef,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type { HeadData } from '../../../shared/lib/app-router-types'\nimport {\n PrefetchHint,\n SubtreePrefetchHints,\n propagateSubtreeBits,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n spawnDynamicRequests,\n FreshnessPolicy,\n getCurrentNavigationLock,\n type NavigationLock,\n type NavigationRequestAccumulation,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport { NEXT_NAV_DEPLOYMENT_ID_HEADER } from '../../../lib/constants'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n deprecated_requestOptimisticRouteCacheEntry,\n convertRootFlightRouterStateToRouteTree,\n getStaleAt,\n writePrerenderResponseIntoCache,\n processRuntimePrefetchStream,\n writeDynamicRenderResponseIntoCache,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { discoverKnownRoute } from './optimistic-routes'\nimport { createCacheKey, type NormalizedSearch } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport { PrefetchPriority, FetchStrategy } from './types'\nimport { getLinkForCurrentNavigation } from '../links'\nimport type { PageVaryPath } from './vary-path'\nimport type { AppRouterState } from '../router-reducer/router-reducer-types'\nimport { ScrollBehavior } from '../router-reducer/router-reducer-types'\nimport { computeChangedPath } from '../router-reducer/compute-changed-path'\nimport { isJavaScriptURLString } from '../../lib/javascript-url'\nimport { UnknownDynamicStaleTime, computeDynamicStaleAt } from './bfcache'\nimport { createLinkPrefetchPartialError } from '../../../shared/lib/instant-messages'\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace'\n): AppRouterState | Promise<AppRouterState> {\n let navigationLock: NavigationLock = null\n\n // Instant Navigation Testing API: when the lock is active, ensure a\n // prefetch task has been initiated before proceeding with the navigation.\n // This guarantees that segment data requests are at least pending, even\n // for routes that already have a cached route tree. Without this, the\n // static shell might be incomplete because some segments were never\n // requested.\n if (process.env.__NEXT_EXPOSE_TESTING_API) {\n const { isNavigationLocked } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n if (isNavigationLocked()) {\n navigationLock = getCurrentNavigationLock()\n return ensurePrefetchThenNavigate(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n }\n }\n\n return navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n}\n\nfunction navigateImpl(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): AppRouterState | Promise<AppRouterState> {\n const now = Date.now()\n const href = url.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n route,\n navigationLock\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree using the deprecated search-params\n // based matching. This is only used when the new optimisticRouting flag is\n // disabled.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (!process.env.__NEXT_OPTIMISTIC_ROUTING) {\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = deprecated_requestOptimisticRouteCacheEntry(\n now,\n url,\n nextUrl\n )\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n return navigateUsingPrefetchedRouteTree(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n optimisticRoute,\n navigationLock\n )\n }\n }\n }\n\n // There's no matching prefetch for this route in the cache. We must lazily\n // fetch it from the server before we can perform the navigation.\n //\n // TODO: If this is a gesture navigation, instead of performing a\n // dynamic request, we should do a runtime prefetch.\n return navigateToUnknownRoute(\n now,\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n ).catch(() => {\n // If the navigation fails, return the current state\n return state\n })\n}\n\nexport function navigateToKnownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n canonicalUrl: string,\n navigationSeed: NavigationSeed,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n nextUrl: string | null,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock,\n debugInfo: Array<unknown> | null,\n // The route cache entry used for this navigation, if it came from route\n // prediction. Passed through so it can be marked as having a dynamic rewrite\n // if the server returns a different pathname (indicating dynamic rewrite\n // behavior).\n //\n // When null, the navigation did not use route prediction - either because\n // the route was already fully cached, or it's a navigation that doesn't\n // involve prediction (refresh, history traversal, server action, etc.).\n // In these cases, if a mismatch occurs, we still mark the route as having a\n // dynamic rewrite by traversing the known route tree (see\n // dispatchRetryDueToTreeMismatch).\n routeCacheEntry: FulfilledRouteCacheEntry | null\n): AppRouterState {\n // A version of navigate() that accepts the target route tree as an argument\n // rather than reading it from the prefetch cache.\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n // Warn when navigating via a `<Link prefetch={true}>` to a route that has\n // not opted into Partial Prefetching. Such a link does a legacy \"full\"\n // prefetch that includes the route's dynamic data, defeating the\n // static/dynamic split that Cache Components provides.\n //\n // This runs at navigation time (rather than prefetch time) so that, in dev\n // where we don't prefetch, the warning only appears when you actually\n // navigate to the route — existing apps with many `prefetch={true}` links\n // aren't flooded with warnings the moment they enable Cache Components.\n //\n // The warning is suppressed if any segment on the target route exports\n // `instant = false`, which is the explicit API for opting a route out of\n // this validation.\n const link = getLinkForCurrentNavigation()\n if (\n link !== null &&\n link.fetchStrategy === FetchStrategy.Full &&\n (navigationSeed.routeTree.prefetchHints &\n (PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasInstantFalse)) ===\n 0\n ) {\n const error = createLinkPrefetchPartialError(url.pathname)\n const ownerStack = 'ownerStack' in link ? link.ownerStack : undefined\n if (ownerStack === undefined) {\n console.error(\n '' +\n 'Cannot associate the \"prefetch={true}\" warning with a specific <Link> making it harder to find the cause of the following warning. ' +\n 'This is a bug in Next.js.'\n )\n } else if (ownerStack !== null) {\n // Replace the (useless) stack captured at the throw site — which\n // points into router internals — with the Owner Stack captured when\n // the <Link> rendered. That way the dev overlay associates this\n // warning with the JSX that created the link, not with\n // navigation.ts.\n error.stack = `${error.name}: ${error.message}${ownerStack}`\n }\n console.error(error)\n }\n }\n const accumulation: NavigationRequestAccumulation = {\n separateRefreshUrls: null,\n scrollRef: null,\n }\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation = url.href === currentUrl.href\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n navigationSeed.routeTree,\n navigationSeed.metadataVaryPath,\n freshnessPolicy,\n navigationSeed.data,\n navigationSeed.head,\n navigationSeed.dynamicStaleAt,\n isSamePageNavigation,\n accumulation\n )\n if (task !== null) {\n if (freshnessPolicy !== FreshnessPolicy.Gesture) {\n spawnDynamicRequests(\n task,\n url,\n nextUrl,\n freshnessPolicy,\n accumulation,\n routeCacheEntry,\n navigateType,\n navigationLock\n )\n }\n return completeSoftNavigation(\n state,\n url,\n nextUrl,\n task.route,\n task.node,\n navigationSeed.renderedSearch,\n canonicalUrl,\n navigateType,\n scrollBehavior,\n accumulation.scrollRef,\n debugInfo\n )\n }\n // Could not perform a SPA navigation. Revert to a full-page (MPA) navigation.\n return completeHardNavigation(state, url, navigateType)\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n route: FulfilledRouteCacheEntry,\n navigationLock: NavigationLock\n): AppRouterState {\n const routeTree = route.tree\n const canonicalUrl = route.canonicalUrl + url.hash\n const renderedSearch = route.renderedSearch\n const prefetchSeed: NavigationSeed = {\n renderedSearch,\n routeTree,\n metadataVaryPath: route.metadata.varyPath as any,\n data: null,\n head: null,\n dynamicStaleAt: computeDynamicStaleAt(now, UnknownDynamicStaleTime),\n }\n return navigateToKnownRoute(\n now,\n state,\n url,\n canonicalUrl,\n prefetchSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n null,\n route\n )\n}\n\n// Used to request all the dynamic data for a route, rather than just a subset,\n// e.g. during a refresh or a revalidation. Typically this gets constructed\n// during the normal flow when diffing the route tree, but for an unprefetched\n// navigation, where we don't know the structure of the target route, we use\n// this instead.\nconst DynamicRequestTreeForEntireRoute: FlightRouterState = [\n '',\n {},\n null,\n 'refetch',\n]\n\nasync function navigateToUnknownRoute(\n now: number,\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n nextUrl: string | null,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n let dynamicRequestTree: FlightRouterState\n switch (freshnessPolicy) {\n case FreshnessPolicy.Default:\n case FreshnessPolicy.HistoryTraversal:\n case FreshnessPolicy.Gesture:\n dynamicRequestTree = currentFlightRouterState\n break\n case FreshnessPolicy.Hydration: // <- shouldn't happen during client nav\n case FreshnessPolicy.RefreshAll:\n case FreshnessPolicy.HMRRefresh:\n dynamicRequestTree = DynamicRequestTreeForEntireRoute\n break\n default:\n freshnessPolicy satisfies never\n dynamicRequestTree = currentFlightRouterState\n break\n }\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const redirectUrl = new URL(result, location.origin)\n return completeHardNavigation(state, redirectUrl, navigateType)\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n couldBeIntercepted,\n supportsPerSegmentPrefetching,\n dynamicStaleTime,\n staticStageData,\n runtimePrefetchStream,\n responseHeaders,\n debugInfo,\n } = result\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const navigationSeed = convertServerPatchToFullTree(\n now,\n currentFlightRouterState,\n flightData,\n renderedSearch,\n dynamicStaleTime\n )\n\n // Learn the route pattern so we can predict it for future navigations.\n // hasDynamicRewrite is false because this is a fresh navigation to an\n // unknown route - any rewrite detection happens during the traversal inside\n // discoverKnownRoute. The hasDynamicRewrite param is only set to true when\n // retrying after a tree mismatch (see dispatchRetryDueToTreeMismatch).\n const metadataVaryPath = navigationSeed.metadataVaryPath\n if (metadataVaryPath !== null) {\n discoverKnownRoute(\n now,\n url.pathname,\n url.search as NormalizedSearch,\n nextUrl,\n null, // No pending entry\n navigationSeed.routeTree,\n metadataVaryPath,\n couldBeIntercepted,\n createHrefFromUrl(canonicalUrl),\n supportsPerSegmentPrefetching,\n false // hasDynamicRewrite - not a retry, rewrite detection happens during traversal\n )\n\n if (staticStageData !== null) {\n const { response: staticStageResponse, isResponsePartial } =\n staticStageData\n\n // Write the static stage of the response into the segment cache so that\n // subsequent navigations can serve cached static segments instantly.\n getStaleAt(now, staticStageResponse.s)\n .then((staleAt) => {\n const buildId =\n responseHeaders.get(NEXT_NAV_DEPLOYMENT_ID_HEADER) ??\n staticStageResponse.b\n\n // TODO: Implement Shell extraction as part of Cached Navigations.\n // Intentionally holding off on doing this until we decide how the\n // Cached Navigations behavior should work in combination with App\n // Shells.\n writePrerenderResponseIntoCache(\n now,\n FetchStrategy.PPR,\n staticStageResponse.f,\n buildId,\n staticStageResponse.h,\n staticStageResponse.r ?? null,\n staleAt,\n currentFlightRouterState,\n renderedSearch,\n isResponsePartial\n )\n })\n .catch(() => {\n // The static stage processing failed. Not fatal — the navigation\n // completed normally, we just won't write into the cache.\n })\n }\n\n if (runtimePrefetchStream !== null) {\n processRuntimePrefetchStream(\n now,\n runtimePrefetchStream,\n currentFlightRouterState,\n renderedSearch\n )\n .then((processed) => {\n if (processed !== null) {\n writeDynamicRenderResponseIntoCache(\n now,\n FetchStrategy.PPRRuntime,\n processed.flightDatas,\n processed.buildId,\n processed.isResponsePartial,\n processed.headVaryParams,\n processed.rootVaryParamsIterable,\n processed.staleAt,\n processed.navigationSeed,\n null\n )\n }\n })\n .catch(() => {\n // The runtime prefetch cache write failed. Not fatal — the\n // navigation completed normally, we just won't cache runtime data.\n })\n }\n }\n\n // In the streaming dev render, this single response's seed content may still\n // be streaming when we build the tree below. An unknown-route navigation\n // places that content inline (it has no prior cache entry, so the server\n // sends a full seed rather than the dynamic-only delta a known route gets),\n // and that inline content is not gated like a known route's deferred RSCs. So\n // React could read a still-pending chunk and flash a Suspense fallback\n // (wanted on a cold cache, but not on a warm one). Wait for the shell to\n // flush (`revealAfter`) first, so the inline seed content is decoded by the\n // time React reads it, the same way the known-route path gates its deferred\n // RSCs. `revealAfter` is null outside the streaming dev render. On a cache\n // miss it resolves early, so the cold-cache fallback is still shown.\n if (result.revealAfter !== null) {\n await result.revealAfter\n }\n\n return navigateToKnownRoute(\n now,\n state,\n url,\n createHrefFromUrl(canonicalUrl),\n navigationSeed,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n freshnessPolicy,\n nextUrl,\n scrollBehavior,\n navigateType,\n navigationLock,\n debugInfo,\n // Unknown route navigations don't use route prediction - the route tree\n // came directly from the server. If a mismatch occurs during dynamic data\n // fetch, the retry handler will traverse the known route tree to mark the\n // entry as having a dynamic rewrite.\n null\n )\n}\n\nexport function completeHardNavigation(\n state: AppRouterState,\n url: URL,\n navigateType: 'push' | 'replace'\n): AppRouterState {\n if (isJavaScriptURLString(url.href)) {\n console.error(\n 'Next.js has blocked a javascript: URL as a security precaution.'\n )\n return state\n }\n const newState: AppRouterState = {\n canonicalUrl:\n url.origin === location.origin ? createHrefFromUrl(url) : url.href,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: true,\n preserveCustomHistoryState: false,\n },\n // TODO: None of the rest of these values are consistent with the incoming\n // navigation. We rely on the fact that AppRouter will suspend and trigger\n // a hard navigation before it accesses any of these values. But instead\n // we should trigger the hard navigation and blocking any subsequent\n // router updates without updating React.\n renderedSearch: state.renderedSearch,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n tree: state.tree,\n nextUrl: state.nextUrl,\n previousNextUrl: state.previousNextUrl,\n debugInfo: null,\n }\n return newState\n}\n\nexport function completeSoftNavigation(\n oldState: AppRouterState,\n url: URL,\n referringNextUrl: string | null,\n tree: FlightRouterState,\n cache: CacheNode,\n renderedSearch: string,\n canonicalUrl: string,\n navigateType: 'push' | 'replace',\n scrollBehavior: ScrollBehavior,\n scrollRef: ScrollRef | null,\n collectedDebugInfo: Array<unknown> | null\n) {\n // The \"Next-Url\" is a special representation of the URL that Next.js\n // uses to implement interception routes.\n // TODO: Get rid of this extra traversal by computing this during the\n // same traversal that computes the tree itself. We should also figure out\n // what is the minimum information needed for the server to correctly\n // intercept the route.\n const changedPath = computeChangedPath(oldState.tree, tree)\n const nextUrlForNewRoute = changedPath ? changedPath : oldState.nextUrl\n\n // This value is stored on the state as `previousNextUrl`; the naming is\n // confusing. What it represents is the \"Next-Url\" header that was used to\n // fetch the incoming route. It's essentially the refererer URL, but in a\n // Next.js specific format. During refreshes, this is sent back to the server\n // instead of the current route's \"Next-Url\" so that the same interception\n // logic is applied as during the original navigation.\n const previousNextUrl = referringNextUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(oldState.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n\n // Determine whether and how the page should scroll after this\n // navigation.\n //\n // By default, we scroll to the segments that were navigated to — i.e.\n // segments in the new part of the route, as opposed to shared segments\n // that were already part of the previous route. All newly navigated\n // segments share a single ScrollRef. When they mount, the first one\n // to mount initiates the scroll. They share a ref so that only one\n // scroll happens per navigation.\n //\n // If a subsequent navigation produces new segments, those supersede\n // any pending scroll from the previous navigation by invalidating its\n // ScrollRef. If a navigation doesn't produce any new segments (e.g.\n // a refresh where the route structure didn't change), any pending\n // scrolls from previous navigations are unaffected.\n //\n // The branches below handle special cases layered on top of this\n // default model.\n let activeScrollRef: ScrollRef | null\n let forceScroll: boolean\n if (scrollBehavior === ScrollBehavior.NoScroll) {\n // The user explicitly opted out of scrolling (e.g. scroll={false}\n // on a Link or router.push).\n //\n // If this navigation created new scroll targets (scrollRef !== null),\n // neutralize them. If it didn't, any prior scroll targets carried\n // forward on the cache nodes via reuseSharedCacheNode remain active.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = oldState.focusAndScrollRef.scrollRef\n forceScroll = false\n } else if (onlyHashChange) {\n // Hash-only navigations should scroll regardless of per-node state.\n // Create a fresh ref so the first segment to scroll consumes it.\n //\n // Invalidate any scroll ref from a prior navigation that hasn't\n // been consumed yet.\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n // Also invalidate any per-node refs that were accumulated during\n // this navigation's tree construction — the hash-only ref\n // supersedes them.\n if (scrollRef !== null) {\n scrollRef.current = false\n }\n activeScrollRef = { current: true }\n forceScroll = true\n } else {\n // Default case. Use the accumulated scrollRef (may be null if no\n // new segments were created). The handler checks per-node refs, so\n // unchanged parallel route slots won't scroll.\n activeScrollRef = scrollRef\n\n // If this navigation created new scroll targets, invalidate any\n // pending scroll from a previous navigation.\n if (scrollRef !== null) {\n const oldScrollRef = oldState.focusAndScrollRef.scrollRef\n if (oldScrollRef !== null) {\n oldScrollRef.current = false\n }\n }\n forceScroll = false\n }\n\n const newState: AppRouterState = {\n canonicalUrl,\n renderedSearch,\n pushRef: {\n pendingPush: navigateType === 'push',\n mpaNavigation: false,\n preserveCustomHistoryState: false,\n },\n focusAndScrollRef: {\n scrollRef: activeScrollRef,\n forceScroll,\n onlyHashChange,\n hashFragment:\n // Remove leading # and decode hash to make non-latin hashes work.\n //\n // Empty hash should trigger default behavior of scrolling layout into\n // view. #top is handled in layout-router.\n //\n // Refer to `ScrollAndFocusHandler` for details on how this is used.\n scrollBehavior !== ScrollBehavior.NoScroll && url.hash !== ''\n ? decodeURIComponent(url.hash.slice(1))\n : oldState.focusAndScrollRef.hashFragment,\n },\n cache,\n tree,\n nextUrl: nextUrlForNewRoute,\n previousNextUrl,\n debugInfo: collectedDebugInfo,\n }\n return newState\n}\n\nexport function completeTraverseNavigation(\n state: AppRouterState,\n url: URL,\n renderedSearch: string,\n cache: CacheNode,\n tree: FlightRouterState,\n nextUrl: string | null\n) {\n return {\n // Set canonical url\n canonicalUrl: createHrefFromUrl(url),\n renderedSearch,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // Ensures that the custom history state that was set is preserved when applying this update.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: state.focusAndScrollRef,\n cache,\n // Restore provided tree\n tree,\n nextUrl,\n // TODO: We need to restore previousNextUrl, too, which represents the\n // Next-Url that was used to fetch the data. Anywhere we fetch using the\n // canonical URL, there should be a corresponding Next-Url.\n previousNextUrl: null,\n debugInfo: null,\n }\n}\n\n// TODO: The rest of this file is related to converting the server response into\n// the data structures used by the client. Probably should move to a\n// separate module.\n\nexport type NavigationSeed = {\n renderedSearch: string\n routeTree: RouteTree\n metadataVaryPath: PageVaryPath | null\n data: CacheNodeSeedData | null\n head: HeadData | null\n dynamicStaleAt: number\n}\n\nexport function convertServerPatchToFullTree(\n now: number,\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData> | null,\n renderedSearch: string,\n dynamicStaleTimeSeconds: number\n): NavigationSeed {\n // During a client navigation or prefetch, the server sends back only a patch\n // for the parts of the tree that have changed.\n //\n // This applies the patch to the base tree to create a full representation of\n // the resulting tree.\n //\n // The return type includes a full FlightRouterState tree and a full\n // CacheNodeSeedData tree. (Conceptually these are the same tree, and should\n // eventually be unified, but there's still lots of existing code that\n // operates on FlightRouterState trees alone without the CacheNodeSeedData.)\n //\n // TODO: This similar to what apply-router-state-patch-to-tree does. It\n // will eventually fully replace it. We should get rid of all the remaining\n // places where we iterate over the server patch format. This should also\n // eventually replace normalizeFlightData.\n\n let baseTree: FlightRouterState = currentTree\n let baseData: CacheNodeSeedData | null = null\n let head: HeadData | null = null\n if (flightData !== null) {\n for (const {\n segmentPath,\n tree: treePatch,\n seedData: dataPatch,\n head: headPatch,\n } of flightData) {\n const result = convertServerPatchToFullTreeImpl(\n baseTree,\n baseData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n 0\n )\n baseTree = result.tree\n baseData = result.data\n // This is the same for all patches per response, so just pick an\n // arbitrary one\n head = headPatch\n }\n }\n\n const finalFlightRouterState = baseTree\n\n // Convert the final FlightRouterState into a RouteTree type.\n //\n // TODO: Eventually, FlightRouterState will evolve to being a transport format\n // only. The RouteTree type will become the main type used for dealing with\n // routes on the client, and we'll store it in the state directly.\n const acc = { metadataVaryPath: null }\n const routeTree = convertRootFlightRouterStateToRouteTree(\n finalFlightRouterState,\n renderedSearch as NormalizedSearch,\n acc\n )\n\n return {\n routeTree,\n metadataVaryPath: acc.metadataVaryPath,\n data: baseData,\n renderedSearch,\n head,\n dynamicStaleAt: computeDynamicStaleAt(now, dynamicStaleTimeSeconds),\n }\n}\n\nfunction convertServerPatchToFullTreeImpl(\n baseRouterState: FlightRouterState,\n baseData: CacheNodeSeedData | null,\n treePatch: FlightRouterState,\n dataPatch: CacheNodeSeedData | null,\n segmentPath: FlightSegmentPath,\n renderedSearch: string,\n index: number\n): { tree: FlightRouterState; data: CacheNodeSeedData | null } {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return {\n tree: treePatch,\n data: dataPatch,\n }\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: We receive the FlightRouterState patch in the same request as the\n // seed data patch. Therefore we don't need to worry about diffing the segment\n // values; we can assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseTreeChildren = baseRouterState[1]\n const baseSeedDataChildren = baseData !== null ? baseData[1] : null\n const newTreeChildren: Record<string, FlightRouterState> = {}\n const newSeedDataChildren: Record<string, CacheNodeSeedData | null> = {}\n for (const parallelRouteKey in baseTreeChildren) {\n const childBaseRouterState = baseTreeChildren[parallelRouteKey]\n const childBaseSeedData =\n baseSeedDataChildren !== null\n ? (baseSeedDataChildren[parallelRouteKey] ?? null)\n : null\n if (parallelRouteKey === updatedParallelRouteKey) {\n const result = convertServerPatchToFullTreeImpl(\n childBaseRouterState,\n childBaseSeedData,\n treePatch,\n dataPatch,\n segmentPath,\n renderedSearch,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n\n newTreeChildren[parallelRouteKey] = result.tree\n newSeedDataChildren[parallelRouteKey] = result.data\n } else {\n // This child is not being patched. Copy it over as-is.\n newTreeChildren[parallelRouteKey] = childBaseRouterState\n newSeedDataChildren[parallelRouteKey] = childBaseSeedData\n }\n }\n\n let clonedTree: FlightRouterState\n let clonedSeedData: CacheNodeSeedData\n // Clone all the fields except the children.\n\n // Clone the FlightRouterState tree. Based on equivalent logic in\n // apply-router-state-patch-to-tree, but should confirm whether we need to\n // copy all of these fields. Not sure the server ever sends, e.g. the\n // refetch marker.\n clonedTree = [baseRouterState[0], newTreeChildren]\n if (2 in baseRouterState) {\n const compressedRefreshState = baseRouterState[2]\n if (\n compressedRefreshState !== undefined &&\n compressedRefreshState !== null\n ) {\n // Since this part of the tree was patched with new data, any parent\n // refresh states should be updated to reflect the new rendered search\n // value. (The refresh state acts like a \"context provider\".) All pages\n // within the same server response share the same renderedSearch value,\n // but the same RouteTree could be composed from multiple different\n // routes, and multiple responses.\n clonedTree[2] = [compressedRefreshState[0], renderedSearch]\n }\n }\n if (3 in baseRouterState) {\n clonedTree[3] = baseRouterState[3]\n }\n // Recompute the propagated \"subtree\" prefetch hints for this segment. Mirrors\n // the propagation done on the server in\n // createFlightRouterStateFromLoaderTree.\n let prefetchHints = (baseRouterState[4] ?? 0) & ~SubtreePrefetchHints\n for (const parallelRouteKey in newTreeChildren) {\n const childHints = newTreeChildren[parallelRouteKey][4]\n if (childHints !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, childHints)\n }\n }\n if (prefetchHints !== 0) {\n clonedTree[4] = prefetchHints\n }\n\n // Clone the CacheNodeSeedData tree.\n const isEmptySeedDataPartial = true\n clonedSeedData = [\n null,\n newSeedDataChildren,\n null,\n isEmptySeedDataPartial,\n null,\n ]\n\n return {\n tree: clonedTree,\n data: clonedSeedData,\n }\n}\n\n/**\n * Instant Navigation Testing API: ensures a prefetch task has been initiated\n * and completed before proceeding with the navigation. This guarantees that\n * segment data requests are at least pending, even for routes whose route\n * tree is already cached.\n *\n * After the prefetch completes, delegates to the normal navigation flow.\n */\nasync function ensurePrefetchThenNavigate(\n state: AppRouterState,\n url: URL,\n currentUrl: URL,\n currentRenderedSearch: string,\n currentCacheNode: CacheNode | null,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n freshnessPolicy: FreshnessPolicy,\n scrollBehavior: ScrollBehavior,\n navigateType: 'push' | 'replace',\n navigationLock: NavigationLock\n): Promise<AppRouterState> {\n const link = getLinkForCurrentNavigation()\n const fetchStrategy = link !== null ? link.fetchStrategy : FetchStrategy.PPR\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n\n await new Promise<void>((resolve) => {\n schedulePrefetchTask(\n cacheKey,\n currentFlightRouterState,\n fetchStrategy,\n PrefetchPriority.Default,\n null, // onInvalidate\n resolve // _onComplete callback\n )\n })\n\n // Prefetch is complete. Proceed with the normal navigation flow, which\n // will now find the route in the cache.\n const result = await navigateImpl(\n state,\n url,\n currentUrl,\n currentRenderedSearch,\n currentCacheNode,\n currentFlightRouterState,\n nextUrl,\n freshnessPolicy,\n scrollBehavior,\n navigateType,\n navigationLock\n )\n\n // Only transition to captured-SPA once the navigation is known to be an SPA.\n // If the result is an MPA navigation, leave the cookie pending and let the new\n // document load transition it to captured-MPA.\n if (!result.pushRef.mpaNavigation) {\n const { updateCapturedSPAToTree } =\n require('./navigation-testing-lock') as typeof import('./navigation-testing-lock')\n updateCapturedSPAToTree(currentFlightRouterState, result.tree)\n }\n\n return result\n}\n"],"names":["PrefetchHint","SubtreePrefetchHints","propagateSubtreeBits","fetchServerResponse","startPPRNavigation","spawnDynamicRequests","FreshnessPolicy","getCurrentNavigationLock","createHrefFromUrl","NEXT_NAV_DEPLOYMENT_ID_HEADER","EntryStatus","readRouteCacheEntry","deprecated_requestOptimisticRouteCacheEntry","convertRootFlightRouterStateToRouteTree","getStaleAt","writePrerenderResponseIntoCache","processRuntimePrefetchStream","writeDynamicRenderResponseIntoCache","discoverKnownRoute","createCacheKey","schedulePrefetchTask","PrefetchPriority","FetchStrategy","getLinkForCurrentNavigation","ScrollBehavior","computeChangedPath","isJavaScriptURLString","UnknownDynamicStaleTime","computeDynamicStaleAt","createLinkPrefetchPartialError","navigate","state","url","currentUrl","currentRenderedSearch","currentCacheNode","currentFlightRouterState","nextUrl","freshnessPolicy","scrollBehavior","navigateType","navigationLock","process","env","__NEXT_EXPOSE_TESTING_API","isNavigationLocked","require","ensurePrefetchThenNavigate","navigateImpl","now","Date","href","cacheKey","route","status","Fulfilled","navigateUsingPrefetchedRouteTree","__NEXT_OPTIMISTIC_ROUTING","Rejected","optimisticRoute","navigateToUnknownRoute","catch","navigateToKnownRoute","canonicalUrl","navigationSeed","debugInfo","routeCacheEntry","NODE_ENV","__NEXT_CACHE_COMPONENTS","link","fetchStrategy","Full","routeTree","prefetchHints","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","error","pathname","ownerStack","undefined","console","stack","name","message","accumulation","separateRefreshUrls","scrollRef","isSamePageNavigation","task","metadataVaryPath","data","head","dynamicStaleAt","Gesture","completeSoftNavigation","node","renderedSearch","completeHardNavigation","tree","hash","prefetchSeed","metadata","varyPath","DynamicRequestTreeForEntireRoute","dynamicRequestTree","Default","HistoryTraversal","Hydration","RefreshAll","HMRRefresh","promiseForDynamicServerResponse","flightRouterState","result","redirectUrl","URL","location","origin","flightData","couldBeIntercepted","supportsPerSegmentPrefetching","dynamicStaleTime","staticStageData","runtimePrefetchStream","responseHeaders","convertServerPatchToFullTree","search","response","staticStageResponse","isResponsePartial","s","then","staleAt","buildId","get","b","PPR","f","h","r","processed","PPRRuntime","flightDatas","headVaryParams","rootVaryParamsIterable","revealAfter","newState","pushRef","pendingPush","mpaNavigation","preserveCustomHistoryState","focusAndScrollRef","cache","previousNextUrl","oldState","referringNextUrl","collectedDebugInfo","changedPath","nextUrlForNewRoute","oldUrl","onlyHashChange","activeScrollRef","forceScroll","NoScroll","current","oldScrollRef","hashFragment","decodeURIComponent","slice","completeTraverseNavigation","currentTree","dynamicStaleTimeSeconds","baseTree","baseData","segmentPath","treePatch","seedData","dataPatch","headPatch","convertServerPatchToFullTreeImpl","finalFlightRouterState","acc","baseRouterState","index","length","updatedParallelRouteKey","baseTreeChildren","baseSeedDataChildren","newTreeChildren","newSeedDataChildren","parallelRouteKey","childBaseRouterState","childBaseSeedData","clonedTree","clonedSeedData","compressedRefreshState","childHints","isEmptySeedDataPartial","Promise","resolve","updateCapturedSPAToTree"],"mappings":"AAQA,SACEA,YAAY,EACZC,oBAAoB,EACpBC,oBAAoB,QACf,uCAAsC;AAE7C,SAASC,mBAAmB,QAAQ,0CAAyC;AAC7E,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,eAAe,EACfC,wBAAwB,QAGnB,oCAAmC;AAC1C,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,SAASC,6BAA6B,QAAQ,yBAAwB;AACtE,SACEC,WAAW,EACXC,mBAAmB,EACnBC,2CAA2C,EAC3CC,uCAAuC,EACvCC,UAAU,EACVC,+BAA+B,EAC/BC,4BAA4B,EAC5BC,mCAAmC,QAG9B,UAAS;AAChB,SAASC,kBAAkB,QAAQ,sBAAqB;AACxD,SAASC,cAAc,QAA+B,cAAa;AACnE,SAASC,oBAAoB,QAAQ,cAAa;AAClD,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,UAAS;AACzD,SAASC,2BAA2B,QAAQ,WAAU;AAGtD,SAASC,cAAc,QAAQ,yCAAwC;AACvE,SAASC,kBAAkB,QAAQ,yCAAwC;AAC3E,SAASC,qBAAqB,QAAQ,2BAA0B;AAChE,SAASC,uBAAuB,EAAEC,qBAAq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C,UACAhB,0BACAkC,eACAjD,iBAAiBoF,OAAO,EACxB,MACA6F,QAAQ,uBAAuB;;IAEnC;IAEA,uEAAuE;IACvE,wCAAwC;IACxC,MAAMtF,SAAS,MAAMhE,aACnBjB,OACAC,KACAC,YACAC,uBACAC,kBACAC,0BACAC,SACAC,iBACAC,gBACAC,cACAC;IAGF,6EAA6E;IAC7E,+EAA+E;IAC/E,+CAA+C;IAC/C,IAAI,CAACuE,OAAOkC,OAAO,CAACE,aAAa,EAAE;QACjC,MAAM,EAAEmD,uBAAuB,EAAE,GAC/BzJ,QAAQ;QACVyJ,wBAAwBnK,0BAA0B4E,OAAOd,IAAI;IAC/D;IAEA,OAAOc;AACT","ignoreList":[0]} |
@@ -28,3 +28,3 @@ /* global location */ // imports polyfill from `@next/polyfill-module` after build. | ||
| import { isNextRouterError } from './components/is-next-router-error'; | ||
| export const version = "16.3.0-canary.66"; | ||
| export const version = "16.3.0-canary.67"; | ||
| export let router; | ||
@@ -31,0 +31,0 @@ export const emitter = mitt(); |
@@ -20,3 +20,3 @@ import { readFileSync, writeFileSync } from 'fs'; | ||
| const data = await res.json(); | ||
| const versionData = data.versions["16.3.0-canary.66"]; | ||
| const versionData = data.versions["16.3.0-canary.67"]; | ||
| return { | ||
@@ -54,3 +54,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.0-canary.66", | ||
| version: "16.3.0-canary.67", | ||
| resolved: pkgData.tarball, | ||
@@ -63,3 +63,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.0-canary.66", | ||
| version: "16.3.0-canary.67", | ||
| resolved: pkgData.tarball, | ||
@@ -66,0 +66,0 @@ integrity: pkgData.integrity, |
@@ -74,2 +74,7 @@ import { PrefetchHint, propagateSubtreeBits } from '../../shared/lib/app-router-types'; | ||
| prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching; | ||
| } else if (instantConfig === false) { | ||
| // The segment explicitly opts out of Partial Prefetching. We don't change | ||
| // the prefetch behavior, but we record it so the dev-time | ||
| // `<Link prefetch={true}>` warning can be suppressed for this route. | ||
| prefetchHints |= PrefetchHint.SubtreeHasInstantFalse; | ||
| } | ||
@@ -76,0 +81,0 @@ if (prefetchConfig === 'partial') { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["PrefetchHint","propagateSubtreeBits","addSearchParamsIfPageSegment","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","createFlightRouterStateFromLoaderTree","createRouteTreePrefetch"],"mappings":"AACA,SACEA,YAAY,EACZC,oBAAoB,QAGf,oCAAmC;AAE1C,SAASC,4BAA4B,QAAQ,2BAA0B;AAGvE,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjBC,iBAA0B;IAE1B,MAAM,CAACC,SAASC,gBAAgB,EAAEC,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,CAAC,GAAGd;IAC7D,MAAMe,eAAeR,2BAA2BP;IAChD,MAAMgB,cAAcD,eAAeA,aAAaC,WAAW,GAAGN;IAE9D,MAAMO,cAAiC;QACrCnB,6BAA6BkB,aAAaR;QAC1C,CAAC;KACF;IAED,mEAAmE;IACnE,kEAAkE;IAClE,2EAA2E;IAC3E,iDAAiD;IACjD,MAAMU,MAAMN,SAAS,MAAMA,MAAM,CAAC,EAAE,KAAKE,OAAO,MAAMA,IAAI,CAAC,EAAE,KAAKK;IAClE,MAAMC,gBAAgBF,MAAM,AAACA,IAAyBG,OAAO,GAAGF;IAChE,MAAMG,iBACJ,AAACJ,CAAAA,MAAM,AAACA,IAAyBK,QAAQ,GAAGJ,SAAQ,KACnDf,CAAAA,uBAAuB,mBACpB,mBACAA,qBACE,YACAe,SAAQ;IAChB,IAAIK,gBAAgB;IAEpB,mEAAmE;IACnE,0EAA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C,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ;AAEA,OAAO,eAAe+B,wBACpBxC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtD,yEAAyE;AACzEE,oBAA6B,KAAK;IAElC,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,MAAMD,eAAe,CAAC;IACtB,OAAOT,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (instantConfig === false) {\n // The segment explicitly opts out of Partial Prefetching. We don't change\n // the prefetch behavior, but we record it so the dev-time\n // `<Link prefetch={true}>` warning can be suppressed for this route.\n prefetchHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["PrefetchHint","propagateSubtreeBits","addSearchParamsIfPageSegment","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","createFlightRouterStateFromLoaderTree","createRouteTreePrefetch"],"mappings":"AACA,SACEA,YAAY,EACZC,oBAAoB,QAGf,oCAAmC;AAE1C,SAASC,4BAA4B,QAAQ,2BAA0B;AAGvE,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjBC,iBAA0B;IAE1B,MAAM,CAACC,SAASC,gBAAgB,EAAEC,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,CAAC,GAAGd;IAC7D,MAAMe,eAAeR,2BAA2BP;IAChD,MAAMgB,cAAcD,eAAeA,aAAaC,WAAW,GAAGN;IAE9D,MAAMO,cAAiC;QACrCnB,6BAA6BkB,aAAaR;QAC1C,CAAC;KACF;IAED,mE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AK,CAAC,EAAE,KAAKpB,WAAW;YAC1BK,gBAAgB3B,qBAAqB2B,eAAee,KAAK,CAAC,EAAE;QAC9D;QACAJ,QAAQ,CAACC,iBAAiB,GAAGG;IAC/B;IACAtB,WAAW,CAAC,EAAE,GAAGkB;IAEjB,IAAIX,kBAAkB,GAAG;QACvBP,WAAW,CAAC,EAAE,GAAGO;IACnB;IAEA,OAAOP;AACT;AAEA,OAAO,eAAeuB,sCACpBxC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjB,6EAA6E;AAC7E,2EAA2E;AAC3E,eAAe;AACfC,oBAA6B,KAAK;IAElC,OAAOV,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ;AAEA,OAAO,eAAegC,wBACpBzC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtD,yEAAyE;AACzEE,oBAA6B,KAAK;IAElC,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,MAAMD,eAAe,CAAC;IACtB,OAAOT,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ","ignoreList":[0]} |
@@ -27,2 +27,3 @@ // eslint-disable-next-line import/no-extraneous-dependencies | ||
| export { preloadStyle, preloadFont, preconnect } from './rsc/preloads'; | ||
| export { isEmptyHTMLPrelude } from './postponed-state'; | ||
| export { Postpone } from './rsc/postpone'; | ||
@@ -29,0 +30,0 @@ export { taintObjectReference } from './rsc/taint'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["createTemporaryReferenceSet","renderToReadableStream","decodeReply","decodeAction","decodeFormState","prerender","renderToPipeableStream","prerenderToNodeStream","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","captureOwnerStack","createElement","Fragment","default","LayoutRouter","LoadingBoundaryProvider","RenderFromTemplateContext","ClientPageRoot","ClientSegmentRoot","createServerSearchParamsForServerPage","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createPrerenderParamsForClientSegment","serverHooks","HTTPAccessFallbackBoundary","createMetadataComponents","RootLayoutBoundary","preloadStyle","preloadFont","preconnect","Postpone","taintObjectReference","collectSegmentData","collectPrefetchHints","InstantValidation","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","workAsyncStorage","workUnitAsyncStorage","patchFetch","_patchFetch","SegmentViewNode","SegmentViewStateNode","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__"],"mappings":"AAAA,6DAA6D;AAC7D,SACEA,2BAA2B,EAC3BC,sBAAsB,EACtBC,WAAW,EACXC,YAAY,EACZC,eAAe,QACV,kCAAiC;AAExC,6DAA6D;AAC7D,SAASC,SAAS,QAAQ,kCAAiC;AAc3D,oDAAoD,GACpD,OAAO,IAAIC,uBAAgE;AAC3E,OAAO,IAAIC,sBAA8D;AACzE,IAAIC,QAAQC,GAAG,CAACC,uBAAuB,EAAE;IACvCJ,yBAAyB,AACvBK,QAAQ,wCACRL,sBAAsB;IACxBC,wBAAwB,AACtBI,QAAQ,mCACRJ,qBAAqB;AACzB,OAAO;IACLD,yBAAyBM;IACzBL,wBAAwBK;AAC1B;AACA,mDAAmD,GAEnD,0CAA0C;AAC1C,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,QAAO;AAElE,SACE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F,WAAWC,2BAA2B,GAAG;AAC3C;AAEA,0FAA0F;AAC1F,yGAAyG;AACzG,OAAO,SAASR;IACd,OAAOC,YAAY;QACjBH;QACAC;IACF;AACF;AAEA,mBAAmB;AACnB,SAASG,eAAe,EAAEC,oBAAoB,GAAE","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { isEmptyHTMLPrelude } from './postponed-state'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["createTemporaryReferenceSet","renderToReadableStream","decodeReply","decodeAction","decodeFormState","prerender","renderToPipeableStream","prerenderToNodeStream","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","captureOwnerStack","createElement","Fragment","default","LayoutRouter","LoadingBoundaryProvider","RenderFromTemplateContext","ClientPageRoot","ClientSegmentRoot","createServerSearchParamsForServerPage","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createPrerenderParamsForClientSegment","serverHooks","HTTPAccessFallbackBoundary","createMetadataComponents","RootLayoutBoundary","preloadStyle","preloadFont","preconnect","isEmptyHTMLPrelude","Postpone","taintObjectReference","collectSegmentData","collectPrefetchHints","InstantValidation","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","workAsyncStorage","workUnitAsyncStorage","patchFetch","_patchFetch","SegmentViewNode","SegmentViewStateNode","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__"],"mappings":"AAAA,6DAA6D;AAC7D,SACEA,2BAA2B,EAC3BC,sBAAsB,EACtBC,WAAW,EACXC,YAAY,EACZC,eAAe,QACV,kCAAiC;AAExC,6DAA6D;AAC7D,SAASC,SAAS,QAAQ,kCAAiC;AAc3D,oDAAoD,GACpD,OAAO,IAAIC,uBAAgE;AAC3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AAQ,qBAAoB;AAE9D,IAAIC,kBACF,IAAM;AACR,IAAIC,uBACF,IAAM;AACR,IAAItC,QAAQC,GAAG,CAACsC,QAAQ,KAAK,eAAe;IAC1C,MAAMC,MACJrC,QAAQ;IACVkC,kBAAkBG,IAAIH,eAAe;IACrCC,uBAAuBE,IAAIF,oBAAoB;AACjD;AAWA,0FAA0F;AAC1F,mDAAmD;AACnD,IAAItC,QAAQC,GAAG,CAACwC,SAAS,EAAE;IACzBC,WAAWC,2BAA2B,GAAGC;AAC3C,OAAO;IACL,6CAA6C;IAC7CF,WAAWC,2BAA2B,GAAG;AAC3C;AAEA,0FAA0F;AAC1F,yGAAyG;AACzG,OAAO,SAASR;IACd,OAAOC,YAAY;QACjBH;QACAC;IACF;AACF;AAEA,mBAAmB;AACnB,SAASG,eAAe,EAAEC,oBAAoB,GAAE","ignoreList":[0]} |
@@ -119,3 +119,44 @@ import { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'; | ||
| } | ||
| /** | ||
| * Cheaply determines whether a serialized postponed state represents an empty | ||
| * HTML prelude — i.e. the static shell rendered no bytes before the first | ||
| * dynamic hole (a blocking dynamic API at the root with no Suspense boundary | ||
| * above it). Returns false for dynamic-data states or unparseable input. | ||
| * | ||
| * Unlike `parsePostponedState`, this does not interpolate fallback route params | ||
| * or build a resume data cache: it only reads the prelude marker, which is | ||
| * independent of param values. The Instant Navigation Testing API uses this to | ||
| * detect the blank-document case in both dev (fresh render) and production | ||
| * (prebuilt shell), where the marker is persisted in the postponed state. | ||
| */ export function isEmptyHTMLPrelude(state) { | ||
| try { | ||
| var _state_match; | ||
| const lengthMatch = (_state_match = state.match(/^([0-9]*):/)) == null ? void 0 : _state_match[1]; | ||
| if (!lengthMatch) { | ||
| return false; | ||
| } | ||
| const length = parseInt(lengthMatch); | ||
| let postponedString = state.slice(lengthMatch.length + 1, lengthMatch.length + 1 + length); | ||
| // `null` is the dynamic-data case (a full shell was produced). | ||
| if (postponedString === 'null') { | ||
| return false; | ||
| } | ||
| // An optional `<n><replacements>` prefix carries fallback route param | ||
| // replacements; skip it to reach the `[preludeState, postponed]` data. | ||
| if (/^[0-9]/.test(postponedString)) { | ||
| var _postponedString_match; | ||
| const replacementsLengthMatch = (_postponedString_match = postponedString.match(/^([0-9]*)/)) == null ? void 0 : _postponedString_match[1]; | ||
| if (!replacementsLengthMatch) { | ||
| return false; | ||
| } | ||
| const replacementsLength = parseInt(replacementsLengthMatch); | ||
| postponedString = postponedString.slice(replacementsLengthMatch.length + replacementsLength); | ||
| } | ||
| const data = JSON.parse(postponedString); | ||
| return Array.isArray(data) && data[0] === 0; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
| //# sourceMappingURL=postponed-state.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n"],"names":["getDynamicParam","createPrerenderResumeDataCache","createRenderResumeDataCache","stringifyResumeDataCache","DynamicState","DynamicHTMLPreludeState","getDynamicHTMLPostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","replacements","Array","from","entries","replacementsString","postponedString","getDynamicDataPostponedState","parsePostponedState","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","replaceAll","err","console","error","getPostponedFromState"],"mappings":"AAIA,SAASA,eAAe,QAAQ,kDAAiD;AAEjF,SACEC,8BAA8B,EAC9BC,2BAA2B,QAGtB,yCAAwC;AAC/C,SAASC,wBAAwB,QAAQ,yCAAwC;AAEjF,OAAO,IAAA,AAAKC,sCAAAA;IACV;;GAEC;IAGD;;GAEC;WARSA;MAUX;AAwCD,OAAO,IAAA,AAAWC,iDAAAA;;;WAAAA;MAGjB;AAUD,OAAO,eAAeC,6BACpBC,SAAyB,EACzBC,YAAqC,EACrCC,mBAAqD,EACrDC,eAAiE,EACjEC,wBAAiC;IAEjC,MAAMC,OAA0C;QAACJ;QAAcD;KAAU;IACzE,MAAMM,aAAaC,KAAKC,SAAS,CAACH;IAElC,6EAA6E;IAC7E,eAAe;IACf,IAAI,CAACH,uBAAuBA,oBAAoBO,IAAI,KAAK,GAAG;QAC1D,oFAAoF;QACpF,OAAO,GAAGH,WAAWI,MAAM,CAAC,CAAC,EAAEJ,aAAa,MAAMV,yBAChDD,4BAA4BQ,kBAC5BC,2BACC;IACL;IAEA,MAAMO,eAAgDC,MAAMC,IAAI,CAC9DX,oBAAoBY,OAAO;IAE7B,MAAMC,qBAAqBR,KAAKC,SAAS,CAACG;IAE1C,4DAA4D;IAC5D,MAA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AAA;+BAAA;oCAAA;sCAAA;oBAEN;gBACF;gBAEA,kDAAkD;gBAClD,MAAMN,SAASgB,SAASH;gBACxB,MAAMZ,eAAeJ,KAAKwB,KAAK,CAC7Bf,gBAAgBW,KAAK,CACnBJ,MAAMb,MAAM,EACZ,uCAAuC;gBACvCa,MAAMb,MAAM,GAAGA;gBAInB,IAAIV,YAAYgB,gBAAgBW,KAAK,CAACJ,MAAMb,MAAM,GAAGA;gBACrD,KAAK,MAAM,CACTsB,YACA,CAACC,aAAaC,iBAAiB,CAChC,IAAIvB,aAAc;oBACjB,MAAM,EACJwB,aAAa,GAEX,gEAAgE;oBAChE,6DAA6D;oBAC7D,qBAAqB;oBACrBC,MACD,EACF,GAAG3C,gBACF2B,oBACAY,YACAE,kBACA,MACA,KAAK,gDAAgD;;oBAGvDlC,YAAYA,UAAUqC,UAAU,CAACJ,aAAaG;gBAChD;gBAEA,OAAO;oBACLP,IAAI;oBACJxB,MAAME,KAAKwB,KAAK,CAAC/B;oBACjB4B;gBACF;YACF;YAEA,OAAO;gBACLC,IAAI;gBACJxB,MAAME,KAAKwB,KAAK,CAACf;gBACjBY;YACF;QACF,EAAE,OAAOU,KAAK;YACZC,QAAQC,KAAK,CAAC,mCAAmCF;YACjD,OAAO;gBAAET,IAAI;gBAAqBD;YAAsB;QAC1D;IACF,EAAE,OAAOU,KAAK;QACZC,QAAQC,KAAK,CAAC,mCAAmCF;QACjD,OAAO;YACLT,IAAI;YACJD,uBAAuBjC,4BACrBD;QAEJ;IACF;AACF;AAEA,OAAO,SAAS+C,sBAAsBtB,KAAgC;IACpE,MAAM,CAAClB,cAAcD,UAAU,GAAGmB,MAAMd,IAAI;IAC5C,OAAO;QAAEJ;QAAcD;IAAU;AACnC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n\n/**\n * Cheaply determines whether a serialized postponed state represents an empty\n * HTML prelude — i.e. the static shell rendered no bytes before the first\n * dynamic hole (a blocking dynamic API at the root with no Suspense boundary\n * above it). Returns false for dynamic-data states or unparseable input.\n *\n * Unlike `parsePostponedState`, this does not interpolate fallback route params\n * or build a resume data cache: it only reads the prelude marker, which is\n * independent of param values. The Instant Navigation Testing API uses this to\n * detect the blank-document case in both dev (fresh render) and production\n * (prebuilt shell), where the marker is persisted in the postponed state.\n */\nexport function isEmptyHTMLPrelude(state: string): boolean {\n try {\n const lengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!lengthMatch) {\n return false\n }\n\n const length = parseInt(lengthMatch)\n let postponedString = state.slice(\n lengthMatch.length + 1,\n lengthMatch.length + 1 + length\n )\n\n // `null` is the dynamic-data case (a full shell was produced).\n if (postponedString === 'null') {\n return false\n }\n\n // An optional `<n><replacements>` prefix carries fallback route param\n // replacements; skip it to reach the `[preludeState, postponed]` data.\n if (/^[0-9]/.test(postponedString)) {\n const replacementsLengthMatch = postponedString.match(/^([0-9]*)/)?.[1]\n if (!replacementsLengthMatch) {\n return false\n }\n const replacementsLength = parseInt(replacementsLengthMatch)\n postponedString = postponedString.slice(\n replacementsLengthMatch.length + replacementsLength\n )\n }\n\n const data = JSON.parse(postponedString)\n return Array.isArray(data) && data[0] === DynamicHTMLPreludeState.Empty\n } catch {\n return false\n }\n}\n"],"names":["getDynamicParam","createPrerenderResumeDataCache","createRenderResumeDataCache","stringifyResumeDataCache","DynamicState","DynamicHTMLPreludeState","getDynamicHTMLPostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","replacements","Array","from","entries","replacementsString","postponedString","getDynamicDataPostponedState","parsePostponedState","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","replaceAll","err","console","error","getPostponedFromState","isEmptyHTMLPrelude","lengthMatch","replacementsLengthMatch","replacementsLength","isArray"],"mappings":"AAIA,SAASA,eAAe,QAAQ,kDAAiD;AAEjF,SACEC,8BAA8B,EAC9BC,2BAA2B,QAGtB,yCAAwC;AAC/C,SAASC,wBAAwB,QAAQ,yCAAwC;AAEjF,OAAO,IAAA,AAAKC,sCAAAA;IACV;;GAEC;IAGD;;GAEC;WARSA;MAUX;AAwCD,OAAO,IAAA,AAAWC,iDAAAA;;;WAAAA;MAGjB;AAUD,OAAO,eAAeC,6BACpBC,SAAyB,EACzBC,YAAqC,EACrCC,mBAAqD,EACrDC,eAAiE,EACjEC,wBAAiC;IAEjC,MAAMC,OAA0C;QAACJ;QAAcD;KAAU;IACzE,MAAMM,aAAaC,KAAKC,SAAS,CAACH;IAElC,6EAA6E;IAC7E,eAAe;IACf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J;IACF;AACF;AAEA,OAAO,SAAS+C,sBAAsBtB,KAAgC;IACpE,MAAM,CAAClB,cAAcD,UAAU,GAAGmB,MAAMd,IAAI;IAC5C,OAAO;QAAEJ;QAAcD;IAAU;AACnC;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAAS0C,mBAAmBvB,KAAa;IAC9C,IAAI;YACkBA;QAApB,MAAMwB,eAAcxB,eAAAA,MAAMI,KAAK,CAAC,kCAAZJ,YAA2B,CAAC,EAAE;QAClD,IAAI,CAACwB,aAAa;YAChB,OAAO;QACT;QAEA,MAAMjC,SAASgB,SAASiB;QACxB,IAAI3B,kBAAkBG,MAAMQ,KAAK,CAC/BgB,YAAYjC,MAAM,GAAG,GACrBiC,YAAYjC,MAAM,GAAG,IAAIA;QAG3B,+DAA+D;QAC/D,IAAIM,oBAAoB,QAAQ;YAC9B,OAAO;QACT;QAEA,sEAAsE;QACtE,uEAAuE;QACvE,IAAI,SAASc,IAAI,CAACd,kBAAkB;gBACFA;YAAhC,MAAM4B,2BAA0B5B,yBAAAA,gBAAgBO,KAAK,CAAC,iCAAtBP,sBAAoC,CAAC,EAAE;YACvE,IAAI,CAAC4B,yBAAyB;gBAC5B,OAAO;YACT;YACA,MAAMC,qBAAqBnB,SAASkB;YACpC5B,kBAAkBA,gBAAgBW,KAAK,CACrCiB,wBAAwBlC,MAAM,GAAGmC;QAErC;QAEA,MAAMxC,OAAOE,KAAKwB,KAAK,CAACf;QACxB,OAAOJ,MAAMkC,OAAO,CAACzC,SAASA,IAAI,CAAC,EAAE;IACvC,EAAE,OAAM;QACN,OAAO;IACT;AACF","ignoreList":[0]} |
@@ -26,3 +26,3 @@ import { loadEnvConfig } from '@next/env'; | ||
| } | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.0-canary.66"}`))}${versionSuffix}`); | ||
| Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.3.0-canary.67"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -29,0 +29,0 @@ Log.bootstrap(`- Local: ${appUrl}`); |
@@ -112,3 +112,3 @@ // Start CPU profile if it wasn't already started. | ||
| let { port } = serverOptions; | ||
| process.title = `next-server (v${"16.3.0-canary.66"})`; | ||
| process.title = `next-server (v${"16.3.0-canary.67"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -115,0 +115,0 @@ let handlersError = ()=>{}; |
| import { Readable } from 'node:stream'; | ||
| import { createHash } from 'node:crypto'; | ||
| import { InvariantError } from '../../shared/lib/invariant-error'; | ||
@@ -79,2 +80,3 @@ import { workAsyncStorage } from '../app-render/work-async-storage.external'; | ||
| } | ||
| const [element, options] = args; | ||
| // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced | ||
@@ -135,3 +137,7 @@ // input is ready, so anything the serialization below is still awaiting past | ||
| try { | ||
| const { prelude } = await prerenderToNodeStream(args, clientModules, { | ||
| // We serialize only the `element`. It's the part that needs Flight, to run | ||
| // its async Server Components once and to surface any dynamic input. The | ||
| // `options` are already-resolved plain data; they're folded into the cache | ||
| // key directly and passed to satori as-is below. | ||
| const { prelude } = await prerenderToNodeStream(element, clientModules, { | ||
| signal: hangingInputAbortSignal, | ||
@@ -167,6 +173,14 @@ filterStackFrame: undefined, | ||
| } | ||
| const buffer = Buffer.concat(chunks); | ||
| // Base64-encode the serialized output to use it as a stable string key | ||
| // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text). | ||
| const cacheKey = buffer.toString('base64'); | ||
| const elementBuffer = Buffer.concat(chunks); | ||
| // Derive a stable cache key from the serialized element plus the options. | ||
| // We hash rather than reuse the raw serialized bytes so the key stays | ||
| // compact even for large inputs (e.g. embedded fonts), and we fold the | ||
| // options in by content so two images that differ only in their options | ||
| // (size, fonts, ...) don't collide. The options are hashed directly here, | ||
| // never serialized through Flight, which would both bloat the key and apply | ||
| // `Buffer.prototype .toJSON` to font data. | ||
| const hash = createHash('sha256'); | ||
| hash.update(elementBuffer); | ||
| updateHashWithOptions(hash, options); | ||
| const cacheKey = hash.digest('base64'); | ||
| const cached = resumeDataCache.imageResponses.get(cacheKey); | ||
@@ -176,14 +190,8 @@ if (cached) { | ||
| } | ||
| // Deserialize the resolved tree and hand it to satori. Because the user's | ||
| // Deserialize the element and hand it to satori. Because the user's | ||
| // components already ran during serialization, satori only walks resolved | ||
| // host elements and never re-runs them, confining user-space I/O to the | ||
| // in-store serialization above. | ||
| // | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedArgs = resolveFlightLazies(await createFromNodeStream(Readable.from([ | ||
| buffer | ||
| const deserializedElement = await createFromNodeStream(Readable.from([ | ||
| elementBuffer | ||
| ]), { | ||
@@ -196,3 +204,19 @@ // We don't want to trigger preloads of client references here. | ||
| findSourceMapURL: undefined | ||
| })); | ||
| }); | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedElement = resolveFlightLazies(deserializedElement); | ||
| // Pair the resolved element with the original, in-memory `options`, which | ||
| // never went through Flight. This keeps the font `Buffer` intact: had it | ||
| // been serialized, Flight would apply the `toJSON` method that Node's | ||
| // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }` | ||
| // object that satori's font parser rejects (it needs an `ArrayBuffer` or a | ||
| // typed array). | ||
| const resolvedArgs = [ | ||
| resolvedElement, | ||
| options | ||
| ]; | ||
| // Render satori outside the prerender work-unit store. It does uncached | ||
@@ -212,2 +236,77 @@ // `fetch` calls (e.g. loading a font), and inside a Cache Components | ||
| } | ||
| /** | ||
| * Updates a hash with a stable encoding of the `ImageResponse` options so they | ||
| * can participate in the cache key without being serialized through Flight. | ||
| * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by | ||
| * their raw bytes; objects are walked in sorted-key order. | ||
| * | ||
| * `ImageResponse` options are plain data: numbers, strings, booleans, nested | ||
| * plain objects/arrays, and binary font data. Exotic objects such as `Map` or | ||
| * `Date` keep their state outside their enumerable own keys, so the key walk | ||
| * below would hash them incorrectly. Options never contain these, but we warn | ||
| * if one ever shows up so a mis-keyed cache can be reported. | ||
| * | ||
| * The encoding is self-delimiting: every node starts with a type tag, and | ||
| * variable-length parts (byte runs, primitives, keys) are length-prefixed, | ||
| * while arrays and objects are count-prefixed. This makes it injective, so no | ||
| * concatenation of values can be mistaken for a differently shaped input. | ||
| */ function updateHashWithOptions(hash, value) { | ||
| if (value === undefined) { | ||
| hash.update('u'); | ||
| return; | ||
| } | ||
| if (value === null) { | ||
| hash.update('n'); | ||
| return; | ||
| } | ||
| const type = typeof value; | ||
| if (type !== 'object') { | ||
| // Tag with the primitive type so e.g. the number `1` and the string `'1'` | ||
| // don't hash the same. | ||
| updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`)); | ||
| return; | ||
| } | ||
| if (value instanceof ArrayBuffer) { | ||
| updateHashWithBytes(hash, 'a', new Uint8Array(value)); | ||
| return; | ||
| } | ||
| if (ArrayBuffer.isView(value)) { | ||
| updateHashWithBytes(hash, 'v', new Uint8Array(value.buffer, value.byteOffset, value.byteLength)); | ||
| return; | ||
| } | ||
| if (Array.isArray(value)) { | ||
| hash.update(`[${value.length},`); | ||
| for (const item of value){ | ||
| updateHashWithOptions(hash, item); | ||
| } | ||
| return; | ||
| } | ||
| // The key walk below captures a plain object faithfully, but an exotic object | ||
| // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so | ||
| // two different values would hash the same and could return the wrong cached | ||
| // image. This shouldn't happen for `ImageResponse` options, so we warn rather | ||
| // than fail, then hash best-effort, so it can be reported. Not gated on | ||
| // `NODE_ENV`: this runs during the production `next build` prerender, where | ||
| // the warning is most useful. | ||
| const prototype = Object.getPrototypeOf(value); | ||
| if (prototype !== Object.prototype && prototype !== null) { | ||
| var _value_constructor; | ||
| const typeName = ((_value_constructor = value.constructor) == null ? void 0 : _value_constructor.name) ?? 'object'; | ||
| console.warn(`Cannot reliably include an \`ImageResponse\` option of type ` + `\`${typeName}\` in the cache key, so different images may collide and ` + `return an incorrect cached result. Please report this to the Next.js ` + `team.`); | ||
| } | ||
| const keys = Object.keys(value).sort(); | ||
| hash.update(`{${keys.length},`); | ||
| for (const key of keys){ | ||
| updateHashWithBytes(hash, 'k', Buffer.from(key)); | ||
| updateHashWithOptions(hash, value[key]); | ||
| } | ||
| } | ||
| /** | ||
| * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The | ||
| * length prefix keeps the run self-delimiting so it can't blend into adjacent | ||
| * nodes. | ||
| */ function updateHashWithBytes(hash, tag, bytes) { | ||
| hash.update(`${tag}${bytes.byteLength}:`); | ||
| hash.update(bytes); | ||
| } | ||
| async function renderImageResponseArrayBuffer(args) { | ||
@@ -214,0 +313,0 @@ const OGImageResponse = (await importOgModule()).ImageResponse; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n const { prelude } = await prerenderToNodeStream(args, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const buffer = Buffer.concat(chunks)\n // Base64-encode the serialized output to use it as a stable string key\n // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text).\n const cacheKey = buffer.toString('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the resolved tree and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n //\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedArgs = resolveFlightLazies(\n await createFromNodeStream(\n Readable.from([buffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n ) as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["Readable","InvariantError","workAsyncStorage","workUnitAsyncStorage","createHangingInputAbortSignal","makeHangingPromise","getClientReferenceManifest","getServerModuleMap","prerenderToNodeStream","createFromNodeStream","importOgModule","getCachedImageResponseBody","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","hangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","prelude","signal","filterStackFrame","onError","error","route","chunks","chunk","push","buffer","Buffer","concat","cacheKey","toString","cached","imageResponses","get","resolvedArgs","resolveFlightLazies","from","moduleLoading","moduleMap","serverModuleMap","findSourceMapURL","arrayBufferPromise","exit","mutable","set","OGImageResponse","ImageResponse","imageResponse","body","ArrayBuffer","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","Array","isArray","map","element","props","children"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAa;AAEtC,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AACrF,SAASC,6BAA6B,QAAQ,kCAAiC;AAC/E,SAASC,kBAAkB,QAAQ,6BAA4B;AAC/D,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,oCAAmC;AAC1C,6DAA6D;AAC7D,SAASC,qBAAqB,QAAQ,kCAAiC;AACvE,6DAA6D;AAC7D,SAASC,oBAAoB,QAAQ,kCAAiC;AAMtE,SAASC;IACP,0EAA0E;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,0DAA0D;IAC1D,OAAO,MAAM,CAAC;AAChB;AAEA;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASC,2BACdC,IAAuB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,CAACzB;IAClB;IAEA,MAAM0B,UAAUR;IAChB,IAAIQ,QAAQC,KAAK,IAAI,cAAcD,QAAQC,KAAK,EAAE;QAChD,OAAO;YACL,GAAGD,OAAO;YACVC,OAAO;gBACL,GAAGD,QAAQC,KAAK;gBAChBC,UAAU5B,oBAAoB0B,QAAQC,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOV;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\nimport { createHash, type Hash } from 'node:crypto'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n const [element, options] = args\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n // We serialize only the `element`. It's the part that needs Flight, to run\n // its async Server Components once and to surface any dynamic input. The\n // `options` are already-resolved plain data; they're folded into the cache\n // key directly and passed to satori as-is below.\n const { prelude } = await prerenderToNodeStream(element, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const elementBuffer = Buffer.concat(chunks)\n\n // Derive a stable cache key from the serialized element plus the options.\n // We hash rather than reuse the raw serialized bytes so the key stays\n // compact even for large inputs (e.g. embedded fonts), and we fold the\n // options in by content so two images that differ only in their options\n // (size, fonts, ...) don't collide. The options are hashed directly here,\n // never serialized through Flight, which would both bloat the key and apply\n // `Buffer.prototype .toJSON` to font data.\n const hash = createHash('sha256')\n hash.update(elementBuffer)\n updateHashWithOptions(hash, options)\n const cacheKey = hash.digest('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the element and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n const deserializedElement = await createFromNodeStream(\n Readable.from([elementBuffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedElement = resolveFlightLazies(deserializedElement)\n\n // Pair the resolved element with the original, in-memory `options`, which\n // never went through Flight. This keeps the font `Buffer` intact: had it\n // been serialized, Flight would apply the `toJSON` method that Node's\n // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }`\n // object that satori's font parser rejects (it needs an `ArrayBuffer` or a\n // typed array).\n const resolvedArgs = [resolvedElement, options] as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\n/**\n * Updates a hash with a stable encoding of the `ImageResponse` options so they\n * can participate in the cache key without being serialized through Flight.\n * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by\n * their raw bytes; objects are walked in sorted-key order.\n *\n * `ImageResponse` options are plain data: numbers, strings, booleans, nested\n * plain objects/arrays, and binary font data. Exotic objects such as `Map` or\n * `Date` keep their state outside their enumerable own keys, so the key walk\n * below would hash them incorrectly. Options never contain these, but we warn\n * if one ever shows up so a mis-keyed cache can be reported.\n *\n * The encoding is self-delimiting: every node starts with a type tag, and\n * variable-length parts (byte runs, primitives, keys) are length-prefixed,\n * while arrays and objects are count-prefixed. This makes it injective, so no\n * concatenation of values can be mistaken for a differently shaped input.\n */\nfunction updateHashWithOptions(hash: Hash, value: unknown): void {\n if (value === undefined) {\n hash.update('u')\n return\n }\n\n if (value === null) {\n hash.update('n')\n return\n }\n\n const type = typeof value\n\n if (type !== 'object') {\n // Tag with the primitive type so e.g. the number `1` and the string `'1'`\n // don't hash the same.\n updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`))\n return\n }\n\n if (value instanceof ArrayBuffer) {\n updateHashWithBytes(hash, 'a', new Uint8Array(value))\n return\n }\n\n if (ArrayBuffer.isView(value)) {\n updateHashWithBytes(\n hash,\n 'v',\n new Uint8Array(value.buffer, value.byteOffset, value.byteLength)\n )\n return\n }\n\n if (Array.isArray(value)) {\n hash.update(`[${value.length},`)\n for (const item of value) {\n updateHashWithOptions(hash, item)\n }\n return\n }\n\n // The key walk below captures a plain object faithfully, but an exotic object\n // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so\n // two different values would hash the same and could return the wrong cached\n // image. This shouldn't happen for `ImageResponse` options, so we warn rather\n // than fail, then hash best-effort, so it can be reported. Not gated on\n // `NODE_ENV`: this runs during the production `next build` prerender, where\n // the warning is most useful.\n const prototype = Object.getPrototypeOf(value)\n if (prototype !== Object.prototype && prototype !== null) {\n const typeName =\n (value as { constructor?: { name?: string } }).constructor?.name ??\n 'object'\n console.warn(\n `Cannot reliably include an \\`ImageResponse\\` option of type ` +\n `\\`${typeName}\\` in the cache key, so different images may collide and ` +\n `return an incorrect cached result. Please report this to the Next.js ` +\n `team.`\n )\n }\n\n const keys = Object.keys(value).sort()\n hash.update(`{${keys.length},`)\n for (const key of keys) {\n updateHashWithBytes(hash, 'k', Buffer.from(key))\n updateHashWithOptions(hash, (value as Record<string, unknown>)[key])\n }\n}\n\n/**\n * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The\n * length prefix keeps the run self-delimiting so it can't blend into adjacent\n * nodes.\n */\nfunction updateHashWithBytes(hash: Hash, tag: string, bytes: Uint8Array): void {\n hash.update(`${tag}${bytes.byteLength}:`)\n hash.update(bytes)\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["Readable","createHash","InvariantError","workAsyncStorage","workUnitAsyncStorage","createHangingInputAbortSignal","makeHangingPromise","getClientReferenceManifest","getServerModuleMap","prerenderToNodeStream","createFromNodeStream","importOgModule","getCachedImageResponseBody","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","element","options","hangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","prelude","signal","filterStackFrame","onError","error","route","chunks","chunk","push","elementBuffer","Buffer","concat","hash","update","updateHashWithOptions","cacheKey","digest","cached","imageResponses","get","deserializedElement","from","moduleLoading","moduleMap","serverModuleMap","findSourceMapURL","resolvedElement","resolveFlightLazies","resolvedArgs","arrayBufferPromise","exit","mutable","set","value","updateHashWithBytes","String","ArrayBuffer","isView","buffer","byteOffset","Array","isArray","length","item","prototype","Object","getPrototypeOf","typeName","constructor","name","console","warn","keys","sort","key","tag","bytes","OGImageResponse","ImageResponse","imageResponse","body","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","map","props","children"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAa;AACtC,SAASC,UAAU,QAAmB,cAAa;AAEnD,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AACrF,SAASC,6BAA6B,QAAQ,kCAAiC;AAC/E,SAASC,kBAAkB,QAAQ,6BAA4B;AAC/D,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,oCAAmC;AAC1C,6DAA6D;AAC7D,SAASC,qBAAqB,QAAQ,kCAAiC;AACvE,6DAA6D;AAC7D,SAASC,oBAAoB,QAAQ,kCAAiC;AAMtE,SAASC;IACP,0EAA0E;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,0DAA0D;IAC1D,OAAO,MAAM,CAAC;AAChB;AAEA;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASC,2BACdC,IAAuB;IAEvB,OAAO,IAAIC,eAA2B;QACpC,MAAMC,OAAMC,UAAU;YACpB,MAAMC,cAAc,MAAMC,kCAAkCL;YAC5D,IAAII,YAAYE,UAAU,GAAG,GAAG;gBAC9BH,WAAWI,OAAO,CAAC,IAAIC,WAAWJ;YACpC;YACAD,WAAWM,KAAK;QAClB;IACF;AACF;AAEA,eAAeJ,kCACbL,IAAuB;IAEvB,MAAMU,gBAAgBnB,qBAAqBoB,QAAQ;IAEnD,OAAQD,iCAAAA,cAAeE,IAAI;QACzB,KAAK;YAGH;QACF,KAAKC;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAOC,+BAA+Bd;Q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F,cAAcC,IAAI,EAAE;QACvB,OAAO,IAAIxB,YAAY;IACzB;IAEA,OAAOuB,cAAczF,WAAW;AAClC;AAEA,MAAM2F,kBAAkBC,OAAOC,GAAG,CAAC;AAEnC;;;;;;CAMC,GACD,SAASpC,oBAAoBqC,IAAa;IACxC,IAAIA,SAAS,QAAQ,OAAOA,SAAS,UAAU;QAC7C,OAAOA;IACT;IAEA,IAAI,AAACA,KAA+BC,QAAQ,KAAKJ,iBAAiB;QAChE,MAAMK,OAAOF;QAIb,OAAOrC,oBAAoBuC,KAAKC,KAAK,CAACD,KAAKE,QAAQ;IACrD;IAEA,IAAI5B,MAAMC,OAAO,CAACuB,OAAO;QACvB,OAAOA,KAAKK,GAAG,CAAC1C;IAClB;IAEA,MAAM1C,UAAU+E;IAChB,IAAI/E,QAAQqF,KAAK,IAAI,cAAcrF,QAAQqF,KAAK,EAAE;QAChD,OAAO;YACL,GAAGrF,OAAO;YACVqF,OAAO;gBACL,GAAGrF,QAAQqF,KAAK;gBAChBC,UAAU5C,oBAAoB1C,QAAQqF,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOP;AACT","ignoreList":[0]} |
@@ -56,2 +56,8 @@ /** | ||
| PrefetchHint[PrefetchHint["SubtreeHasEagerPrefetch"] = 4096] = "SubtreeHasEagerPrefetch"; | ||
| // This segment or one of its descendants exports `instant = false`, | ||
| // explicitly opting out of Partial Prefetching. Propagates upward so the root | ||
| // reflects the entire subtree. Used only to suppress the dev-time | ||
| // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect | ||
| // on the actual prefetch behavior. | ||
| PrefetchHint[PrefetchHint["SubtreeHasInstantFalse"] = 8192] = "SubtreeHasInstantFalse"; | ||
| return PrefetchHint; | ||
@@ -73,3 +79,3 @@ }({}); | ||
| * from a node's children. | ||
| */ export const SubtreePrefetchHints = 2 | 8 | 2048 | 4096; | ||
| */ export const SubtreePrefetchHints = 2 | 8 | 2048 | 8192 | 4096; | ||
| /** | ||
@@ -103,2 +109,7 @@ * Folds a child segment's prefetch hints into its parent's, propagating the | ||
| } | ||
| // And for `instant = false`. Like eager prefetch, the bit is set directly on | ||
| // each opted-out segment, so propagate it as-is. | ||
| if (childHints & 8192) { | ||
| parentHints |= 8192; | ||
| } | ||
| return parentHints; | ||
@@ -105,0 +116,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC,GAiLD,OAAO,IAAA,AAAWA,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;WAhDxBA;MAkDjB;AAED;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBACXD,SAA+D;AAEjE;;;;;CAKC,GACD,OAAO,MAAME,uBACXF,oBAGoC;AAEtC;;;;;;;;;;CAUC,GACD,OAAO,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n // This segment or one of its descendants exports `instant = false`,\n // explicitly opting out of Partial Prefetching. Propagates upward so the root\n // reflects the entire subtree. Used only to suppress the dev-time\n // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect\n // on the actual prefetch behavior.\n SubtreeHasInstantFalse = 0b10000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasInstantFalse |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n // And for `instant = false`. Like eager prefetch, the bit is set directly on\n // each opted-out segment, so propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasInstantFalse) {\n parentHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC,GAiLD,OAAO,IAAA,AAAWA,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;IAExC,oEAAoE;IACpE,8EAA8E;IAC9E,kEAAkE;IAClE,+EAA+E;IAC/E,mCAAmC;;WAtDnBA;MAwDjB;AAED;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBACXD,SAA+D;AAEjE;;;;;CAKC,GACD,OAAO,MAAME,uBACXF,2BAIoC;AAEtC;;;;;;;;;;CAUC,GACD,OAAO,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,6EAA6E;IAC7E,iDAAiD;IACjD,IAAIC,mBAAkD;QACpDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} |
| export function isStableBuild() { | ||
| return !"16.3.0-canary.66"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.0-canary.67"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| } | ||
@@ -4,0 +4,0 @@ export class CanaryOnlyConfigError extends Error { |
@@ -75,3 +75,3 @@ "use strict"; | ||
| const data = await res.json(); | ||
| const versionData = data.versions["16.3.0-canary.66"]; | ||
| const versionData = data.versions["16.3.0-canary.67"]; | ||
| return { | ||
@@ -104,3 +104,3 @@ os: versionData.os, | ||
| lockfileParsed.dependencies[pkg] = { | ||
| version: "16.3.0-canary.66", | ||
| version: "16.3.0-canary.67", | ||
| resolved: pkgData.tarball, | ||
@@ -113,3 +113,3 @@ integrity: pkgData.integrity, | ||
| lockfileParsed.packages[pkg] = { | ||
| version: "16.3.0-canary.66", | ||
| version: "16.3.0-canary.67", | ||
| resolved: pkgData.tarball, | ||
@@ -116,0 +116,0 @@ integrity: pkgData.integrity, |
@@ -96,2 +96,7 @@ "use strict"; | ||
| prefetchHints |= _approutertypes.PrefetchHint.SubtreeHasPartialPrefetching; | ||
| } else if (instantConfig === false) { | ||
| // The segment explicitly opts out of Partial Prefetching. We don't change | ||
| // the prefetch behavior, but we record it so the dev-time | ||
| // `<Link prefetch={true}>` warning can be suppressed for this route. | ||
| prefetchHints |= _approutertypes.PrefetchHint.SubtreeHasInstantFalse; | ||
| } | ||
@@ -98,0 +103,0 @@ if (prefetchConfig === 'partial') { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["createFlightRouterStateFromLoaderTree","createRouteTreePrefetch","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","addSearchParamsIfPageSegment","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","PrefetchHint","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","propagateSubtreeBits"],"mappings":";;;;;;;;;;;;;;;IA8KsBA,qCAAqC;eAArCA;;IA6BAC,uBAAuB;eAAvBA;;;gCArMf;yBAEsC;AAG7C,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eA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sources":["../../../src/server/app-render/create-flight-router-state-from-loader-tree.ts"],"sourcesContent":["import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n PrefetchHint,\n propagateSubtreeBits,\n type FlightRouterState,\n type PrefetchHints,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\nasync function createFlightRouterStateFromLoaderTreeImpl(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n didFindRootLayout: boolean\n): Promise<FlightRouterState> {\n const [segment, parallelRoutes, { layout, loading, page }] = loaderTree\n const dynamicParam = getDynamicParamFromSegment(loaderTree)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Load the layout or page module to check its instant and prefetch\n // configs. When a segment doesn't export prefetch, it defaults to\n // 'partial' if the app has opted into partial prefetching globally via the\n // `partialPrefetching` config in next.config.js.\n const mod = layout ? await layout[0]() : page ? await page[0]() : undefined\n const instantConfig = mod ? (mod as AppSegmentConfig).instant : undefined\n const prefetchConfig =\n (mod ? (mod as AppSegmentConfig).prefetch : undefined) ??\n (partialPrefetching === 'unstable_eager'\n ? 'unstable_eager'\n : partialPrefetching\n ? 'partial'\n : undefined)\n let prefetchHints = 0\n\n // Union in the precomputed build-time hints (e.g. segment inlining\n // decisions) if available. When hints are not available (e.g. dev mode or\n // if prefetch-hints.json was not generated), we fall through and still\n // compute the other hints below. In the future this should be a build\n // error, but for now we gracefully degrade.\n //\n // TODO: Move more of the hints computation (IsRootLayoutOrAbove, instant config,\n // loading boundary detection) into the build-time measurement step in\n // collectPrefetchHints, so this function only needs to union the\n // precomputed bitmask rather than re-derive hints on every render.\n if (hintTree !== null) {\n prefetchHints |= hintTree.hints\n } else if (prefetchInliningEnabled) {\n if (isBuildTimePrerendering) {\n // Prefetch inlining is enabled but no hint tree was provided during a\n // build-time prerender. This happens for the initial RSC payload\n // generated before collectPrefetchHints has run. Mark so the client\n // can expire the route cache entry and re-fetch the tree with correct\n // hints.\n prefetchHints |= PrefetchHint.InliningHintsStale\n } else if (isStaticGeneration) {\n // TODO(#91407): Temporary mitigation: when hints are missing during\n // runtime static generation, fall back to treating every segment as\n // unprefetchable. This currently happens for routes with\n // `instant = false` at the root segment, which causes the prerender\n // to run per-request instead of being cached, and the prefetch hints\n // manifest is not available.\n //\n // Once that bug is fixed, this branch should become an error again —\n // hints should always be available from the manifest during ISR.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (cacheComponents) {\n // At runtime with no hint tree, this is a fully dynamic route with no\n // manifest entry. Treat every segment as unprefetchable. Do NOT set\n // InliningHintsStale — that would cause the client to enter an\n // infinite re-fetch loop trying to get hints that will never exist.\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else {\n // Without cacheComponents, dynamic pages have no static shell so\n // hints are never computed. Don't disable prefetching — just skip\n // the inlining hint system and let prefetching proceed normally.\n }\n }\n\n // Mark every segment at or above the root layout (i.e. until we descend past\n // the first segment that has a layout).\n if (!didFindRootLayout) {\n prefetchHints |= PrefetchHint.IsRootLayoutOrAbove\n if (typeof layout !== 'undefined') {\n // This segment is the root layout; its descendants are below it.\n didFindRootLayout = true\n }\n }\n\n const isInstant =\n instantConfig === true ||\n (typeof instantConfig === 'object' && instantConfig !== null)\n if (isInstant) {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (instantConfig === false) {\n // The segment explicitly opts out of Partial Prefetching. We don't change\n // the prefetch behavior, but we record it so the dev-time\n // `<Link prefetch={true}>` warning can be suppressed for this route.\n prefetchHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n\n if (prefetchConfig === 'partial') {\n prefetchHints |= PrefetchHint.SubtreeHasPartialPrefetching\n } else if (prefetchConfig === 'unstable_eager') {\n // Like 'partial' (uses the PPR fetch strategy) but also marks the segment\n // as eager, so App Shells keeps prefetching it instead of relying on the\n // shared app shell.\n prefetchHints |=\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasEagerPrefetch\n } else if (prefetchConfig === 'force-disabled') {\n prefetchHints |= PrefetchHint.PrefetchDisabled\n } else if (prefetchConfig === 'allow-runtime') {\n prefetchHints |= PrefetchHint.HasRuntimePrefetch\n }\n\n // Mark the segment as \"eager\" unless its effective prefetch strategy is\n // 'partial' or 'allow-runtime'. A truthy instant is treated as\n // 'partial' (not eager). 'unstable_eager' already set the bit above. Under\n // App Shells, a subtree with no eager segment skips its Speculative prefetch\n // and relies on the shared app shell instead.\n if (\n !isInstant &&\n prefetchConfig !== 'partial' &&\n prefetchConfig !== 'allow-runtime'\n ) {\n prefetchHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n\n // Check if this segment has a loading boundary\n if (loading) {\n prefetchHints |= PrefetchHint.SegmentHasLoadingBoundary\n }\n\n const children: FlightRouterState[1] = {}\n for (const parallelRouteKey in parallelRoutes) {\n // Look up the child hint node by parallel route key, traversing the\n // hint tree in parallel with the loader tree.\n const childHintNode = hintTree?.slots?.[parallelRouteKey] ?? null\n\n const child = await createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n childHintNode,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n // Propagate subtree flags from children\n if (child[4] !== undefined) {\n prefetchHints = propagateSubtreeBits(prefetchHints, child[4])\n }\n children[parallelRouteKey] = child\n }\n segmentTree[1] = children\n\n if (prefetchHints !== 0) {\n segmentTree[4] = prefetchHints\n }\n\n return segmentTree\n}\n\nexport async function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n // Whether a root layout was already found above this loader tree slice, so a\n // slice that starts below the root layout doesn't mark a sub-layout as the\n // root layout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n\nexport async function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n hintTree: PrefetchHints | null,\n prefetchInliningEnabled: boolean,\n cacheComponents: boolean,\n partialPrefetching: boolean | 'unstable_eager' | undefined,\n isStaticGeneration: boolean,\n isBuildTimePrerendering: boolean,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n // See note on createFlightRouterStateFromLoaderTree's didFindRootLayout.\n didFindRootLayout: boolean = false\n): Promise<FlightRouterState> {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n hintTree,\n prefetchInliningEnabled,\n cacheComponents,\n partialPrefetching,\n isStaticGeneration,\n isBuildTimePrerendering,\n getDynamicParamFromSegment,\n searchParams,\n didFindRootLayout\n )\n}\n"],"names":["createFlightRouterStateFromLoaderTree","createRouteTreePrefetch","createFlightRouterStateFromLoaderTreeImpl","loaderTree","hintTree","prefetchInliningEnabled","cacheComponents","partialPrefetching","isStaticGeneration","isBuildTimePrerendering","getDynamicParamFromSegment","searchParams","didFindRootLayout","segment","parallelRoutes","layout","loading","page","dynamicParam","treeSegment","segmentTree","addSearchParamsIfPageSegment","mod","undefined","instantConfig","instant","prefetchConfig","prefetch","prefetchHints","hints","PrefetchHint","InliningHintsStale","PrefetchDisabled","IsRootLayoutOrAbove","isInstant","SubtreeHasPartialPrefetching","SubtreeHasInstantFalse","SubtreeHasEagerPrefetch","HasRuntimePrefetch","SegmentHasLoadingBoundary","children","parallelRouteKey","childHintNode","slots","child","propagateSubtreeBits"],"mappings":";;;;;;;;;;;;;;;IAmLsBA,qCAAqC;eAArCA;;IA6BAC,uBAAuB;eAAvBA;;;gCA1Mf;yBAEsC;AAG7C,eAAeC,0CACbC,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjBC,iBAA0B;IAE1B,MAAM,CAACC,SAASC,gBAAgB,EAAEC,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,CAAC,GAAGd;IAC7D,MAAMe,eAAeR,2BAA2BP;IAChD,MAAMgB,cAAcD,eAAeA,aAAaC,WAAW,GAAGN;IAE9D,MAAMO,cAAiC;QACrCC,IAAAA,qCAA4B,EAACF,aAAaR;QAC1C,CAAC;KACF;IAED,mEAAmE;IACnE,kEAAkE;IAClE,2EAA2E;IAC3E,iDAAiD;IACjD,MAAMW,MAAMP,SAAS,MAAMA,MAAM,CAAC,EAAE,KAAKE,OAAO,MAAMA,IAAI,CAAC,EAAE,KAAKM;IAClE,MAAMC,gBAAgBF,MAAM,AAACA,IAAyBG,OAAO,GAAGF;IAChE,MAAMG,iBACJ,AAACJ,CAAAA,MAAM,AAACA,IAAyBK,QAAQ,GAAGJ,SAAQ,KACnDhB,CAAAA,uBAAuB,mBACpB,mBACAA,qBACE,YACAgB,SAAQ;IAChB,IAAIK,gBAAgB;IAEpB,mEAAmE;IACnE,0EAA0E;IAC1E,uEAAuE;IACvE,sEAA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,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtDC,YAAiB,EACjB,6EAA6E;AAC7E,2EAA2E;AAC3E,eAAe;AACfC,oBAA6B,KAAK;IAElC,OAAOV,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ;AAEO,eAAeX,wBACpBE,UAAsB,EACtBC,QAA8B,EAC9BC,uBAAgC,EAChCC,eAAwB,EACxBC,kBAA0D,EAC1DC,kBAA2B,EAC3BC,uBAAgC,EAChCC,0BAAsD,EACtD,yEAAyE;AACzEE,oBAA6B,KAAK;IAElC,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,MAAMD,eAAe,CAAC;IACtB,OAAOT,0CACLC,YACAC,UACAC,yBACAC,iBACAC,oBACAC,oBACAC,yBACAC,4BACAC,cACAC;AAEJ","ignoreList":[0]} |
@@ -24,2 +24,3 @@ export { createTemporaryReferenceSet, renderToReadableStream, decodeReply, decodeAction, decodeFormState, } from 'react-server-dom-webpack/server'; | ||
| export { preloadStyle, preloadFont, preconnect } from './rsc/preloads'; | ||
| export { isEmptyHTMLPrelude } from './postponed-state'; | ||
| export { Postpone } from './rsc/postpone'; | ||
@@ -26,0 +27,0 @@ export { taintObjectReference } from './rsc/taint'; |
@@ -32,2 +32,3 @@ // eslint-disable-next-line import/no-extraneous-dependencies | ||
| decodeReply: null, | ||
| isEmptyHTMLPrelude: null, | ||
| patchFetch: null, | ||
@@ -126,2 +127,5 @@ preconnect: null, | ||
| }, | ||
| isEmptyHTMLPrelude: function() { | ||
| return _postponedstate.isEmptyHTMLPrelude; | ||
| }, | ||
| patchFetch: function() { | ||
@@ -172,2 +176,3 @@ return patchFetch; | ||
| const _preloads = require("./rsc/preloads"); | ||
| const _postponedstate = require("./postponed-state"); | ||
| const _postpone = require("./rsc/postpone"); | ||
@@ -174,0 +179,0 @@ const _taint = require("./rsc/taint"); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["ClientPageRoot","ClientSegmentRoot","Fragment","HTTPAccessFallbackBoundary","InstantValidation","LayoutRouter","LoadingBoundaryProvider","Postpone","RenderFromTemplateContext","RootLayoutBoundary","SegmentViewNode","SegmentViewStateNode","captureOwnerStack","collectPrefetchHints","collectSegmentData","createElement","createMetadataComponents","createPrerenderParamsForClientSegment","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createServerSearchParamsForServerPage","createTemporaryReferenceSet","decodeAction","decodeFormState","decodeReply","patchFetch","preconnect","preloadFont","preloadStyle","prerender","prerenderToNodeStream","renderToPipeableStream","renderToReadableStream","serverHooks","taintObjectReference","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__","_patchFetch","workAsyncStorage","workUnitAsyncStorage"],"mappings":"AAAA,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDpDA,cAAc;eAAdA,0BAAc;;IACdC,iBAAiB;eAAjBA,gCAAiB;;IARiBC,QAAQ;eAARA,eAAQ;;IAkB1CC,0BAA0B;eAA1BA,yCAA0B;;IAYtBC,iBAAiB;eAAjBA;;IA3BAC,YAAY;eAAZA,qBAAY;;IACvBC,uBAAuB;eAAvBA,qCAAuB;;IAmBhBC,QAAQ;eAARA,kBAAQ;;IAjBGC,yBAAyB;eAAzBA,kCAAyB;;IAcpCC,kBAAkB;eAAlBA,sCAAkB;;IAiElBC,eAAe;eAAfA;;IAAiBC,oBAAoB;eAApBA;;IArF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B,EACnC;QACA,OAAOH,QAAQ;IACjB,OAAO;QACL,OAAOC;IACT;AACF;AAOA,IAAI7B,kBACF,IAAM;AACR,IAAIC,uBACF,IAAM;AACR,IAAIwB,QAAQC,GAAG,CAACM,QAAQ,KAAK,eAAe;IAC1C,MAAMC,MACJL,QAAQ;IACV5B,kBAAkBiC,IAAIjC,eAAe;IACrCC,uBAAuBgC,IAAIhC,oBAAoB;AACjD;AAWA,0FAA0F;AAC1F,mDAAmD;AACnD,IAAIwB,QAAQC,GAAG,CAACQ,SAAS,EAAE;IACzBC,WAAWC,2BAA2B,GAAGC;AAC3C,OAAO;IACL,6CAA6C;IAC7CF,WAAWC,2BAA2B,GAAG;AAC3C;AAIO,SAASrB;IACd,OAAOuB,IAAAA,sBAAW,EAAC;QACjBC,kBAAAA,0CAAgB;QAChBC,sBAAAA,kDAAoB;IACtB;AACF","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/app-render/entry-base.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nexport {\n createTemporaryReferenceSet,\n renderToReadableStream,\n decodeReply,\n decodeAction,\n decodeFormState,\n} from 'react-server-dom-webpack/server'\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport { prerender } from 'react-server-dom-webpack/static'\n\n// Node.js-specific Flight APIs, needed by stream-ops.node.ts via ComponentMod.\n// These must be exported from entry-base (react-server layer) because direct\n// imports from react-server-dom-webpack/* fail outside this layer.\ntype FlightRenderToPipeableStream = (...args: any[]) => {\n pipe<Writable extends NodeJS.WritableStream>(destination: Writable): Writable\n abort: (reason?: unknown) => void\n}\n\ntype FlightPrerenderToNodeStream = (...args: any[]) => Promise<{\n prelude: import('node:stream').Readable\n}>\n\n/* eslint-disable import/no-extraneous-dependencies */\nexport let renderToPipeableStream: FlightRenderToPipeableStream | undefined\nexport let prerenderToNodeStream: FlightPrerenderToNodeStream | undefined\nif (process.env.__NEXT_USE_NODE_STREAMS) {\n renderToPipeableStream = (\n require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')\n ).renderToPipeableStream\n prerenderToNodeStream = (\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n ).prerenderToNodeStream\n} else {\n renderToPipeableStream = undefined\n prerenderToNodeStream = undefined\n}\n/* eslint-enable import/no-extraneous-dependencies */\n\n// TODO: Just re-export `* as ReactServer`\nexport { captureOwnerStack, createElement, Fragment } from 'react'\n\nexport {\n default as LayoutRouter,\n LoadingBoundaryProvider,\n} from '../../client/components/layout-router'\nexport { default as RenderFromTemplateContext } from '../../client/components/render-from-template-context'\nexport { ClientPageRoot } from '../../client/components/client-page'\nexport { ClientSegmentRoot } from '../../client/components/client-segment'\nexport {\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n} from '../request/search-params'\nexport {\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n} from '../request/params'\nexport * as serverHooks from '../../client/components/hooks-server-context'\nexport { HTTPAccessFallbackBoundary } from '../../client/components/http-access-fallback/error-boundary'\nexport { createMetadataComponents } from '../../lib/metadata/metadata'\nexport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\n\nexport { preloadStyle, preloadFont, preconnect } from './rsc/preloads'\nexport { isEmptyHTMLPrelude } from './postponed-state'\nexport { Postpone } from './rsc/postpone'\nexport { taintObjectReference } from './rsc/taint'\nexport {\n collectSegmentData,\n collectPrefetchHints,\n} from './collect-segment-data'\n\nexport const InstantValidation = () => {\n if (\n process.env.NEXT_RUNTIME !== 'edge' &&\n process.env.__NEXT_CACHE_COMPONENTS\n ) {\n return require('./instant-validation/instant-validation') as typeof import('./instant-validation/instant-validation')\n } else {\n return undefined\n }\n}\n\nimport type { NodeJsPartialHmrUpdate } from '../../build/swc/types'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { patchFetch as _patchFetch } from '../lib/patch-fetch'\n\nlet SegmentViewNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewNode =\n () => null\nlet SegmentViewStateNode: typeof import('../../next-devtools/userspace/app/segment-explorer-node').SegmentViewStateNode =\n () => null\nif (process.env.NODE_ENV === 'development') {\n const mod =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n SegmentViewNode = mod.SegmentViewNode\n SegmentViewStateNode = mod.SegmentViewStateNode\n}\n\n// For hot-reloader\ndeclare global {\n var __next__clear_chunk_cache__: (() => void) | null | undefined\n var __turbopack_clear_chunk_cache__: () => void | null | undefined\n var __turbopack_server_hmr_apply__:\n | ((update: NodeJsPartialHmrUpdate) => boolean)\n | undefined\n}\n\n// hot-reloader modules are not bundled so we need to inject `__next__clear_chunk_cache__`\n// into globalThis from this file which is bundled.\nif (process.env.TURBOPACK) {\n globalThis.__next__clear_chunk_cache__ = __turbopack_clear_chunk_cache__\n} else {\n // Webpack does not have chunks on the server\n globalThis.__next__clear_chunk_cache__ = null\n}\n\n// patchFetch makes use of APIs such as `React.unstable_postpone` which are only available\n// in the experimental channel of React, so export it from here so that it comes from the bundled runtime\nexport function patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\n// Development only\nexport { SegmentViewNode, SegmentViewStateNode }\n"],"names":["ClientPageRoot","ClientSegmentRoot","Fragment","HTTPAccessFallbackBoundary","InstantValidation","LayoutRouter","LoadingBoundaryProvider","Postpone","RenderFromTemplateContext","RootLayoutBoundary","SegmentViewNode","SegmentViewStateNode","captureOwnerStack","collectPrefetchHints","collectSegmentData","createElement","createMetadataComponents","createPrerenderParamsForClientSegment","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createServerSearchParamsForServerPage","createTemporaryReferenceSet","decodeAction","decodeFormState","decodeReply","isEmptyHTMLPrelude","patchFetch","preconnect","preloadFont","preloadStyle","prerender","prerenderToNodeStream","renderToPipeableStream","renderToReadableStream","serverHooks","taintObjectReference","process","env","__NEXT_USE_NODE_STREAMS","require","undefined","NEXT_RUNTIME","__NEXT_CACHE_COMPONENTS","NODE_ENV","mod","TURBOPACK","globalThis","__next__clear_chunk_cache__","__turbopack_clear_chunk_cache__","_patchFetch","workAsyncStorage","workUnitAsyncStorage"],"mappings":"AAAA,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDpDA,cAAc;eAAdA,0BAAc;;IACdC,iBAAiB;eAAjBA,gCAAiB;;IARiBC,QAAQ;eAARA,eAAQ;;IAkB1CC,0BAA0B;eAA1BA,yCAA0B;;IAatBC,iBAAiB;eAAjBA;;IA5BAC,YAAY;eAAZA,qBAAY;;IACvBC,uBAAuB;eAAvBA,qCAAuB;;IAoBhBC,QAAQ;eAARA,kBAAQ;;IAlBGC,yBAAyB;eAAzBA,kCAAyB;;IAcpCC,kBAAkB;eAAlBA,sCAAkB;;IAkElBC,eAAe;eAAfA;;IAAiBC,oBAAoB;eAApBA;;IAtFjBC,iBAAiB;eAAjBA,wBAAiB;;IA4BxBC,oBAAoB;eAApBA,wCAAoB;;IADpBC,kBAAkB;eAAlBA,sCAAkB;;IA3BQC,aAAa;eAAbA,oBAAa;;IAmBhCC,wBAAwB;eAAxBA,kCAAwB;;IAJ/BC,qCAAqC;eAArCA,6CAAqC;;IAJrCC,wCAAwC;eAAxCA,sDAAwC;;IAGxCC,kCAAkC;eAAlCA,0CAAkC;;IAJlCC,qCAAqC;eAArCA,mDAAqC;;IAjDrCC,2BAA2B;eAA3BA,mCAA2B;;IAG3BC,YAAY;eAAZA,oBAAY;;IACZC,eAAe;eAAfA,uBAAe;;IAFfC,WAAW;eAAXA,mBAAW;;IA4DJC,kBAAkB;eAAlBA,kCAAkB;;IAuDXC,UAAU;eAAVA;;IAxDoBC,UAAU;eAAVA,oBAAU;;IAAvBC,WAAW;eAAXA,qBAAW;;IAAzBC,YAAY;eAAZA,sBAAY;;IArDZC,SAAS;eAATA,iBAAS;;IAgBPC,qBAAqB;eA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ueFallbackRouteParams } from '../../server/request/fallback-params'; | ||
| }; | ||
| /** | ||
| * Cheaply determines whether a serialized postponed state represents an empty | ||
| * HTML prelude — i.e. the static shell rendered no bytes before the first | ||
| * dynamic hole (a blocking dynamic API at the root with no Suspense boundary | ||
| * above it). Returns false for dynamic-data states or unparseable input. | ||
| * | ||
| * Unlike `parsePostponedState`, this does not interpolate fallback route params | ||
| * or build a resume data cache: it only reads the prelude marker, which is | ||
| * independent of param values. The Instant Navigation Testing API uses this to | ||
| * detect the blank-document case in both dev (fresh render) and production | ||
| * (prebuilt shell), where the marker is persisted in the postponed state. | ||
| */ | ||
| export declare function isEmptyHTMLPrelude(state: string): boolean; | ||
| export {}; |
@@ -11,2 +11,3 @@ "use strict"; | ||
| getPostponedFromState: null, | ||
| isEmptyHTMLPrelude: null, | ||
| parsePostponedState: null | ||
@@ -36,2 +37,5 @@ }); | ||
| }, | ||
| isEmptyHTMLPrelude: function() { | ||
| return isEmptyHTMLPrelude; | ||
| }, | ||
| parsePostponedState: function() { | ||
@@ -158,3 +162,33 @@ return parsePostponedState; | ||
| } | ||
| function isEmptyHTMLPrelude(state) { | ||
| try { | ||
| var _state_match; | ||
| const lengthMatch = (_state_match = state.match(/^([0-9]*):/)) == null ? void 0 : _state_match[1]; | ||
| if (!lengthMatch) { | ||
| return false; | ||
| } | ||
| const length = parseInt(lengthMatch); | ||
| let postponedString = state.slice(lengthMatch.length + 1, lengthMatch.length + 1 + length); | ||
| // `null` is the dynamic-data case (a full shell was produced). | ||
| if (postponedString === 'null') { | ||
| return false; | ||
| } | ||
| // An optional `<n><replacements>` prefix carries fallback route param | ||
| // replacements; skip it to reach the `[preludeState, postponed]` data. | ||
| if (/^[0-9]/.test(postponedString)) { | ||
| var _postponedString_match; | ||
| const replacementsLengthMatch = (_postponedString_match = postponedString.match(/^([0-9]*)/)) == null ? void 0 : _postponedString_match[1]; | ||
| if (!replacementsLengthMatch) { | ||
| return false; | ||
| } | ||
| const replacementsLength = parseInt(replacementsLengthMatch); | ||
| postponedString = postponedString.slice(replacementsLengthMatch.length + replacementsLength); | ||
| } | ||
| const data = JSON.parse(postponedString); | ||
| return Array.isArray(data) && data[0] === 0; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
| //# sourceMappingURL=postponed-state.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n"],"names":["DynamicHTMLPreludeState","DynamicState","getDynamicDataPostponedState","getDynamicHTMLPostponedState","getPostponedFromState","parsePostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","stringifyResumeDataCache","createRenderResumeDataCache","replacements","Array","from","entries","replacementsString","postponedString","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","getDynamicParam","replaceAll","err","console","error","createPrerenderResumeDataCache"],"mappings":";;;;;;;;;;;;;;;;;;;IAgEkBA,uBAAuB;eAAvBA;;IAlDNC,YAAY;eAAZA;;IA+FUC,4BAA4B;eAA5BA;;IAhCAC,4BAA4B;eAA5BA;;IA4INC,qBAAqB;eAArBA;;IArGAC,mBAAmB;eAAnBA;;;iCAhHgB;iCAOzB;AAGA,IAAA,AAAKJ,sCAAAA;IACV;;GAEC;IAGD;;GAEC;WARSA;;AAkDL,IAAA,AAAWD,iDAAAA;;;WAAAA;;AAaX,eAAeG,6BACpBG,SAAyB,EACzBC,YAAqC,EACrCC,mBAAqD,EACrDC,eAAiE,EACjEC,wBAAiC;IAEjC,MAAMC,OAA0C;QAACJ;QAAcD;KAAU;IACzE,MAAMM,aAAaC,KAAKC,SAAS,CAACH;IAElC,6EAA6E;IAC7E,eAAe;IACf,IAAI,CAACH,uBAAuBA,oBAAoBO,IAAI,KAAK,GAAG;QAC1D,oFAAoF;QACpF,OAAO,GAAGH,WAAWI,MAAM,CAAC,CAAC,EAAEJ,aAAa,MAAMK,IAAAA,yCAAwB,EACxEC,IAAAA,4CAA2B,EAACT,kBAC5BC,2BACC;IACL;IAEA,MAAMS,eAAgDC,MAAMC,IAAI,CAC9Db,oBAAoBc,OAAO;IAE7B,MAAMC,qBAAqBV,KAAKC,SAAS,CAACK;IAE1C,4DAA4D;IAC5D,MAAMK,kBAAkB,GAAGD,mBAAmBP,MAAM,GAAGO,qBAAqBX,YAAY;IAExF,oFAAoF;IACpF,OAAO,GAAGY,gBAAgBR,MAAM,CAAC,CAAC,EAAEQ,kBAAkB,MAAMP,IAAAA,yCAAwB,EAACR,iBAAiBC,2BAA2B;AACnI;AAEO,eAAeR,6BACpB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,uCAAuC;gBACvCa,MAAMb,MAAM,GAAGA;gBAInB,IAAIV,YAAYkB,gBAAgBS,KAAK,CAACJ,MAAMb,MAAM,GAAGA;gBACrD,KAAK,MAAM,CACTsB,YACA,CAACC,aAAaC,iBAAiB,CAChC,IAAIrB,aAAc;oBACjB,MAAM,EACJsB,aAAa,GAEX,gEAAgE;oBAChE,6DAA6D;oBAC7D,qBAAqB;oBACrBC,MACD,EACF,GAAGC,IAAAA,gCAAe,EACjBjB,oBACAY,YACAE,kBACA,MACA,KAAK,gDAAgD;;oBAGvDlC,YAAYA,UAAUsC,UAAU,CAACL,aAAaG;gBAChD;gBAEA,OAAO;oBACLP,IAAI;oBACJxB,MAAME,KAAKwB,KAAK,CAAC/B;oBACjB4B;gBACF;YACF;YAEA,OAAO;gBACLC,IAAI;gBACJxB,MAAME,KAAKwB,KAAK,CAACb;gBACjBU;YACF;QACF,EAAE,OAAOW,KAAK;YACZC,QAAQC,KAAK,CAAC,mCAAmCF;YACjD,OAAO;gBAAEV,IAAI;gBAAqBD;YAAsB;QAC1D;IACF,EAAE,OAAOW,KAAK;QACZC,QAAQC,KAAK,CAAC,mCAAmCF;QACjD,OAAO;YACLV,IAAI;YACJD,uBAAuBhB,IAAAA,4CAA2B,EAChD8B,IAAAA,+CAA8B;QAElC;IACF;AACF;AAEO,SAAS5C,sBAAsBqB,KAAgC;IACpE,MAAM,CAAClB,cAAcD,UAAU,GAAGmB,MAAMd,IAAI;IAC5C,OAAO;QAAEJ;QAAcD;IAAU;AACnC","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/app-render/postponed-state.ts"],"sourcesContent":["import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params,\n maxPostponedStateSizeBytes: number | undefined\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(\n postponedStringLengthMatch.length + postponedStringLength + 1\n ),\n maxPostponedStateSizeBytes\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null,\n null // staticSiblings not needed for postponed state\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createRenderResumeDataCache(\n createPrerenderResumeDataCache()\n ),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n\n/**\n * Cheaply determines whether a serialized postponed state represents an empty\n * HTML prelude — i.e. the static shell rendered no bytes before the first\n * dynamic hole (a blocking dynamic API at the root with no Suspense boundary\n * above it). Returns false for dynamic-data states or unparseable input.\n *\n * Unlike `parsePostponedState`, this does not interpolate fallback route params\n * or build a resume data cache: it only reads the prelude marker, which is\n * independent of param values. The Instant Navigation Testing API uses this to\n * detect the blank-document case in both dev (fresh render) and production\n * (prebuilt shell), where the marker is persisted in the postponed state.\n */\nexport function isEmptyHTMLPrelude(state: string): boolean {\n try {\n const lengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!lengthMatch) {\n return false\n }\n\n const length = parseInt(lengthMatch)\n let postponedString = state.slice(\n lengthMatch.length + 1,\n lengthMatch.length + 1 + length\n )\n\n // `null` is the dynamic-data case (a full shell was produced).\n if (postponedString === 'null') {\n return false\n }\n\n // An optional `<n><replacements>` prefix carries fallback route param\n // replacements; skip it to reach the `[preludeState, postponed]` data.\n if (/^[0-9]/.test(postponedString)) {\n const replacementsLengthMatch = postponedString.match(/^([0-9]*)/)?.[1]\n if (!replacementsLengthMatch) {\n return false\n }\n const replacementsLength = parseInt(replacementsLengthMatch)\n postponedString = postponedString.slice(\n replacementsLengthMatch.length + replacementsLength\n )\n }\n\n const data = JSON.parse(postponedString)\n return Array.isArray(data) && data[0] === DynamicHTMLPreludeState.Empty\n } catch {\n return false\n }\n}\n"],"names":["DynamicHTMLPreludeState","DynamicState","getDynamicDataPostponedState","getDynamicHTMLPostponedState","getPostponedFromState","isEmptyHTMLPrelude","parsePostponedState","postponed","preludeState","fallbackRouteParams","resumeDataCache","isCacheComponentsEnabled","data","dataString","JSON","stringify","size","length","stringifyResumeDataCache","createRenderResumeDataCache","replacements","Array","from","entries","replacementsString","postponedString","state","interpolatedParams","maxPostponedStateSizeBytes","postponedStringLengthMatch","match","Error","postponedStringLength","parseInt","slice","renderResumeDataCache","type","test","parse","segmentKey","searchValue","dynamicParamType","treeSegment","value","getDynamicParam","replaceAll","err","console","error","createPrerenderResumeDataCache","lengthMatch","replacementsLengthMatch","replacementsLength","isArray"],"mappings":";;;;;;;;;;;;;;;;;;;;IAgEkBA,uBAAuB;eAAvBA;;IAlDNC,YAAY;eAAZA;;IA+FUC,4BAA4B;eAA5BA;;IAhCAC,4BAA4B;eAA5BA;;IA4INC,qBAAqB;eAArBA;;IAiBAC,kBAAkB;eAAlBA;;IAtHAC,mBAAmB;eAAnBA;;;iCAhHgB;iCAOzB;AAGA,IAAA,AAAKL,sCAAAA;IACV;;GAEC;IAGD;;GAEC;WARSA;;AAkDL,IAAA,AAAWD,iDAAAA;;;WAAAA;;AAaX,eAAeG,6BACpBI,SAAyB,EACzBC,YAAqC,EACrCC,mBAAqD,EACrDC,eAAiE,EACjEC,wBAAiC;IAEjC,MAAMC,OAA0C;QAACJ;QAAcD;KAAU;IACzE,MAAMM,aAAaC,KAAKC,SAAS,CAACH;IAElC,6EAA6E;IAC7E,eAAe;IACf,IAAI,CAACH,uBAAuBA,oBAAoBO,IAAI,KAAK,GAAG;QAC1D,oFAAoF;QAC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A,4CAA2B,EAChD8B,IAAAA,+CAA8B;QAElC;IACF;AACF;AAEO,SAAS7C,sBAAsBsB,KAAgC;IACpE,MAAM,CAAClB,cAAcD,UAAU,GAAGmB,MAAMd,IAAI;IAC5C,OAAO;QAAEJ;QAAcD;IAAU;AACnC;AAcO,SAASF,mBAAmBqB,KAAa;IAC9C,IAAI;YACkBA;QAApB,MAAMwB,eAAcxB,eAAAA,MAAMI,KAAK,CAAC,kCAAZJ,YAA2B,CAAC,EAAE;QAClD,IAAI,CAACwB,aAAa;YAChB,OAAO;QACT;QAEA,MAAMjC,SAASgB,SAASiB;QACxB,IAAIzB,kBAAkBC,MAAMQ,KAAK,CAC/BgB,YAAYjC,MAAM,GAAG,GACrBiC,YAAYjC,MAAM,GAAG,IAAIA;QAG3B,+DAA+D;QAC/D,IAAIQ,oBAAoB,QAAQ;YAC9B,OAAO;QACT;QAEA,sEAAsE;QACtE,uEAAuE;QACvE,IAAI,SAASY,IAAI,CAACZ,kBAAkB;gBACFA;YAAhC,MAAM0B,2BAA0B1B,yBAAAA,gBAAgBK,KAAK,CAAC,iCAAtBL,sBAAoC,CAAC,EAAE;YACvE,IAAI,CAAC0B,yBAAyB;gBAC5B,OAAO;YACT;YACA,MAAMC,qBAAqBnB,SAASkB;YACpC1B,kBAAkBA,gBAAgBS,KAAK,CACrCiB,wBAAwBlC,MAAM,GAAGmC;QAErC;QAEA,MAAMxC,OAAOE,KAAKwB,KAAK,CAACb;QACxB,OAAOJ,MAAMgC,OAAO,CAACzC,SAASA,IAAI,CAAC,EAAE;IACvC,EAAE,OAAM;QACN,OAAO;IACT;AACF","ignoreList":[0]} |
@@ -94,3 +94,3 @@ "use strict"; | ||
| } | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.0-canary.66"}`))}${versionSuffix}`); | ||
| _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.0-canary.67"}`))}${versionSuffix}`); | ||
| if (appUrl) { | ||
@@ -97,0 +97,0 @@ _log.bootstrap(`- Local: ${appUrl}`); |
@@ -180,3 +180,3 @@ // Start CPU profile if it wasn't already started. | ||
| let { port } = serverOptions; | ||
| process.title = `next-server (v${"16.3.0-canary.66"})`; | ||
| process.title = `next-server (v${"16.3.0-canary.67"})`; | ||
| let handlersReady = ()=>{}; | ||
@@ -183,0 +183,0 @@ let handlersError = ()=>{}; |
@@ -12,2 +12,3 @@ "use strict"; | ||
| const _nodestream = require("node:stream"); | ||
| const _nodecrypto = require("node:crypto"); | ||
| const _invarianterror = require("../../shared/lib/invariant-error"); | ||
@@ -71,2 +72,3 @@ const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); | ||
| } | ||
| const [element, options] = args; | ||
| // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced | ||
@@ -127,3 +129,7 @@ // input is ready, so anything the serialization below is still awaiting past | ||
| try { | ||
| const { prelude } = await (0, _static.prerenderToNodeStream)(args, clientModules, { | ||
| // We serialize only the `element`. It's the part that needs Flight, to run | ||
| // its async Server Components once and to surface any dynamic input. The | ||
| // `options` are already-resolved plain data; they're folded into the cache | ||
| // key directly and passed to satori as-is below. | ||
| const { prelude } = await (0, _static.prerenderToNodeStream)(element, clientModules, { | ||
| signal: hangingInputAbortSignal, | ||
@@ -159,6 +165,14 @@ filterStackFrame: undefined, | ||
| } | ||
| const buffer = Buffer.concat(chunks); | ||
| // Base64-encode the serialized output to use it as a stable string key | ||
| // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text). | ||
| const cacheKey = buffer.toString('base64'); | ||
| const elementBuffer = Buffer.concat(chunks); | ||
| // Derive a stable cache key from the serialized element plus the options. | ||
| // We hash rather than reuse the raw serialized bytes so the key stays | ||
| // compact even for large inputs (e.g. embedded fonts), and we fold the | ||
| // options in by content so two images that differ only in their options | ||
| // (size, fonts, ...) don't collide. The options are hashed directly here, | ||
| // never serialized through Flight, which would both bloat the key and apply | ||
| // `Buffer.prototype .toJSON` to font data. | ||
| const hash = (0, _nodecrypto.createHash)('sha256'); | ||
| hash.update(elementBuffer); | ||
| updateHashWithOptions(hash, options); | ||
| const cacheKey = hash.digest('base64'); | ||
| const cached = resumeDataCache.imageResponses.get(cacheKey); | ||
@@ -168,14 +182,8 @@ if (cached) { | ||
| } | ||
| // Deserialize the resolved tree and hand it to satori. Because the user's | ||
| // Deserialize the element and hand it to satori. Because the user's | ||
| // components already ran during serialization, satori only walks resolved | ||
| // host elements and never re-runs them, confining user-space I/O to the | ||
| // in-store serialization above. | ||
| // | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedArgs = resolveFlightLazies(await (0, _client.createFromNodeStream)(_nodestream.Readable.from([ | ||
| buffer | ||
| const deserializedElement = await (0, _client.createFromNodeStream)(_nodestream.Readable.from([ | ||
| elementBuffer | ||
| ]), { | ||
@@ -188,3 +196,19 @@ // We don't want to trigger preloads of client references here. | ||
| findSourceMapURL: undefined | ||
| })); | ||
| }); | ||
| // The Flight client hands back the output of an async Server Component as | ||
| // a `React.lazy` (sync components and plain host elements are inlined). | ||
| // satori can't unwrap lazies, so we resolve them into plain elements first. | ||
| // We only reach here once the serialization completed, so every lazy is | ||
| // already resolved and `_init` returns synchronously. | ||
| const resolvedElement = resolveFlightLazies(deserializedElement); | ||
| // Pair the resolved element with the original, in-memory `options`, which | ||
| // never went through Flight. This keeps the font `Buffer` intact: had it | ||
| // been serialized, Flight would apply the `toJSON` method that Node's | ||
| // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }` | ||
| // object that satori's font parser rejects (it needs an `ArrayBuffer` or a | ||
| // typed array). | ||
| const resolvedArgs = [ | ||
| resolvedElement, | ||
| options | ||
| ]; | ||
| // Render satori outside the prerender work-unit store. It does uncached | ||
@@ -204,2 +228,77 @@ // `fetch` calls (e.g. loading a font), and inside a Cache Components | ||
| } | ||
| /** | ||
| * Updates a hash with a stable encoding of the `ImageResponse` options so they | ||
| * can participate in the cache key without being serialized through Flight. | ||
| * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by | ||
| * their raw bytes; objects are walked in sorted-key order. | ||
| * | ||
| * `ImageResponse` options are plain data: numbers, strings, booleans, nested | ||
| * plain objects/arrays, and binary font data. Exotic objects such as `Map` or | ||
| * `Date` keep their state outside their enumerable own keys, so the key walk | ||
| * below would hash them incorrectly. Options never contain these, but we warn | ||
| * if one ever shows up so a mis-keyed cache can be reported. | ||
| * | ||
| * The encoding is self-delimiting: every node starts with a type tag, and | ||
| * variable-length parts (byte runs, primitives, keys) are length-prefixed, | ||
| * while arrays and objects are count-prefixed. This makes it injective, so no | ||
| * concatenation of values can be mistaken for a differently shaped input. | ||
| */ function updateHashWithOptions(hash, value) { | ||
| if (value === undefined) { | ||
| hash.update('u'); | ||
| return; | ||
| } | ||
| if (value === null) { | ||
| hash.update('n'); | ||
| return; | ||
| } | ||
| const type = typeof value; | ||
| if (type !== 'object') { | ||
| // Tag with the primitive type so e.g. the number `1` and the string `'1'` | ||
| // don't hash the same. | ||
| updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`)); | ||
| return; | ||
| } | ||
| if (value instanceof ArrayBuffer) { | ||
| updateHashWithBytes(hash, 'a', new Uint8Array(value)); | ||
| return; | ||
| } | ||
| if (ArrayBuffer.isView(value)) { | ||
| updateHashWithBytes(hash, 'v', new Uint8Array(value.buffer, value.byteOffset, value.byteLength)); | ||
| return; | ||
| } | ||
| if (Array.isArray(value)) { | ||
| hash.update(`[${value.length},`); | ||
| for (const item of value){ | ||
| updateHashWithOptions(hash, item); | ||
| } | ||
| return; | ||
| } | ||
| // The key walk below captures a plain object faithfully, but an exotic object | ||
| // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so | ||
| // two different values would hash the same and could return the wrong cached | ||
| // image. This shouldn't happen for `ImageResponse` options, so we warn rather | ||
| // than fail, then hash best-effort, so it can be reported. Not gated on | ||
| // `NODE_ENV`: this runs during the production `next build` prerender, where | ||
| // the warning is most useful. | ||
| const prototype = Object.getPrototypeOf(value); | ||
| if (prototype !== Object.prototype && prototype !== null) { | ||
| var _value_constructor; | ||
| const typeName = ((_value_constructor = value.constructor) == null ? void 0 : _value_constructor.name) ?? 'object'; | ||
| console.warn(`Cannot reliably include an \`ImageResponse\` option of type ` + `\`${typeName}\` in the cache key, so different images may collide and ` + `return an incorrect cached result. Please report this to the Next.js ` + `team.`); | ||
| } | ||
| const keys = Object.keys(value).sort(); | ||
| hash.update(`{${keys.length},`); | ||
| for (const key of keys){ | ||
| updateHashWithBytes(hash, 'k', Buffer.from(key)); | ||
| updateHashWithOptions(hash, value[key]); | ||
| } | ||
| } | ||
| /** | ||
| * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The | ||
| * length prefix keeps the run self-delimiting so it can't blend into adjacent | ||
| * nodes. | ||
| */ function updateHashWithBytes(hash, tag, bytes) { | ||
| hash.update(`${tag}${bytes.byteLength}:`); | ||
| hash.update(bytes); | ||
| } | ||
| async function renderImageResponseArrayBuffer(args) { | ||
@@ -206,0 +305,0 @@ const OGImageResponse = (await importOgModule()).ImageResponse; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n const { prelude } = await prerenderToNodeStream(args, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const buffer = Buffer.concat(chunks)\n // Base64-encode the serialized output to use it as a stable string key\n // (the Flight stream is binary, so it isn't safe to treat as UTF-8 text).\n const cacheKey = buffer.toString('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the resolved tree and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n //\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedArgs = resolveFlightLazies(\n await createFromNodeStream(\n Readable.from([buffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n ) as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["getCachedImageResponseBody","importOgModule","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","workUnitAsyncStorage","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","workAsyncStorage","InvariantError","hangingInputAbortSignal","createHangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","getClientReferenceManifest","prelude","prerenderToNodeStream","signal","filterStackFrame","onError","error","makeHangingPromise","route","chunks","chunk","push","buffer","Buffer","concat","cacheKey","toString","cached","imageResponses","get","resolvedArgs","resolveFlightLazies","createFromNodeStream","Readable","from","moduleLoading","moduleMap","serverModuleMap","getServerModuleMap","findSourceMapURL","arrayBufferPromise","exit","mutable","set","OGImageResponse","ImageResponse","imageResponse","body","ArrayBuffer","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","Array","isArray","map","element","props","children"],"mappings":";;;;+BA8CgBA;;;eAAAA;;;4BA9CS;gCAEM;0CACE;8CACI;kCACS;uCACX;oCAI5B;wBAE+B;wBAED;AAMrC,SAASC;IACP,0EAA0E;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,0DAA0D;IAC1D,OAAO,MAAM,CAAC;AAChB;AAoBO,SAASD,2BACdE,IAAuB;IAEvB,OAAO,IAAIC,eAA2B;QACpC,MAAMC,OAAMC,UAAU;YACpB,MAAMC,cAAc,MAAMC,kCAAkCL;YAC5D,IAAII,YAAYE,UAAU,GAAG,GAAG;gBAC9BH,WAAWI,OAAO,CAAC,IAAIC,WAAWJ;YACpC;YACAD,W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AAQC,KAAK,EAAE;QAChD,OAAO;YACL,GAAGD,OAAO;YACVC,OAAO;gBACL,GAAGD,QAAQC,KAAK;gBAChBC,UAAU/B,oBAAoB6B,QAAQC,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOV;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/server/og/cache-image-response.ts"],"sourcesContent":["import { Readable } from 'node:stream'\nimport { createHash, type Hash } from 'node:crypto'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { createHangingInputAbortSignal } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n getClientReferenceManifest,\n getServerModuleMap,\n} from '../app-render/manifests-singleton'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { prerenderToNodeStream } from 'react-server-dom-webpack/static'\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createFromNodeStream } from 'react-server-dom-webpack/client'\n\ntype OgModule = typeof import('next/dist/compiled/@vercel/og')\n\ntype ImageResponseArgs = ConstructorParameters<OgModule['ImageResponse']>\n\nfunction importOgModule(): Promise<OgModule> {\n // Cache Components is Node-only (rejected for the edge runtime at compile\n // time), so we always load the Node build. Loading it dynamically keeps the\n // heavy `@vercel/og` renderer (satori + WASM) off the module-load path, so\n // it's pulled in only when an image is actually rendered.\n return import('next/dist/compiled/@vercel/og/index.node.js')\n}\n\n/**\n * Builds the body for a Cache Components `ImageResponse`. The rendered image is\n * cached in the Resume Data Cache during a prerender, so the prospective\n * prerender renders it once and the final prerender retrieves it from memory\n * within microtasks. This lets metadata image routes be statically prerendered\n * under Cache Components instead of being treated as dynamic.\n *\n * The cache boundary is drawn around only the deterministic rasterization of\n * the element tree into an image. The `ImageResponse` element tree is rendered\n * with React Flight once, inside the prerender work-unit store, so any\n * user-space I/O (e.g. `cookies()` or an uncached `fetch`) runs in the correct\n * scope and is subject to the normal Cache Components rules. If that tree\n * needs dynamic input the serialization can't complete, and the route falls\n * back to dynamic. Otherwise the fully resolved tree is handed to satori,\n * which never re-runs the user's components.\n *\n * Outside of a prerender (normal requests) this just renders.\n */\nexport function getCachedImageResponseBody(\n args: ImageResponseArgs\n): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n async start(controller) {\n const arrayBuffer = await getCachedImageResponseArrayBuffer(args)\n if (arrayBuffer.byteLength > 0) {\n controller.enqueue(new Uint8Array(arrayBuffer))\n }\n controller.close()\n },\n })\n}\n\nasync function getCachedImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n // We only cache during a prerender. Metadata image routes compile to\n // route handlers, which use the `prerender` store.\n break\n case undefined:\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-runtime':\n case 'prerender-client':\n case 'validation-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'generate-static-params':\n return renderImageResponseArrayBuffer(args)\n default:\n return workUnitStore satisfies never\n }\n\n const { cacheSignal, resumeDataCache, renderSignal } = workUnitStore\n\n if (!resumeDataCache) {\n return renderImageResponseArrayBuffer(args)\n }\n\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n throw new InvariantError(\n 'Expected a work store while caching an `ImageResponse` during prerendering.'\n )\n }\n\n const [element, options] = args\n\n // `createHangingInputAbortSignal` aborts once the prerender's cache-sourced\n // input is ready, so anything the serialization below is still awaiting past\n // that point can be treated as dynamic (non-cache) input. In the prospective\n // pass it aborts when `cacheSignal.inputReady()` resolves (no cache reads\n // in progress); in the final pass the caches are already filled, so it just\n // aborts on the next tick.\n const hangingInputAbortSignal = createHangingInputAbortSignal(workUnitStore)\n\n // We open the cache read lazily, once we know the serialization completed and\n // we're about to render and store the image. Opening it before serializing\n // would keep `cacheSignal.inputReady()` from resolving and thus prevent the\n // abort signal from ever firing, deadlocking the prospective prerender.\n let readState: 'ready' | 'pending' | 'done' = 'ready'\n\n function beginReadOnce() {\n if (readState === 'ready') {\n readState = 'pending'\n cacheSignal?.beginRead()\n }\n }\n\n function endReadIfStarted() {\n if (readState === 'pending') {\n cacheSignal?.endRead()\n }\n readState = 'done'\n }\n\n // We serialize the element tree with `prerenderToNodeStream` rather than\n // `renderToPipeableStream`. It's the right fit for prerendering, and it\n // schedules work deferred for size (`deferTask`) on microtasks, so a fully\n // static tree finishes flushing before the abort signal fires; a tree still\n // pending at abort time is then genuinely waiting on dynamic input rather\n // than just deferred.\n //\n // `renderToPipeableStream` would schedule that deferred work on\n // `setImmediate` instead, which isn't necessarily a deal-breaker: the\n // sequential-task scheme page rendering uses (`runInSequentialTasks`) drains\n // pending immediates at each task boundary, so deferred work still runs in\n // time. But route handler prerendering doesn't use that scheme, so here the\n // deferred immediates would race the abort.\n //\n // The prerender halts silently on abort, leaving unfulfilled references in\n // place rather than reporting through `onError`. So to tell a halt (the tree\n // needed dynamic input) apart from a normal completion, we record whether the\n // abort fired before the serialization finished. `abort()` runs this listener\n // synchronously, well before we read `resultIsPartial` below.\n let prerenderCompleted = false\n let resultIsPartial = false\n let serializationError: unknown\n\n hangingInputAbortSignal.addEventListener(\n 'abort',\n () => {\n if (!prerenderCompleted) {\n resultIsPartial = true\n }\n },\n { once: true }\n )\n\n const { clientModules, rscModuleMapping } = getClientReferenceManifest()\n\n try {\n // We serialize only the `element`. It's the part that needs Flight, to run\n // its async Server Components once and to surface any dynamic input. The\n // `options` are already-resolved plain data; they're folded into the cache\n // key directly and passed to satori as-is below.\n const { prelude } = await prerenderToNodeStream(element, clientModules, {\n signal: hangingInputAbortSignal,\n filterStackFrame: undefined,\n onError(error) {\n // A halt (our deliberate abort) emits nothing, so this is only called\n // for genuine serialization errors. We surface the first one.\n if (serializationError === undefined && !resultIsPartial) {\n serializationError = error\n }\n },\n })\n\n prerenderCompleted = true\n\n if (serializationError !== undefined) {\n throw serializationError\n }\n\n if (resultIsPartial) {\n // The element tree needed dynamic input (e.g. `cookies()` or an uncached\n // `fetch`), so the image can't be produced statically. Return a hanging\n // promise: the body never resolves, and the final prerender's macrotask\n // budget then classifies the route as dynamic.\n return makeHangingPromise<ArrayBuffer>(\n renderSignal,\n workStore.route,\n 'dynamic `ImageResponse`'\n )\n }\n\n // The serialization finished before any dynamic input was needed, so we\n // will render and cache the image. Hold the cache read now, before the\n // stream is buffered and deserialized below, so that the prospective\n // prerender's `cacheReady()` waits for the image to be stored.\n beginReadOnce()\n\n const chunks: Buffer[] = []\n for await (const chunk of prelude) {\n chunks.push(chunk)\n }\n\n const elementBuffer = Buffer.concat(chunks)\n\n // Derive a stable cache key from the serialized element plus the options.\n // We hash rather than reuse the raw serialized bytes so the key stays\n // compact even for large inputs (e.g. embedded fonts), and we fold the\n // options in by content so two images that differ only in their options\n // (size, fonts, ...) don't collide. The options are hashed directly here,\n // never serialized through Flight, which would both bloat the key and apply\n // `Buffer.prototype .toJSON` to font data.\n const hash = createHash('sha256')\n hash.update(elementBuffer)\n updateHashWithOptions(hash, options)\n const cacheKey = hash.digest('base64')\n\n const cached = resumeDataCache.imageResponses.get(cacheKey)\n\n if (cached) {\n return await cached\n }\n\n // Deserialize the element and hand it to satori. Because the user's\n // components already ran during serialization, satori only walks resolved\n // host elements and never re-runs them, confining user-space I/O to the\n // in-store serialization above.\n const deserializedElement = await createFromNodeStream(\n Readable.from([elementBuffer]),\n {\n // We don't want to trigger preloads of client references here.\n moduleLoading: null,\n moduleMap: rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n },\n { findSourceMapURL: undefined }\n )\n\n // The Flight client hands back the output of an async Server Component as\n // a `React.lazy` (sync components and plain host elements are inlined).\n // satori can't unwrap lazies, so we resolve them into plain elements first.\n // We only reach here once the serialization completed, so every lazy is\n // already resolved and `_init` returns synchronously.\n const resolvedElement = resolveFlightLazies(deserializedElement)\n\n // Pair the resolved element with the original, in-memory `options`, which\n // never went through Flight. This keeps the font `Buffer` intact: had it\n // been serialized, Flight would apply the `toJSON` method that Node's\n // `Buffer` carries, turning it into a `{ type: 'Buffer', data: [...] }`\n // object that satori's font parser rejects (it needs an `ArrayBuffer` or a\n // typed array).\n const resolvedArgs = [resolvedElement, options] as ImageResponseArgs\n\n // Render satori outside the prerender work-unit store. It does uncached\n // `fetch` calls (e.g. loading a font), and inside a Cache Components\n // prerender an uncached `fetch` outside a cache scope becomes a hanging\n // promise. Those are framework fetches, not user I/O, so we let them\n // resolve normally with no store.\n const arrayBufferPromise = workUnitAsyncStorage.exit(() =>\n renderImageResponseArrayBuffer(resolvedArgs)\n )\n\n if (resumeDataCache.mutable) {\n resumeDataCache.imageResponses.set(cacheKey, arrayBufferPromise)\n }\n\n return await arrayBufferPromise\n } finally {\n endReadIfStarted()\n }\n}\n\n/**\n * Updates a hash with a stable encoding of the `ImageResponse` options so they\n * can participate in the cache key without being serialized through Flight.\n * Binary values (font `Buffer`s, `ArrayBuffer`s, typed arrays) are hashed by\n * their raw bytes; objects are walked in sorted-key order.\n *\n * `ImageResponse` options are plain data: numbers, strings, booleans, nested\n * plain objects/arrays, and binary font data. Exotic objects such as `Map` or\n * `Date` keep their state outside their enumerable own keys, so the key walk\n * below would hash them incorrectly. Options never contain these, but we warn\n * if one ever shows up so a mis-keyed cache can be reported.\n *\n * The encoding is self-delimiting: every node starts with a type tag, and\n * variable-length parts (byte runs, primitives, keys) are length-prefixed,\n * while arrays and objects are count-prefixed. This makes it injective, so no\n * concatenation of values can be mistaken for a differently shaped input.\n */\nfunction updateHashWithOptions(hash: Hash, value: unknown): void {\n if (value === undefined) {\n hash.update('u')\n return\n }\n\n if (value === null) {\n hash.update('n')\n return\n }\n\n const type = typeof value\n\n if (type !== 'object') {\n // Tag with the primitive type so e.g. the number `1` and the string `'1'`\n // don't hash the same.\n updateHashWithBytes(hash, 'p', Buffer.from(`${type}:${String(value)}`))\n return\n }\n\n if (value instanceof ArrayBuffer) {\n updateHashWithBytes(hash, 'a', new Uint8Array(value))\n return\n }\n\n if (ArrayBuffer.isView(value)) {\n updateHashWithBytes(\n hash,\n 'v',\n new Uint8Array(value.buffer, value.byteOffset, value.byteLength)\n )\n return\n }\n\n if (Array.isArray(value)) {\n hash.update(`[${value.length},`)\n for (const item of value) {\n updateHashWithOptions(hash, item)\n }\n return\n }\n\n // The key walk below captures a plain object faithfully, but an exotic object\n // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so\n // two different values would hash the same and could return the wrong cached\n // image. This shouldn't happen for `ImageResponse` options, so we warn rather\n // than fail, then hash best-effort, so it can be reported. Not gated on\n // `NODE_ENV`: this runs during the production `next build` prerender, where\n // the warning is most useful.\n const prototype = Object.getPrototypeOf(value)\n if (prototype !== Object.prototype && prototype !== null) {\n const typeName =\n (value as { constructor?: { name?: string } }).constructor?.name ??\n 'object'\n console.warn(\n `Cannot reliably include an \\`ImageResponse\\` option of type ` +\n `\\`${typeName}\\` in the cache key, so different images may collide and ` +\n `return an incorrect cached result. Please report this to the Next.js ` +\n `team.`\n )\n }\n\n const keys = Object.keys(value).sort()\n hash.update(`{${keys.length},`)\n for (const key of keys) {\n updateHashWithBytes(hash, 'k', Buffer.from(key))\n updateHashWithOptions(hash, (value as Record<string, unknown>)[key])\n }\n}\n\n/**\n * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The\n * length prefix keeps the run self-delimiting so it can't blend into adjacent\n * nodes.\n */\nfunction updateHashWithBytes(hash: Hash, tag: string, bytes: Uint8Array): void {\n hash.update(`${tag}${bytes.byteLength}:`)\n hash.update(bytes)\n}\n\nasync function renderImageResponseArrayBuffer(\n args: ImageResponseArgs\n): Promise<ArrayBuffer> {\n const OGImageResponse = (await importOgModule()).ImageResponse\n const imageResponse = new OGImageResponse(...args)\n\n if (!imageResponse.body) {\n return new ArrayBuffer(0)\n }\n\n return imageResponse.arrayBuffer()\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n/**\n * Recursively replaces the `React.lazy` references that Flight emits for\n * resolved async Server Components with the elements they resolve to, so that\n * satori (which doesn't understand lazy nodes) can walk the tree. This must\n * only be called on a fully resolved (completed) Flight result, where each\n * lazy's `_init` returns synchronously rather than suspending.\n */\nfunction resolveFlightLazies(node: unknown): unknown {\n if (node === null || typeof node !== 'object') {\n return node\n }\n\n if ((node as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE) {\n const lazy = node as {\n _init: (payload: unknown) => unknown\n _payload: unknown\n }\n return resolveFlightLazies(lazy._init(lazy._payload))\n }\n\n if (Array.isArray(node)) {\n return node.map(resolveFlightLazies)\n }\n\n const element = node as { props?: { children?: unknown } }\n if (element.props && 'children' in element.props) {\n return {\n ...element,\n props: {\n ...element.props,\n children: resolveFlightLazies(element.props.children),\n },\n }\n }\n\n return node\n}\n"],"names":["getCachedImageResponseBody","importOgModule","args","ReadableStream","start","controller","arrayBuffer","getCachedImageResponseArrayBuffer","byteLength","enqueue","Uint8Array","close","workUnitStore","workUnitAsyncStorage","getStore","type","undefined","renderImageResponseArrayBuffer","cacheSignal","resumeDataCache","renderSignal","workStore","workAsyncStorage","InvariantError","element","options","hangingInputAbortSignal","createHangingInputAbortSignal","readState","beginReadOnce","beginRead","endReadIfStarted","endRead","prerenderCompleted","resultIsPartial","serializationError","addEventListener","once","clientModules","rscModuleMapping","getClientReferenceManifest","prelude","prerenderToNodeStream","signal","filterStackFrame","onError","error","makeHangingPromise","route","chunks","chunk","push","elementBuffer","Buffer","concat","hash","createHash","update","updateHashWithOptions","cacheKey","digest","cached","imageResponses","get","deserializedElement","createFromNodeStream","Readable","from","moduleLoading","moduleMap","serverModuleMap","getServerModuleMap","findSourceMapURL","resolvedElement","resolveFlightLazies","resolvedArgs","arrayBufferPromise","exit","mutable","set","value","updateHashWithBytes","String","ArrayBuffer","isView","buffer","byteOffset","Array","isArray","length","item","prototype","Object","getPrototypeOf","typeName","constructor","name","console","warn","keys","sort","key","tag","bytes","OGImageResponse","ImageResponse","imageResponse","body","REACT_LAZY_TYPE","Symbol","for","node","$$typeof","lazy","_init","_payload","map","props","children"],"mappings":";;;;+BA+CgBA;;;eAAAA;;;4BA/CS;4BACa;gCAEP;0CACE;8CACI;kCACS;uCACX;oCAI5B;wBAE+B;wBAED;AAMrC,SAASC;IACP,0EAA0E;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,0DAA0D;IAC1D,OAAO,MAAM,CAAC;AAChB;AAoBO,SAASD,2BACdE,IAAuB;IAEvB,OAAO,IAAIC,eAA2B;QACpC,MAAMC,OAAMC,UAAU;YACpB,MAAMC,cAAc,MAAMC,kCAAkCL;YAC5D,IAAII,YAAYE,UAAU,GAAG,GAAG;gBAC9BH,WAAWI,OAAO,CAAC,IAAIC,WAAWJ;YACpC;YACAD,WAAWM,KAAK;QAClB;IACF;AACF;AAEA,eAAeJ,kCACbL,IAAuB;IAEvB,MAAMU,gBAAgBC,kDAAoB,CAACC,QAAQ;IAEnD,OAAQF,iCAAAA,cAAeG,IAAI;QACzB,KAAK;YAGH;QACF,KAAKC;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAOC,+BAA+Bf;QACxC;YACE,OAAOU;IACX;IAEA,MAAM,EAAEM,WAAW,EAAEC,eAAe,EAAEC,YAAY,EAAE,GAAGR;IAEvD,IAAI,CAACO,iBAAiB;QACpB,OAAOF,+BAA+Bf;IACxC;IAEA,MAAMmB,YAAYC,0CAAgB,CAACR,QAAQ;IAE3C,IAAI,CAACO,WAAW;QACd,MAAM,qBAEL,CAFK,IAAIE,8BAAc,CACtB,gFADI,qBAAA;mBAAA;wBAAA;0BAAA;QAEN;IACF;IAEA,MAAM,CAACC,SAASC,QAAQ,GAAGvB;IAE3B,4EAA4E;IAC5E,6EAA6E;IAC7E,6EAA6E;IAC7E,0EAA0E;IAC1E,4EAA4E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AMK,OAAOF;QAIb,OAAOrC,oBAAoBuC,KAAKC,KAAK,CAACD,KAAKE,QAAQ;IACrD;IAEA,IAAI5B,MAAMC,OAAO,CAACuB,OAAO;QACvB,OAAOA,KAAKK,GAAG,CAAC1C;IAClB;IAEA,MAAMlD,UAAUuF;IAChB,IAAIvF,QAAQ6F,KAAK,IAAI,cAAc7F,QAAQ6F,KAAK,EAAE;QAChD,OAAO;YACL,GAAG7F,OAAO;YACV6F,OAAO;gBACL,GAAG7F,QAAQ6F,KAAK;gBAChBC,UAAU5C,oBAAoBlD,QAAQ6F,KAAK,CAACC,QAAQ;YACtD;QACF;IACF;IAEA,OAAOP;AACT","ignoreList":[0]} |
@@ -141,3 +141,4 @@ /** | ||
| SubtreeHasRuntimePrefetch = 2048, | ||
| SubtreeHasEagerPrefetch = 4096 | ||
| SubtreeHasEagerPrefetch = 4096, | ||
| SubtreeHasInstantFalse = 8192 | ||
| } | ||
@@ -144,0 +145,0 @@ /** |
@@ -86,6 +86,12 @@ /** | ||
| PrefetchHint[PrefetchHint["SubtreeHasEagerPrefetch"] = 4096] = "SubtreeHasEagerPrefetch"; | ||
| // This segment or one of its descendants exports `instant = false`, | ||
| // explicitly opting out of Partial Prefetching. Propagates upward so the root | ||
| // reflects the entire subtree. Used only to suppress the dev-time | ||
| // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect | ||
| // on the actual prefetch behavior. | ||
| PrefetchHint[PrefetchHint["SubtreeHasInstantFalse"] = 8192] = "SubtreeHasInstantFalse"; | ||
| return PrefetchHint; | ||
| }({}); | ||
| const StaticPrefetchDisabled = 1 | 1024; | ||
| const SubtreePrefetchHints = 2 | 8 | 2048 | 4096; | ||
| const SubtreePrefetchHints = 2 | 8 | 2048 | 8192 | 4096; | ||
| function propagateSubtreeBits(parentHints, childHints) { | ||
@@ -109,2 +115,7 @@ if (childHints & 2) { | ||
| } | ||
| // And for `instant = false`. Like eager prefetch, the bit is set directly on | ||
| // each opted-out segment, so propagate it as-is. | ||
| if (childHints & 8192) { | ||
| parentHints |= 8192; | ||
| } | ||
| return parentHints; | ||
@@ -111,0 +122,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;;;;;;;IAiLiBA,YAAY;eAAZA;;IA6DLC,sBAAsB;eAAtBA;;IASAC,oBAAoB;eAApBA;;IAiBGC,oBAAoB;eAApBA;;;AAvFT,IAAA,AAAWH,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;WAhDxBA;;AA6DX,MAAMC,yBACXD;AAQK,MAAME,uBACXF;AAgBK,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} | ||
| {"version":3,"sources":["../../../src/shared/lib/app-router-types.ts"],"sourcesContent":["/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\n\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\nimport type { VaryParamsIterable } from './segment-cache/vary-params-decoding'\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\n/**\n * Cache node used in app-router / layout-router.\n */\n\nexport type CacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty. When it is\n * null, it represents missing data, and rendering should suspend.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n slots: Record<string, CacheNode> | null\n\n /**\n * A shared mutable ref that tracks whether this segment should be scrolled\n * to. All new segments created during a single navigation share the same\n * ref. When any segment's scroll handler fires, it sets `current` to\n * `false` so no other segment scrolls for the same navigation.\n *\n * `null` means this segment is not a scroll target (e.g., a reused shared\n * layout segment).\n */\n scrollRef: ScrollRef | null\n\n /**\n * Globally-unique identifier minted from a monotonic counter when the\n * CacheNode is freshly created. Surfaced to user code as a string via\n * `useRouter().bfcacheId` and intended to be used as a React `key` to\n * opt out of Activity-based state preservation on fresh navigations.\n *\n * Preserved when the CacheNode is reused (shared layouts, refresh,\n * search/hash-only navigations) or restored from the BFCache during a\n * back/forward navigation.\n */\n bfcacheId: number\n}\n\n/**\n * A mutable ref shared across all new segments created during a single\n * navigation. Used to ensure that only one segment scrolls per navigation.\n */\nexport type ScrollRef = { current: boolean }\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted-(..)(..)'\n | 'catchall-intercepted-(.)'\n | 'catchall-intercepted-(..)'\n | 'catchall-intercepted-(...)'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted-(..)(..)'\n | 'dynamic-intercepted-(.)'\n | 'dynamic-intercepted-(..)'\n | 'dynamic-intercepted-(...)'\n\nexport type DynamicParamTypesShort =\n | 'c'\n | 'ci(..)(..)'\n | 'ci(.)'\n | 'ci(..)'\n | 'ci(...)'\n | 'oc'\n | 'd'\n | 'di(..)(..)'\n | 'di(.)'\n | 'di(..)'\n | 'di(...)'\n\n// The tuple form of a segment, used for dynamic route params\nexport type DynamicSegmentTuple = [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n // Static sibling segments at the same URL level. Used by the client\n // router to determine if a prefetch can be reused when navigating to\n // a static sibling of a dynamic route. For example, if the route is\n // /products/[id] and there's also /products/sale, then staticSiblings\n // would be ['sale']. null means the siblings are unknown (e.g. in\n // webpack dev mode).\n staticSiblings: readonly string[] | null,\n]\n\nexport type Segment = string | DynamicSegmentTuple\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n refreshState?: CompressedRefreshState | null,\n /**\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?: 'refetch' | 'inside-shared-layout' | 'metadata-only' | null,\n /**\n * Bitmask of PrefetchHint flags. Encodes route structure metadata:\n * root layout, loading boundaries, instant configs, and runtime prefetch\n * hints. Only set when non-zero.\n */\n prefetchHints?: number,\n]\n\n/**\n * When rendering a parallel route, some of the parallel paths may not match\n * the current URL. In that case, the Next client has to render something,\n * so it will render whichever was the last route to match that slot. We use\n * this type to track when this has happened. It's a tuple of the original\n * URL that was used to fetch the segment, and the (possibly rewritten) search\n * query that was rendered by the server. The URL is needed when performing\n * a refresh of the segment, and the search query is needed for looking up\n * matching entries in the segment cache.\n */\nexport type CompressedRefreshState = [url: string, renderedSearch: string]\n\nexport const enum PrefetchHint {\n // This segment has a runtime prefetch enabled (via instant with\n // prefetch: 'runtime'). Per-segment only, does not propagate to ancestors.\n HasRuntimePrefetch = 0b00001,\n // This segment or one of its descendants opts into Partial Prefetching.\n // Currently set when a truthy instant config is present on any\n // segment in the subtree (regardless of prefetch mode). Propagates upward\n // so the root segment reflects the entire subtree.\n SubtreeHasPartialPrefetching = 0b00010,\n // This segment itself has a loading.tsx boundary.\n SegmentHasLoadingBoundary = 0b00100,\n // A descendant segment (but not this one) has a loading.tsx boundary.\n // Propagates upward so the root reflects the entire subtree.\n SubtreeHasLoadingBoundary = 0b01000,\n // This segment is at or above the application's root layout — the root layout\n // segment itself and all of its ancestors. A dynamic param in one of these\n // segments is a \"root param\".\n IsRootLayoutOrAbove = 0b10000,\n // This segment's response includes its parent's data inlined into it.\n // Set at build time by the segment size measurement pass.\n ParentInlinedIntoSelf = 0b100000,\n // This segment's data is inlined into one of its children — don't fetch\n // it separately. Set at build time by the segment size measurement pass.\n InlinedIntoChild = 0b1000000,\n // On a __PAGE__: this page's response includes the head (metadata/viewport)\n // at the end of its SegmentPrefetch[] array.\n HeadInlinedIntoSelf = 0b10000000,\n // On the root hint node: the head was NOT inlined into any page — fetch\n // it separately. Absence of this bit means the head is bundled into a page.\n HeadOutlined = 0b100000000,\n // The inlining hints in this tree may be stale because the tree was\n // generated before collectPrefetchHints ran (e.g. the initial RSC payload\n // for a fully static page at build time). When writing this tree into the\n // cache, the route entry should be immediately expired so it gets\n // re-fetched with correct hints. Only set during build-time prerendering,\n // never at runtime.\n InliningHintsStale = 0b1000000000,\n // This segment has instant = false, opting out of all\n // prefetching entirely (neither static nor runtime).\n PrefetchDisabled = 0b10000000000,\n // This segment or one of its descendants has runtime prefetch enabled\n // (HasRuntimePrefetch). Propagates upward so the root reflects the\n // entire subtree.\n SubtreeHasRuntimePrefetch = 0b100000000000,\n // This segment or one of its descendants prefetches \"eagerly\" — i.e. its\n // effective prefetch strategy is anything other than 'partial' or\n // 'allow-runtime'. Used by App Shells: a non-eager subtree relies on the\n // shared app shell and skips its Speculative prefetch. Propagates upward so\n // the root reflects the entire subtree.\n SubtreeHasEagerPrefetch = 0b1000000000000,\n // This segment or one of its descendants exports `instant = false`,\n // explicitly opting out of Partial Prefetching. Propagates upward so the root\n // reflects the entire subtree. Used only to suppress the dev-time\n // `<Link prefetch={true}>` warning — unlike PrefetchDisabled, it has no effect\n // on the actual prefetch behavior.\n SubtreeHasInstantFalse = 0b10000000000000,\n}\n\n/**\n * Bitmask for checking whether a segment's static prefetch is skipped. Matches\n * if EITHER bit is set — i.e. the segment uses runtime prefetching\n * (HasRuntimePrefetch) OR prefetching is disabled entirely (PrefetchDisabled,\n * e.g. instant = false). The segment participates in the bundle chain\n * but with null data.\n *\n * Usage: `(hints & StaticPrefetchDisabled) !== 0`\n */\nexport const StaticPrefetchDisabled =\n PrefetchHint.HasRuntimePrefetch | PrefetchHint.PrefetchDisabled\n\n/**\n * The subset of PrefetchHint bits that propagate upward from a child segment to\n * its ancestors (as opposed to segment-local bits like SegmentHasLoadingBoundary\n * or IsRootLayoutOrAbove). Used to clear stale propagated bits before re-deriving them\n * from a node's children.\n */\nexport const SubtreePrefetchHints =\n PrefetchHint.SubtreeHasPartialPrefetching |\n PrefetchHint.SubtreeHasLoadingBoundary |\n PrefetchHint.SubtreeHasRuntimePrefetch |\n PrefetchHint.SubtreeHasInstantFalse |\n PrefetchHint.SubtreeHasEagerPrefetch\n\n/**\n * Folds a child segment's prefetch hints into its parent's, propagating the\n * \"subtree\" flags. A child's segment-local flag (e.g. it has a loading boundary,\n * or it has a runtime prefetch) becomes the corresponding \"subtree\" flag on the\n * parent, so the root segment ends up reflecting the entire subtree.\n *\n * Used wherever a route tree is assembled bottom-up: on the server when building\n * a prefetch tree (createFlightRouterStateFromLoaderTree) and on the client when\n * merging a navigation patch into the existing tree (convertServerPatchToFullTree).\n * Keep these in sync by routing both through this helper.\n */\nexport function propagateSubtreeBits(\n parentHints: number,\n childHints: number\n): number {\n if (childHints & PrefetchHint.SubtreeHasPartialPrefetching) {\n parentHints |= PrefetchHint.SubtreeHasPartialPrefetching\n }\n // A child with a loading boundary (directly, or anywhere in its subtree) makes\n // this a SubtreeHasLoadingBoundary on the parent.\n if (\n childHints &\n (PrefetchHint.SegmentHasLoadingBoundary |\n PrefetchHint.SubtreeHasLoadingBoundary)\n ) {\n parentHints |= PrefetchHint.SubtreeHasLoadingBoundary\n }\n // Likewise for runtime prefetch.\n if (\n childHints &\n (PrefetchHint.HasRuntimePrefetch | PrefetchHint.SubtreeHasRuntimePrefetch)\n ) {\n parentHints |= PrefetchHint.SubtreeHasRuntimePrefetch\n }\n // And for eager prefetch. The bit is set directly on each eager segment, so\n // there's no separate segment-local flag — propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasEagerPrefetch) {\n parentHints |= PrefetchHint.SubtreeHasEagerPrefetch\n }\n // And for `instant = false`. Like eager prefetch, the bit is set directly on\n // each opted-out segment, so propagate it as-is.\n if (childHints & PrefetchHint.SubtreeHasInstantFalse) {\n parentHints |= PrefetchHint.SubtreeHasInstantFalse\n }\n return parentHints\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n // TODO: This field is no longer used. Remove it.\n loading: null,\n isPartial: boolean,\n /**\n * An AsyncIterable that yields the route params this segment accessed during\n * server rendering (one name per yield, deduped). Used by the client router\n * to determine cache key specificity - segments that only access certain\n * params can be reused across navigations where unaccessed params change.\n *\n * Does NOT include root params; those are emitted once at the top level of\n * the response (see `r` on the payload) and unioned in by the consumer.\n *\n * - null: tracking was not enabled for this render (e.g., not a prerender).\n * Treat conservatively - assume all params vary.\n * - Drains to empty Set: segment accesses no params (e.g., client components,\n * or server components that don't read params). Can be shared across all\n * param values.\n * - Drains to non-empty Set: segment depends on those params. Can only reuse\n * when those specific params match.\n */\n varyParams: VaryParamsIterable | null,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\n/**\n * Per-route prefetch hints computed at build time. Mirrors the shape of the\n * loader tree so hints can be traversed in parallel during router state\n * creation. Each node stores a bitmask of PrefetchHint flags\n * (ParentInlinedIntoSelf, InlinedIntoChild) computed by the segment size\n * measurement pass.\n *\n * Persisted to prefetch-hints.json as Record<string, PrefetchHints> (keyed\n * by route pattern) and loaded at server startup.\n */\nexport type PrefetchHints = {\n /** Bitmask of PrefetchHint flags for this segment. */\n hints: number\n /** Child hint nodes, keyed by parallel route key. */\n slots: Record<string, PrefetchHints> | null\n}\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** supportsPerSegmentPrefetching */\n S: boolean\n /**\n * headVaryParams - vary params for the head (metadata) of the response.\n * Does not include root params (see `r`).\n */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params, rather than the server folding them into each set.\n */\n r?: VaryParamsIterable\n /** staleTime in seconds - Only present when Cache Components is enabled. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** supportsPerSegmentPrefetching */\n S: boolean\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** staleTime - Only present in dynamic runtime prefetch responses. */\n s?: AsyncIterable<number>\n /** staticStageByteLength - Resolves when the static stage ends. */\n l?: Promise<number>\n /**\n * shellByteLength - Resolves when the shell stage ends.\n * If it resolves to null, then the shell is the same as the main response.\n * */\n a?: Promise<number | null>\n /**\n * shellUsedSessionData - true if resolving session data\n * unblocked new content in the shell.\n * NOTE: only use this in runtime/session prefetch requests\n * where we have a proper session shell.\n * */\n u?: Promise<boolean>\n /** headVaryParams. Does not include root params (see `r`). */\n h: VaryParamsIterable | null\n /**\n * rootVaryParams - the root params accessed anywhere in the response, emitted\n * once. The client unions these into the head and every segment's vary\n * params.\n */\n r?: VaryParamsIterable\n /** runtimePrefetchStream — Embedded runtime prefetch Flight stream. */\n p?: ReadableStream<Uint8Array>\n /**\n * dynamicStaleTime — Per-page BFCache stale time in seconds, from\n * `unstable_dynamicStaleTime`. Only included for dynamic renders. Controls\n * how long the client router cache retains dynamic navigation data. This is\n * distinct from the `s` field, which controls segment cache (prefetch)\n * staleness.\n */\n d?: number\n /**\n * revealAfter (dev only). Resolves once the server has flushed the\n * shell-stage content to the stream (static shell, or runtime-prefetchable\n * shell for runtime-prefetch routes), or earlier on a cache miss. The client\n * decodes this from the payload and defers resolving the response's deferred\n * RSCs on it, so a boundary's children aren't revealed before their row has\n * been decoded (which would flush a premature Suspense fallback). Its\n * resolution row follows the children's row in the payload, so the children\n * are decoded by the time the client unblocks. The HTML render gates on the\n * same signal server-side instead of reading this field.\n */\n _revealAfter?: Promise<void>\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId, can be empty if the x-nextjs-build-id header is set */\n b?: string\n /** flightData */\n f: FlightData\n /** renderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n\nexport type InstantCookie =\n // pending (waiting to capture)\n | [captured: 0, id: string]\n // captured MPA page load\n | [captured: 1, id: string, state: null]\n // captured SPA navigation (from/to route trees)\n | [\n captured: 1,\n id: string,\n state: { from: FlightRouterState; to: FlightRouterState | null },\n ]\n"],"names":["PrefetchHint","StaticPrefetchDisabled","SubtreePrefetchHints","propagateSubtreeBits","parentHints","childHints"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;;;;;;;IAiLiBA,YAAY;eAAZA;;IAmELC,sBAAsB;eAAtBA;;IASAC,oBAAoB;eAApBA;;IAkBGC,oBAAoB;eAApBA;;;AA9FT,IAAA,AAAWH,sCAAAA;IAChB,gEAAgE;IAChE,2EAA2E;;IAE3E,wEAAwE;IACxE,+DAA+D;IAC/D,0EAA0E;IAC1E,mDAAmD;;IAEnD,kDAAkD;;IAElD,sEAAsE;IACtE,6DAA6D;;IAE7D,8EAA8E;IAC9E,2EAA2E;IAC3E,8BAA8B;;IAE9B,sEAAsE;IACtE,0DAA0D;;IAE1D,wEAAwE;IACxE,yEAAyE;;IAEzE,4EAA4E;IAC5E,6CAA6C;;IAE7C,wEAAwE;IACxE,4EAA4E;;IAE5E,oEAAoE;IACpE,0EAA0E;IAC1E,0EAA0E;IAC1E,kEAAkE;IAClE,0EAA0E;IAC1E,oBAAoB;;IAEpB,sDAAsD;IACtD,qDAAqD;;IAErD,sEAAsE;IACtE,mEAAmE;IACnE,kBAAkB;;IAElB,yEAAyE;IACzE,kEAAkE;IAClE,yEAAyE;IACzE,4EAA4E;IAC5E,wCAAwC;;IAExC,oEAAoE;IACpE,8EAA8E;IAC9E,kEAAkE;IAClE,+EAA+E;IAC/E,mCAAmC;;WAtDnBA;;AAmEX,MAAMC,yBACXD;AAQK,MAAME,uBACXF;AAiBK,SAASG,qBACdC,WAAmB,EACnBC,UAAkB;IAElB,IAAIA,gBAAwD;QAC1DD;IACF;IACA,+EAA+E;IAC/E,kDAAkD;IAClD,IACEC,aACCL,CAAAA,KACsC,GACvC;QACAI;IACF;IACA,iCAAiC;IACjC,IACEC,aACCL,CAAAA,QAAuE,GACxE;QACAI;IACF;IACA,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAIC,mBAAmD;QACrDD;IACF;IACA,6EAA6E;IAC7E,iDAAiD;IACjD,IAAIC,mBAAkD;QACpDD;IACF;IACA,OAAOA;AACT","ignoreList":[0]} |
@@ -24,3 +24,3 @@ "use strict"; | ||
| function isStableBuild() { | ||
| return !"16.3.0-canary.66"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| return !"16.3.0-canary.67"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV; | ||
| } | ||
@@ -27,0 +27,0 @@ class CanaryOnlyConfigError extends Error { |
@@ -84,3 +84,3 @@ "use strict"; | ||
| ciName: _ciinfo.isCI && _ciinfo.name || null, | ||
| nextVersion: "16.3.0-canary.66" | ||
| nextVersion: "16.3.0-canary.67" | ||
| }; | ||
@@ -87,0 +87,0 @@ return traits; |
@@ -14,7 +14,7 @@ "use strict"; | ||
| // This should be an invariant, if it fails our build tooling is broken. | ||
| if (typeof "16.3.0-canary.66" !== 'string') { | ||
| if (typeof "16.3.0-canary.67" !== 'string') { | ||
| return []; | ||
| } | ||
| const payload = { | ||
| nextVersion: "16.3.0-canary.66", | ||
| nextVersion: "16.3.0-canary.67", | ||
| nodeVersion: process.version, | ||
@@ -21,0 +21,0 @@ cliCommand: event.cliCommand, |
@@ -41,3 +41,3 @@ "use strict"; | ||
| payload: { | ||
| nextVersion: "16.3.0-canary.66", | ||
| nextVersion: "16.3.0-canary.67", | ||
| glibcVersion, | ||
@@ -44,0 +44,0 @@ installedSwcPackages, |
@@ -15,3 +15,3 @@ "use strict"; | ||
| // This should be an invariant, if it fails our build tooling is broken. | ||
| if (typeof "16.3.0-canary.66" !== 'string') { | ||
| if (typeof "16.3.0-canary.67" !== 'string') { | ||
| return []; | ||
@@ -21,3 +21,3 @@ } | ||
| const payload = { | ||
| nextVersion: "16.3.0-canary.66", | ||
| nextVersion: "16.3.0-canary.67", | ||
| nodeVersion: process.version, | ||
@@ -24,0 +24,0 @@ cliCommand: event.cliCommand, |
+10
-10
| { | ||
| "name": "next", | ||
| "version": "16.3.0-canary.66", | ||
| "version": "16.3.0-canary.67", | ||
| "description": "The React Framework", | ||
@@ -84,3 +84,3 @@ "main": "./dist/server/next.js", | ||
| "dependencies": { | ||
| "@next/env": "16.3.0-canary.66", | ||
| "@next/env": "16.3.0-canary.67", | ||
| "@swc/helpers": "0.5.15", | ||
@@ -116,10 +116,10 @@ "baseline-browser-mapping": "^2.9.19", | ||
| "sharp": "^0.34.5", | ||
| "@next/swc-darwin-arm64": "16.3.0-canary.66", | ||
| "@next/swc-darwin-x64": "16.3.0-canary.66", | ||
| "@next/swc-linux-arm64-gnu": "16.3.0-canary.66", | ||
| "@next/swc-linux-arm64-musl": "16.3.0-canary.66", | ||
| "@next/swc-linux-x64-gnu": "16.3.0-canary.66", | ||
| "@next/swc-linux-x64-musl": "16.3.0-canary.66", | ||
| "@next/swc-win32-arm64-msvc": "16.3.0-canary.66", | ||
| "@next/swc-win32-x64-msvc": "16.3.0-canary.66" | ||
| "@next/swc-darwin-arm64": "16.3.0-canary.67", | ||
| "@next/swc-darwin-x64": "16.3.0-canary.67", | ||
| "@next/swc-linux-arm64-gnu": "16.3.0-canary.67", | ||
| "@next/swc-linux-arm64-musl": "16.3.0-canary.67", | ||
| "@next/swc-linux-x64-gnu": "16.3.0-canary.67", | ||
| "@next/swc-linux-x64-musl": "16.3.0-canary.67", | ||
| "@next/swc-win32-arm64-msvc": "16.3.0-canary.67", | ||
| "@next/swc-win32-x64-msvc": "16.3.0-canary.67" | ||
| }, | ||
@@ -126,0 +126,0 @@ "keywords": [ |
| self.__BUILD_MANIFEST = { | ||
| "__rewrites": { | ||
| "afterFiles": [], | ||
| "beforeFiles": [], | ||
| "fallback": [] | ||
| }, | ||
| "sortedPages": [ | ||
| "/_app", | ||
| "/_error" | ||
| ] | ||
| };self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() |
| self.__MIDDLEWARE_MATCHERS = [];self.__MIDDLEWARE_MATCHERS_CB && self.__MIDDLEWARE_MATCHERS_CB() |
| self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 6 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 6 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
169165137
0.05%1276660
0.03%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated