next 15.2.1-canary.1 → 15.2.1-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/handle-externals.d.ts +2 -3
- package/dist/build/handle-externals.js +4 -4
- package/dist/build/handle-externals.js.map +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack/plugins/build-manifest-plugin.js +3 -5
- package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/css-minimizer-plugin.js +2 -2
- package/dist/build/webpack/plugins/css-minimizer-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js +2 -2
- package/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js.map +1 -1
- package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.d.ts +1 -3
- package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +5 -6
- package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
- package/dist/build/webpack/utils.d.ts +3 -1
- package/dist/build/webpack/utils.js +10 -0
- package/dist/build/webpack/utils.js.map +1 -1
- package/dist/build/webpack-config.js +2 -4
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/react-dev-overlay/server/shared.d.ts +0 -3
- package/dist/client/components/react-dev-overlay/server/shared.js.map +1 -1
- package/dist/client/components/react-dev-overlay/ui/styles/colors.js +1 -1
- package/dist/client/components/react-dev-overlay/ui/styles/colors.js.map +1 -1
- package/dist/client/components/react-dev-overlay/utils/stack-frame.d.ts +11 -3
- package/dist/client/components/react-dev-overlay/utils/stack-frame.js +2 -5
- package/dist/client/components/react-dev-overlay/utils/stack-frame.js.map +1 -1
- package/dist/client/components/router-reducer/reducers/navigate-reducer.js +29 -9
- package/dist/client/components/router-reducer/reducers/navigate-reducer.js.map +1 -1
- package/dist/client/components/segment-cache/navigation.d.ts +5 -1
- package/dist/client/components/segment-cache/navigation.js +28 -19
- package/dist/client/components/segment-cache/navigation.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/esm/build/handle-externals.js +4 -4
- package/dist/esm/build/handle-externals.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +3 -5
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/css-minimizer-plugin.js +2 -2
- package/dist/esm/build/webpack/plugins/css-minimizer-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/minify-webpack-plugin/src/index.js +2 -2
- package/dist/esm/build/webpack/plugins/minify-webpack-plugin/src/index.js.map +1 -1
- package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js +5 -6
- package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
- package/dist/esm/build/webpack/utils.js +6 -0
- package/dist/esm/build/webpack/utils.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -4
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/shared.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/styles/colors.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/styles/colors.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/utils/stack-frame.js +2 -5
- package/dist/esm/client/components/react-dev-overlay/utils/stack-frame.js.map +1 -1
- package/dist/esm/client/components/router-reducer/reducers/navigate-reducer.js +29 -9
- package/dist/esm/client/components/router-reducer/reducers/navigate-reducer.js.map +1 -1
- package/dist/esm/client/components/segment-cache/navigation.js +28 -19
- package/dist/esm/client/components/segment-cache/navigation.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/server-external-packages.json +4 -0
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/lib/server-external-packages.json +4 -0
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport type {\n CacheNode,\n HeadData,\n LoadingModuleData,\n} from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n listenForDynamicRequest,\n type Task as PPRNavigationTask,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl as createCanonicalUrl } from '../router-reducer/create-href-from-url'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n readSegmentCacheEntry,\n waitForSegmentCacheEntry,\n type RouteTree,\n} from './cache'\nimport { createCacheKey } from './cache-key'\n\nexport const enum NavigationResultTag {\n MPA,\n Success,\n NoOp,\n Async,\n}\n\ntype MPANavigationResult = {\n tag: NavigationResultTag.MPA\n data: string\n}\n\ntype NoOpNavigationResult = {\n tag: NavigationResultTag.NoOp\n data: null\n}\n\ntype SuccessfulNavigationResult = {\n tag: NavigationResultTag.Success\n data: {\n flightRouterState: FlightRouterState\n cacheNode: CacheNode\n canonicalUrl: string\n scrollableSegments: Array<FlightSegmentPath>\n shouldScroll: boolean\n }\n}\n\ntype AsyncNavigationResult = {\n tag: NavigationResultTag.Async\n data: Promise<\n MPANavigationResult | NoOpNavigationResult | SuccessfulNavigationResult\n >\n}\n\nexport type NavigationResult =\n | MPANavigationResult\n | SuccessfulNavigationResult\n | NoOpNavigationResult\n | AsyncNavigationResult\n\nconst noOpNavigationResult: NoOpNavigationResult = {\n tag: NavigationResultTag.NoOp,\n data: null,\n}\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 url: URL,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n shouldScroll: boolean\n): NavigationResult {\n const now = Date.now()\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n const snapshot = readRenderSnapshotFromCache(now, route.tree)\n const prefetchFlightRouterState = snapshot.flightRouterState\n const prefetchSeedData = snapshot.seedData\n const prefetchHead = route.head\n const isPrefetchHeadPartial = route.isHeadPartial\n const canonicalUrl = route.canonicalUrl\n return navigateUsingPrefetchedRouteTree(\n url,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n canonicalUrl,\n shouldScroll\n )\n }\n // There's no matching prefetch for this route in the cache.\n return {\n tag: NavigationResultTag.Async,\n data: navigateDynamicallyWithNoPrefetch(\n url,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n shouldScroll\n ),\n }\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n url: URL,\n nextUrl: string | null,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n prefetchFlightRouterState: FlightRouterState,\n prefetchSeedData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n canonicalUrl: string,\n shouldScroll: boolean\n): SuccessfulNavigationResult | NoOpNavigationResult | MPANavigationResult {\n // Recursively construct a prefetch tree by reading from the Segment Cache. To\n // maintain compatibility, we output the same data structures as the old\n // prefetching implementation: FlightRouterState and CacheNodeSeedData.\n // TODO: Eventually updateCacheNodeOnNavigation (or the equivalent) should\n // read from the Segment Cache directly. It's only structured this way for now\n // so we can share code with the old prefetching implementation.\n const scrollableSegments: Array<FlightSegmentPath> = []\n const task = startPPRNavigation(\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n scrollableSegments\n )\n if (task !== null) {\n const dynamicRequestTree = task.dynamicRequestTree\n if (dynamicRequestTree !== null) {\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll\n )\n }\n // The server sent back an empty tree patch. There's nothing to update.\n return noOpNavigationResult\n}\n\nfunction navigationTaskToResult(\n task: PPRNavigationTask,\n currentCacheNode: CacheNode,\n canonicalUrl: string,\n scrollableSegments: Array<FlightSegmentPath>,\n shouldScroll: boolean\n): SuccessfulNavigationResult | MPANavigationResult {\n const flightRouterState = task.route\n if (flightRouterState === null) {\n // When no router state is provided, it signals that we should perform an\n // MPA navigation.\n return {\n tag: NavigationResultTag.MPA,\n data: canonicalUrl,\n }\n }\n const newCacheNode = task.node\n return {\n tag: NavigationResultTag.Success,\n data: {\n flightRouterState,\n cacheNode: newCacheNode !== null ? newCacheNode : currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll,\n },\n }\n}\n\nfunction readRenderSnapshotFromCache(\n now: number,\n tree: RouteTree\n): { flightRouterState: FlightRouterState; seedData: CacheNodeSeedData } {\n let childRouterStates: { [parallelRouteKey: string]: FlightRouterState } = {}\n let childSeedDatas: {\n [parallelRouteKey: string]: CacheNodeSeedData | null\n } = {}\n const slots = tree.slots\n if (slots !== null) {\n for (const parallelRouteKey in slots) {\n const childTree = slots[parallelRouteKey]\n const childResult = readRenderSnapshotFromCache(now, childTree)\n childRouterStates[parallelRouteKey] = childResult.flightRouterState\n childSeedDatas[parallelRouteKey] = childResult.seedData\n }\n }\n\n let rsc: React.ReactNode | null = null\n let loading: LoadingModuleData | Promise<LoadingModuleData> = null\n let isPartial: boolean = true\n\n const segmentEntry = readSegmentCacheEntry(now, tree.key)\n if (segmentEntry !== null) {\n switch (segmentEntry.status) {\n case EntryStatus.Fulfilled: {\n // Happy path: a cache hit\n rsc = segmentEntry.rsc\n loading = segmentEntry.loading\n isPartial = segmentEntry.isPartial\n break\n }\n case EntryStatus.Pending: {\n // We haven't received data for this segment yet, but there's already\n // an in-progress request. Since it's extremely likely to arrive\n // before the dynamic data response, we might as well use it.\n const promiseForFulfilledEntry = waitForSegmentCacheEntry(segmentEntry)\n rsc = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.rsc : null\n )\n loading = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.loading : null\n )\n // Since we don't know yet whether the segment is partial or fully\n // static, we must assume it's partial; we can't skip the\n // dynamic request.\n isPartial = true\n break\n }\n case EntryStatus.Empty:\n case EntryStatus.Rejected:\n break\n default:\n segmentEntry satisfies never\n }\n }\n\n return {\n flightRouterState: [\n tree.segment,\n childRouterStates,\n null,\n null,\n tree.isRootLayout,\n ],\n seedData: [tree.segment, rsc, childSeedDatas, loading, isPartial],\n }\n}\n\nasync function navigateDynamicallyWithNoPrefetch(\n url: URL,\n nextUrl: string | null,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n shouldScroll: boolean\n): Promise<\n MPANavigationResult | SuccessfulNavigationResult | NoOpNavigationResult\n> {\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 const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: currentFlightRouterState,\n nextUrl,\n })\n const { flightData, canonicalUrl: canonicalUrlOverride } =\n await promiseForDynamicServerResponse\n\n // TODO: Detect if the only thing that changed was the hash, like we do in\n // in navigateReducer\n\n if (typeof flightData === 'string') {\n // This is an MPA navigation.\n const newUrl = flightData\n return {\n tag: NavigationResultTag.MPA,\n data: newUrl,\n }\n }\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 prefetchFlightRouterState = simulatePrefetchTreeUsingDynamicTreePatch(\n currentFlightRouterState,\n flightData\n )\n\n // In our simulated prefetch payload, we pretend that there's no seed data\n // nor a prefetch head.\n const prefetchSeedData = null\n const prefetchHead = null\n const isPrefetchHeadPartial = true\n\n const canonicalUrl = createCanonicalUrl(\n canonicalUrlOverride ? canonicalUrlOverride : url\n )\n\n // Now we proceed exactly as we would for normal navigation.\n const scrollableSegments: Array<FlightSegmentPath> = []\n const task = startPPRNavigation(\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n scrollableSegments\n )\n if (task !== null) {\n // In this case, we've already sent the dynamic request, so we don't\n // actually use the request tree created by `startPPRNavigation`,\n // except to check if it contains dynamic holes.\n //\n // This is almost always true, but it could be false if all the segment data\n // was present in the cache, but the route tree was not. E.g. navigating\n // to a URL that was not prefetched but rewrites to a different URL\n // that was.\n const hasDynamicHoles = task.dynamicRequestTree !== null\n if (hasDynamicHoles) {\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We don't need to process the server response further.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll\n )\n }\n // The server sent back an empty tree patch. There's nothing to update.\n return noOpNavigationResult\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatch(\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData>\n): FlightRouterState {\n // Takes the current FlightRouterState and applies the router state patch\n // received from the server, to create a full FlightRouterState tree that we\n // can pretend was returned by a prefetch.\n //\n // (It sounds similar to what applyRouterStatePatch does, but it doesn't need\n // to handle stuff like interception routes or diffing since that will be\n // handled later.)\n let baseTree = currentTree\n for (const { segmentPath, tree: treePatch } of flightData) {\n // If the server sends us multiple tree patches, we only need to clone the\n // base tree when applying the first patch. After the first patch, we can\n // apply the remaining patches in place without copying.\n const canMutateInPlace = baseTree !== currentTree\n baseTree = simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseTree,\n treePatch,\n segmentPath,\n canMutateInPlace,\n 0\n )\n }\n\n return baseTree\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseRouterState: FlightRouterState,\n patch: FlightRouterState,\n segmentPath: FlightSegmentPath,\n canMutateInPlace: boolean,\n index: number\n) {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return patch\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: In the case of a fully dynamic request with no prefetch, we receive\n // the FlightRouterState patch in the same request as the dynamic data.\n // Therefore we don't need to worry about diffing the segment values; we can\n // 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 baseChildren = baseRouterState[1]\n const newChildren: { [parallelRouteKey: string]: FlightRouterState } = {}\n for (const parallelRouteKey in baseChildren) {\n if (parallelRouteKey === updatedParallelRouteKey) {\n const childBaseRouterState = baseChildren[parallelRouteKey]\n newChildren[parallelRouteKey] =\n simulatePrefetchTreeUsingDynamicTreePatchImpl(\n childBaseRouterState,\n patch,\n segmentPath,\n canMutateInPlace,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n } else {\n // This child is not being patched. Copy it over as-is.\n newChildren[parallelRouteKey] = baseChildren[parallelRouteKey]\n }\n }\n\n if (canMutateInPlace) {\n // We can mutate the base tree in place, because the base tree is already\n // a clone.\n baseRouterState[1] = newChildren\n return baseRouterState\n }\n\n // Clone all the fields except the children.\n //\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n"],"names":["fetchServerResponse","startPPRNavigation","listenForDynamicRequest","createHrefFromUrl","createCanonicalUrl","EntryStatus","readRouteCacheEntry","readSegmentCacheEntry","waitForSegmentCacheEntry","createCacheKey","NavigationResultTag","noOpNavigationResult","tag","data","navigate","url","currentCacheNode","currentFlightRouterState","nextUrl","shouldScroll","now","Date","cacheKey","href","route","status","Fulfilled","snapshot","readRenderSnapshotFromCache","tree","prefetchFlightRouterState","flightRouterState","prefetchSeedData","seedData","prefetchHead","head","isPrefetchHeadPartial","isHeadPartial","canonicalUrl","navigateUsingPrefetchedRouteTree","navigateDynamicallyWithNoPrefetch","scrollableSegments","task","dynamicRequestTree","promiseForDynamicServerResponse","navigationTaskToResult","newCacheNode","node","cacheNode","childRouterStates","childSeedDatas","slots","parallelRouteKey","childTree","childResult","rsc","loading","isPartial","segmentEntry","key","Pending","promiseForFulfilledEntry","then","entry","Empty","Rejected","segment","isRootLayout","flightData","canonicalUrlOverride","newUrl","simulatePrefetchTreeUsingDynamicTreePatch","hasDynamicHoles","currentTree","baseTree","segmentPath","treePatch","canMutateInPlace","simulatePrefetchTreeUsingDynamicTreePatchImpl","baseRouterState","patch","index","length","updatedParallelRouteKey","baseChildren","newChildren","childBaseRouterState","clone"],"mappings":"AAWA,SAASA,mBAAmB,QAAQ,0CAAyC;AAC7E,SACEC,kBAAkB,EAClBC,uBAAuB,QAElB,oCAAmC;AAC1C,SAASC,qBAAqBC,kBAAkB,QAAQ,yCAAwC;AAChG,SACEC,WAAW,EACXC,mBAAmB,EACnBC,qBAAqB,EACrBC,wBAAwB,QAEnB,UAAS;AAChB,SAASC,cAAc,QAAQ,cAAa;AAE5C,OAAO,IAAA,AAAWC,6CAAAA;;;;;WAAAA;MAKjB;AAoCD,MAAMC,uBAA6C;IACjDC,GAAG;IACHC,MAAM;AACR;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,SACdC,GAAQ,EACRC,gBAA2B,EAC3BC,wBAA2C,EAC3CC,OAAsB,EACtBC,YAAqB;IAErB,MAAMC,MAAMC,KAAKD,GAAG;IAEpB,MAAME,WAAWb,eAAeM,IAAIQ,IAAI,EAAEL;IAC1C,MAAMM,QAAQlB,oBAAoBc,KAAKE;IACvC,IAAIE,UAAU,QAAQA,MAAMC,MAAM,KAAKpB,YAAYqB,SAAS,EAAE;QAC5D,+BAA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IAAK,MAAMjC,oBAAoBgC,aAAc;QAC3C,IAAIhC,qBAAqB+B,yBAAyB;YAChD,MAAMG,uBAAuBF,YAAY,CAAChC,iBAAiB;YAC3DiC,WAAW,CAACjC,iBAAiB,GAC3B0B,8CACEQ,sBACAN,OACAL,aACAE,kBACA,2DAA2D;YAC3D,+BAA+B;YAC/BI,QAAQ;QAEd,OAAO;YACL,uDAAuD;YACvDI,WAAW,CAACjC,iBAAiB,GAAGgC,YAAY,CAAChC,iBAAiB;QAChE;IACF;IAEA,IAAIyB,kBAAkB;QACpB,yEAAyE;QACzE,WAAW;QACXE,eAAe,CAAC,EAAE,GAAGM;QACrB,OAAON;IACT;IAEA,4CAA4C;IAC5C,EAAE;IACF,4EAA4E;IAC5E,2EAA2E;IAC3E,uCAAuC;IACvC,MAAMQ,QAA2B;QAACR,eAAe,CAAC,EAAE;QAAEM;KAAY;IAClE,IAAI,KAAKN,iBAAiB;QACxBQ,KAAK,CAAC,EAAE,GAAGR,eAAe,CAAC,EAAE;IAC/B;IACA,IAAI,KAAKA,iBAAiB;QACxBQ,KAAK,CAAC,EAAE,GAAGR,eAAe,CAAC,EAAE;IAC/B;IACA,IAAI,KAAKA,iBAAiB;QACxBQ,KAAK,CAAC,EAAE,GAAGR,eAAe,CAAC,EAAE;IAC/B;IACA,OAAOQ;AACT"}
|
1
|
+
{"version":3,"sources":["../../../../src/client/components/segment-cache/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport type {\n CacheNode,\n HeadData,\n LoadingModuleData,\n} from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n listenForDynamicRequest,\n type Task as PPRNavigationTask,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl as createCanonicalUrl } from '../router-reducer/create-href-from-url'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n readSegmentCacheEntry,\n waitForSegmentCacheEntry,\n type RouteTree,\n} from './cache'\nimport { createCacheKey } from './cache-key'\n\nexport const enum NavigationResultTag {\n MPA,\n Success,\n NoOp,\n Async,\n}\n\ntype MPANavigationResult = {\n tag: NavigationResultTag.MPA\n data: string\n}\n\ntype NoOpNavigationResult = {\n tag: NavigationResultTag.NoOp\n data: {\n canonicalUrl: string\n shouldScroll: boolean\n }\n}\n\ntype SuccessfulNavigationResult = {\n tag: NavigationResultTag.Success\n data: {\n flightRouterState: FlightRouterState\n cacheNode: CacheNode\n canonicalUrl: string\n scrollableSegments: Array<FlightSegmentPath>\n shouldScroll: boolean\n hash: string\n }\n}\n\ntype AsyncNavigationResult = {\n tag: NavigationResultTag.Async\n data: Promise<\n MPANavigationResult | NoOpNavigationResult | SuccessfulNavigationResult\n >\n}\n\nexport type NavigationResult =\n | MPANavigationResult\n | SuccessfulNavigationResult\n | NoOpNavigationResult\n | AsyncNavigationResult\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 url: URL,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n shouldScroll: boolean\n): NavigationResult {\n const now = Date.now()\n\n const cacheKey = createCacheKey(url.href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n const snapshot = readRenderSnapshotFromCache(now, route.tree)\n const prefetchFlightRouterState = snapshot.flightRouterState\n const prefetchSeedData = snapshot.seedData\n const prefetchHead = route.head\n const isPrefetchHeadPartial = route.isHeadPartial\n const newCanonicalUrl = route.canonicalUrl\n return navigateUsingPrefetchedRouteTree(\n url,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n newCanonicalUrl,\n shouldScroll,\n url.hash\n )\n }\n // There's no matching prefetch for this route in the cache.\n return {\n tag: NavigationResultTag.Async,\n data: navigateDynamicallyWithNoPrefetch(\n url,\n nextUrl,\n currentCacheNode,\n currentFlightRouterState,\n shouldScroll,\n url.hash\n ),\n }\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n url: URL,\n nextUrl: string | null,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n prefetchFlightRouterState: FlightRouterState,\n prefetchSeedData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n canonicalUrl: string,\n shouldScroll: boolean,\n hash: string\n): SuccessfulNavigationResult | NoOpNavigationResult | MPANavigationResult {\n // Recursively construct a prefetch tree by reading from the Segment Cache. To\n // maintain compatibility, we output the same data structures as the old\n // prefetching implementation: FlightRouterState and CacheNodeSeedData.\n // TODO: Eventually updateCacheNodeOnNavigation (or the equivalent) should\n // read from the Segment Cache directly. It's only structured this way for now\n // so we can share code with the old prefetching implementation.\n const scrollableSegments: Array<FlightSegmentPath> = []\n const task = startPPRNavigation(\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n scrollableSegments\n )\n if (task !== null) {\n const dynamicRequestTree = task.dynamicRequestTree\n if (dynamicRequestTree !== null) {\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n })\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll,\n hash\n )\n }\n // The server sent back an empty tree patch. There's nothing to update, except\n // possibly the URL.\n return {\n tag: NavigationResultTag.NoOp,\n data: {\n canonicalUrl,\n shouldScroll,\n },\n }\n}\n\nfunction navigationTaskToResult(\n task: PPRNavigationTask,\n currentCacheNode: CacheNode,\n canonicalUrl: string,\n scrollableSegments: Array<FlightSegmentPath>,\n shouldScroll: boolean,\n hash: string\n): SuccessfulNavigationResult | MPANavigationResult {\n const flightRouterState = task.route\n if (flightRouterState === null) {\n // When no router state is provided, it signals that we should perform an\n // MPA navigation.\n return {\n tag: NavigationResultTag.MPA,\n data: canonicalUrl,\n }\n }\n const newCacheNode = task.node\n return {\n tag: NavigationResultTag.Success,\n data: {\n flightRouterState,\n cacheNode: newCacheNode !== null ? newCacheNode : currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll,\n hash,\n },\n }\n}\n\nfunction readRenderSnapshotFromCache(\n now: number,\n tree: RouteTree\n): { flightRouterState: FlightRouterState; seedData: CacheNodeSeedData } {\n let childRouterStates: { [parallelRouteKey: string]: FlightRouterState } = {}\n let childSeedDatas: {\n [parallelRouteKey: string]: CacheNodeSeedData | null\n } = {}\n const slots = tree.slots\n if (slots !== null) {\n for (const parallelRouteKey in slots) {\n const childTree = slots[parallelRouteKey]\n const childResult = readRenderSnapshotFromCache(now, childTree)\n childRouterStates[parallelRouteKey] = childResult.flightRouterState\n childSeedDatas[parallelRouteKey] = childResult.seedData\n }\n }\n\n let rsc: React.ReactNode | null = null\n let loading: LoadingModuleData | Promise<LoadingModuleData> = null\n let isPartial: boolean = true\n\n const segmentEntry = readSegmentCacheEntry(now, tree.key)\n if (segmentEntry !== null) {\n switch (segmentEntry.status) {\n case EntryStatus.Fulfilled: {\n // Happy path: a cache hit\n rsc = segmentEntry.rsc\n loading = segmentEntry.loading\n isPartial = segmentEntry.isPartial\n break\n }\n case EntryStatus.Pending: {\n // We haven't received data for this segment yet, but there's already\n // an in-progress request. Since it's extremely likely to arrive\n // before the dynamic data response, we might as well use it.\n const promiseForFulfilledEntry = waitForSegmentCacheEntry(segmentEntry)\n rsc = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.rsc : null\n )\n loading = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.loading : null\n )\n // Since we don't know yet whether the segment is partial or fully\n // static, we must assume it's partial; we can't skip the\n // dynamic request.\n isPartial = true\n break\n }\n case EntryStatus.Empty:\n case EntryStatus.Rejected:\n break\n default:\n segmentEntry satisfies never\n }\n }\n\n return {\n flightRouterState: [\n tree.segment,\n childRouterStates,\n null,\n null,\n tree.isRootLayout,\n ],\n seedData: [tree.segment, rsc, childSeedDatas, loading, isPartial],\n }\n}\n\nasync function navigateDynamicallyWithNoPrefetch(\n url: URL,\n nextUrl: string | null,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n shouldScroll: boolean,\n hash: string\n): Promise<\n MPANavigationResult | SuccessfulNavigationResult | NoOpNavigationResult\n> {\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 const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: currentFlightRouterState,\n nextUrl,\n })\n const { flightData, canonicalUrl: canonicalUrlOverride } =\n await promiseForDynamicServerResponse\n\n if (typeof flightData === 'string') {\n // This is an MPA navigation.\n const newUrl = flightData\n return {\n tag: NavigationResultTag.MPA,\n data: newUrl,\n }\n }\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 prefetchFlightRouterState = simulatePrefetchTreeUsingDynamicTreePatch(\n currentFlightRouterState,\n flightData\n )\n\n // In our simulated prefetch payload, we pretend that there's no seed data\n // nor a prefetch head.\n const prefetchSeedData = null\n const prefetchHead = null\n const isPrefetchHeadPartial = true\n\n const canonicalUrl = createCanonicalUrl(\n canonicalUrlOverride ? canonicalUrlOverride : url\n )\n\n // Now we proceed exactly as we would for normal navigation.\n const scrollableSegments: Array<FlightSegmentPath> = []\n const task = startPPRNavigation(\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n scrollableSegments\n )\n if (task !== null) {\n // In this case, we've already sent the dynamic request, so we don't\n // actually use the request tree created by `startPPRNavigation`,\n // except to check if it contains dynamic holes.\n //\n // This is almost always true, but it could be false if all the segment data\n // was present in the cache, but the route tree was not. E.g. navigating\n // to a URL that was not prefetched but rewrites to a different URL\n // that was.\n const hasDynamicHoles = task.dynamicRequestTree !== null\n if (hasDynamicHoles) {\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We don't need to process the server response further.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll,\n hash\n )\n }\n // The server sent back an empty tree patch. There's nothing to update, except\n // possibly the URL.\n return {\n tag: NavigationResultTag.NoOp,\n data: {\n canonicalUrl,\n shouldScroll,\n },\n }\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatch(\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData>\n): FlightRouterState {\n // Takes the current FlightRouterState and applies the router state patch\n // received from the server, to create a full FlightRouterState tree that we\n // can pretend was returned by a prefetch.\n //\n // (It sounds similar to what applyRouterStatePatch does, but it doesn't need\n // to handle stuff like interception routes or diffing since that will be\n // handled later.)\n let baseTree = currentTree\n for (const { segmentPath, tree: treePatch } of flightData) {\n // If the server sends us multiple tree patches, we only need to clone the\n // base tree when applying the first patch. After the first patch, we can\n // apply the remaining patches in place without copying.\n const canMutateInPlace = baseTree !== currentTree\n baseTree = simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseTree,\n treePatch,\n segmentPath,\n canMutateInPlace,\n 0\n )\n }\n\n return baseTree\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseRouterState: FlightRouterState,\n patch: FlightRouterState,\n segmentPath: FlightSegmentPath,\n canMutateInPlace: boolean,\n index: number\n) {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return patch\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: In the case of a fully dynamic request with no prefetch, we receive\n // the FlightRouterState patch in the same request as the dynamic data.\n // Therefore we don't need to worry about diffing the segment values; we can\n // 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 baseChildren = baseRouterState[1]\n const newChildren: { [parallelRouteKey: string]: FlightRouterState } = {}\n for (const parallelRouteKey in baseChildren) {\n if (parallelRouteKey === updatedParallelRouteKey) {\n const childBaseRouterState = baseChildren[parallelRouteKey]\n newChildren[parallelRouteKey] =\n simulatePrefetchTreeUsingDynamicTreePatchImpl(\n childBaseRouterState,\n patch,\n segmentPath,\n canMutateInPlace,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n } else {\n // This child is not being patched. Copy it over as-is.\n newChildren[parallelRouteKey] = baseChildren[parallelRouteKey]\n }\n }\n\n if (canMutateInPlace) {\n // We can mutate the base tree in place, because the base tree is already\n // a clone.\n baseRouterState[1] = newChildren\n return baseRouterState\n }\n\n // Clone all the fields except the children.\n //\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n"],"names":["fetchServerResponse","startPPRNavigation","listenForDynamicRequest","createHrefFromUrl","createCanonicalUrl","EntryStatus","readRouteCacheEntry","readSegmentCacheEntry","waitForSegmentCacheEntry","createCacheKey","NavigationResultTag","navigate","url","currentCacheNode","currentFlightRouterState","nextUrl","shouldScroll","now","Date","cacheKey","href","route","status","Fulfilled","snapshot","readRenderSnapshotFromCache","tree","prefetchFlightRouterState","flightRouterState","prefetchSeedData","seedData","prefetchHead","head","isPrefetchHeadPartial","isHeadPartial","newCanonicalUrl","canonicalUrl","navigateUsingPrefetchedRouteTree","hash","tag","data","navigateDynamicallyWithNoPrefetch","scrollableSegments","task","dynamicRequestTree","promiseForDynamicServerResponse","navigationTaskToResult","newCacheNode","node","cacheNode","childRouterStates","childSeedDatas","slots","parallelRouteKey","childTree","childResult","rsc","loading","isPartial","segmentEntry","key","Pending","promiseForFulfilledEntry","then","entry","Empty","Rejected","segment","isRootLayout","flightData","canonicalUrlOverride","newUrl","simulatePrefetchTreeUsingDynamicTreePatch","hasDynamicHoles","currentTree","baseTree","segmentPath","treePatch","canMutateInPlace","simulatePrefetchTreeUsingDynamicTreePatchImpl","baseRouterState","patch","index","length","updatedParallelRouteKey","baseChildren","newChildren","childBaseRouterState","clone"],"mappings":"AAWA,SAASA,mBAAmB,QAAQ,0CAAyC;AAC7E,SACEC,kBAAkB,EAClBC,uBAAuB,QAElB,oCAAmC;AAC1C,SAASC,qBAAqBC,kBAAkB,QAAQ,yCAAwC;AAChG,SACEC,WAAW,EACXC,mBAAmB,EACnBC,qBAAqB,EACrBC,wBAAwB,QAEnB,UAAS;AAChB,SAASC,cAAc,QAAQ,cAAa;AAE5C,OAAO,IAAA,AAAWC,6CAAAA;;;;;WAAAA;MAKjB;AAwCD;;;;;;;CAOC,GACD,OAAO,SAASC,SACdC,GAAQ,EACRC,gBAA2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eAAe,CAAC,EAAE;IAC/B;IACA,OAAOQ;AACT"}
|
package/dist/esm/client/index.js
CHANGED
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
26
26
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
27
27
|
import tracer from './tracing/tracer';
|
28
28
|
import { isNextRouterError } from './components/is-next-router-error';
|
29
|
-
export const version = "15.2.1-canary.
|
29
|
+
export const version = "15.2.1-canary.2";
|
30
30
|
export let router;
|
31
31
|
export const emitter = mitt();
|
32
32
|
const looseToArray = (input)=>[].slice.call(input);
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"@aws-sdk/s3-presigned-post",
|
5
5
|
"@blockfrost/blockfrost-js",
|
6
6
|
"@highlight-run/node",
|
7
|
+
"@huggingface/transformers",
|
7
8
|
"@jpg-store/lucid-cardano",
|
8
9
|
"@libsql/client",
|
9
10
|
"@mikro-orm/core",
|
@@ -15,12 +16,14 @@
|
|
15
16
|
"@sentry/profiling-node",
|
16
17
|
"@sparticuz/chromium",
|
17
18
|
"@swc/core",
|
19
|
+
"@xenova/transformers",
|
18
20
|
"argon2",
|
19
21
|
"autoprefixer",
|
20
22
|
"aws-crt",
|
21
23
|
"bcrypt",
|
22
24
|
"better-sqlite3",
|
23
25
|
"canvas",
|
26
|
+
"chromadb-default-embed",
|
24
27
|
"cpu-features",
|
25
28
|
"cypress",
|
26
29
|
"dd-trace",
|
@@ -42,6 +45,7 @@
|
|
42
45
|
"node-cron",
|
43
46
|
"node-pty",
|
44
47
|
"node-web-audio-api",
|
48
|
+
"onnxruntime-node",
|
45
49
|
"oslo",
|
46
50
|
"pg",
|
47
51
|
"playwright",
|
@@ -188,7 +188,7 @@ function assignDefaults(dir, userConfig, silent) {
|
|
188
188
|
configurable: true
|
189
189
|
});
|
190
190
|
}
|
191
|
-
if (!((_process_env___NEXT_VERSION = "15.2.1-canary.
|
191
|
+
if (!((_process_env___NEXT_VERSION = "15.2.1-canary.2") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV) {
|
192
192
|
var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9, _result_experimental10;
|
193
193
|
// Prevents usage of certain experimental features outside of canary
|
194
194
|
if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
|
@@ -83,7 +83,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
|
|
83
83
|
}
|
84
84
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
85
85
|
const hotReloaderSpan = trace('hot-reloader', undefined, {
|
86
|
-
version: "15.2.1-canary.
|
86
|
+
version: "15.2.1-canary.2"
|
87
87
|
});
|
88
88
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
89
89
|
// of the current `next dev` invocation.
|
@@ -180,7 +180,7 @@ export default class HotReloaderWebpack {
|
|
180
180
|
this.previewProps = previewProps;
|
181
181
|
this.rewrites = rewrites;
|
182
182
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
183
|
-
version: "15.2.1-canary.
|
183
|
+
version: "15.2.1-canary.2"
|
184
184
|
});
|
185
185
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
186
186
|
// of the current `next dev` invocation.
|
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
|
|
4
4
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
|
5
5
|
import loadConfig, { getConfiguredExperimentalFeatures } from '../config';
|
6
6
|
export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
|
7
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.2.1-canary.
|
7
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.2.1-canary.2"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
|
8
8
|
if (appUrl) {
|
9
9
|
Log.bootstrap(`- Local: ${appUrl}`);
|
10
10
|
}
|
@@ -43,7 +43,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
|
|
43
43
|
export async function startServer(serverOptions) {
|
44
44
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
45
45
|
let { port } = serverOptions;
|
46
|
-
process.title = `next-server (v${"15.2.1-canary.
|
46
|
+
process.title = `next-server (v${"15.2.1-canary.2"})`;
|
47
47
|
let handlersReady = ()=>{};
|
48
48
|
let handlersError = ()=>{};
|
49
49
|
let handlersPromise = new Promise((resolve, reject)=>{
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"@aws-sdk/s3-presigned-post",
|
5
5
|
"@blockfrost/blockfrost-js",
|
6
6
|
"@highlight-run/node",
|
7
|
+
"@huggingface/transformers",
|
7
8
|
"@jpg-store/lucid-cardano",
|
8
9
|
"@libsql/client",
|
9
10
|
"@mikro-orm/core",
|
@@ -15,12 +16,14 @@
|
|
15
16
|
"@sentry/profiling-node",
|
16
17
|
"@sparticuz/chromium",
|
17
18
|
"@swc/core",
|
19
|
+
"@xenova/transformers",
|
18
20
|
"argon2",
|
19
21
|
"autoprefixer",
|
20
22
|
"aws-crt",
|
21
23
|
"bcrypt",
|
22
24
|
"better-sqlite3",
|
23
25
|
"canvas",
|
26
|
+
"chromadb-default-embed",
|
24
27
|
"cpu-features",
|
25
28
|
"cypress",
|
26
29
|
"dd-trace",
|
@@ -42,6 +45,7 @@
|
|
42
45
|
"node-cron",
|
43
46
|
"node-pty",
|
44
47
|
"node-web-audio-api",
|
48
|
+
"onnxruntime-node",
|
45
49
|
"oslo",
|
46
50
|
"pg",
|
47
51
|
"playwright",
|
package/dist/server/config.js
CHANGED
@@ -267,7 +267,7 @@ function assignDefaults(dir, userConfig, silent) {
|
|
267
267
|
configurable: true
|
268
268
|
});
|
269
269
|
}
|
270
|
-
if (!((_process_env___NEXT_VERSION = "15.2.1-canary.
|
270
|
+
if (!((_process_env___NEXT_VERSION = "15.2.1-canary.2") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV) {
|
271
271
|
var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9, _result_experimental10;
|
272
272
|
// Prevents usage of certain experimental features outside of canary
|
273
273
|
if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
|
@@ -139,7 +139,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
139
139
|
}
|
140
140
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
141
141
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
142
|
-
version: "15.2.1-canary.
|
142
|
+
version: "15.2.1-canary.2"
|
143
143
|
});
|
144
144
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
145
145
|
// of the current `next dev` invocation.
|
@@ -256,7 +256,7 @@ class HotReloaderWebpack {
|
|
256
256
|
this.previewProps = previewProps;
|
257
257
|
this.rewrites = rewrites;
|
258
258
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
259
|
-
version: "15.2.1-canary.
|
259
|
+
version: "15.2.1-canary.2"
|
260
260
|
});
|
261
261
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
262
262
|
// of the current `next dev` invocation.
|
@@ -67,7 +67,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
67
67
|
return newObj;
|
68
68
|
}
|
69
69
|
function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
|
70
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.2.1-canary.
|
70
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.2.1-canary.2"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
|
71
71
|
if (appUrl) {
|
72
72
|
_log.bootstrap(`- Local: ${appUrl}`);
|
73
73
|
}
|
@@ -111,7 +111,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
|
|
111
111
|
async function startServer(serverOptions) {
|
112
112
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
113
113
|
let { port } = serverOptions;
|
114
|
-
process.title = `next-server (v${"15.2.1-canary.
|
114
|
+
process.title = `next-server (v${"15.2.1-canary.2"})`;
|
115
115
|
let handlersReady = ()=>{};
|
116
116
|
let handlersError = ()=>{};
|
117
117
|
let handlersPromise = new Promise((resolve, reject)=>{
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
|
|
11
11
|
const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
|
12
12
|
function eventCliSessionStopped(event) {
|
13
13
|
// This should be an invariant, if it fails our build tooling is broken.
|
14
|
-
if (typeof "15.2.1-canary.
|
14
|
+
if (typeof "15.2.1-canary.2" !== 'string') {
|
15
15
|
return [];
|
16
16
|
}
|
17
17
|
const payload = {
|
18
|
-
nextVersion: "15.2.1-canary.
|
18
|
+
nextVersion: "15.2.1-canary.2",
|
19
19
|
nodeVersion: process.version,
|
20
20
|
cliCommand: event.cliCommand,
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
@@ -36,12 +36,12 @@ function hasBabelConfig(dir) {
|
|
36
36
|
function eventCliSession(dir, nextConfig, event) {
|
37
37
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_experimental_reactCompiler, _nextConfig_experimental_reactCompiler1;
|
38
38
|
// This should be an invariant, if it fails our build tooling is broken.
|
39
|
-
if (typeof "15.2.1-canary.
|
39
|
+
if (typeof "15.2.1-canary.2" !== 'string') {
|
40
40
|
return [];
|
41
41
|
}
|
42
42
|
const { images, i18n } = nextConfig || {};
|
43
43
|
const payload = {
|
44
|
-
nextVersion: "15.2.1-canary.
|
44
|
+
nextVersion: "15.2.1-canary.2",
|
45
45
|
nodeVersion: process.version,
|
46
46
|
cliCommand: event.cliCommand,
|
47
47
|
isSrcDir: event.isSrcDir,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "next",
|
3
|
-
"version": "15.2.1-canary.
|
3
|
+
"version": "15.2.1-canary.2",
|
4
4
|
"description": "The React Framework",
|
5
5
|
"main": "./dist/server/next.js",
|
6
6
|
"license": "MIT",
|
@@ -100,7 +100,7 @@
|
|
100
100
|
]
|
101
101
|
},
|
102
102
|
"dependencies": {
|
103
|
-
"@next/env": "15.2.1-canary.
|
103
|
+
"@next/env": "15.2.1-canary.2",
|
104
104
|
"@swc/counter": "0.1.3",
|
105
105
|
"@swc/helpers": "0.5.15",
|
106
106
|
"busboy": "1.6.0",
|
@@ -132,14 +132,14 @@
|
|
132
132
|
},
|
133
133
|
"optionalDependencies": {
|
134
134
|
"sharp": "^0.33.5",
|
135
|
-
"@next/swc-darwin-arm64": "15.2.1-canary.
|
136
|
-
"@next/swc-darwin-x64": "15.2.1-canary.
|
137
|
-
"@next/swc-linux-arm64-gnu": "15.2.1-canary.
|
138
|
-
"@next/swc-linux-arm64-musl": "15.2.1-canary.
|
139
|
-
"@next/swc-linux-x64-gnu": "15.2.1-canary.
|
140
|
-
"@next/swc-linux-x64-musl": "15.2.1-canary.
|
141
|
-
"@next/swc-win32-arm64-msvc": "15.2.1-canary.
|
142
|
-
"@next/swc-win32-x64-msvc": "15.2.1-canary.
|
135
|
+
"@next/swc-darwin-arm64": "15.2.1-canary.2",
|
136
|
+
"@next/swc-darwin-x64": "15.2.1-canary.2",
|
137
|
+
"@next/swc-linux-arm64-gnu": "15.2.1-canary.2",
|
138
|
+
"@next/swc-linux-arm64-musl": "15.2.1-canary.2",
|
139
|
+
"@next/swc-linux-x64-gnu": "15.2.1-canary.2",
|
140
|
+
"@next/swc-linux-x64-musl": "15.2.1-canary.2",
|
141
|
+
"@next/swc-win32-arm64-msvc": "15.2.1-canary.2",
|
142
|
+
"@next/swc-win32-x64-msvc": "15.2.1-canary.2"
|
143
143
|
},
|
144
144
|
"devDependencies": {
|
145
145
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
@@ -172,11 +172,11 @@
|
|
172
172
|
"@jest/types": "29.5.0",
|
173
173
|
"@mswjs/interceptors": "0.23.0",
|
174
174
|
"@napi-rs/triples": "1.2.0",
|
175
|
-
"@next/font": "15.2.1-canary.
|
176
|
-
"@next/polyfill-module": "15.2.1-canary.
|
177
|
-
"@next/polyfill-nomodule": "15.2.1-canary.
|
178
|
-
"@next/react-refresh-utils": "15.2.1-canary.
|
179
|
-
"@next/swc": "15.2.1-canary.
|
175
|
+
"@next/font": "15.2.1-canary.2",
|
176
|
+
"@next/polyfill-module": "15.2.1-canary.2",
|
177
|
+
"@next/polyfill-nomodule": "15.2.1-canary.2",
|
178
|
+
"@next/react-refresh-utils": "15.2.1-canary.2",
|
179
|
+
"@next/swc": "15.2.1-canary.2",
|
180
180
|
"@opentelemetry/api": "1.6.0",
|
181
181
|
"@playwright/test": "1.41.2",
|
182
182
|
"@storybook/addon-a11y": "8.6.0",
|