-
Notifications
You must be signed in to change notification settings - Fork 26.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[turbopack]: Serve _devMiddlewareManifest.json
from router
#50241
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import { getMiddlewareMatchers } from '../../build/analysis/get-page-static-info | |
import { getMiddlewareRouteMatcher } from '../../shared/lib/router/utils/middleware-route-matcher' | ||
import { | ||
CLIENT_STATIC_FILES_PATH, | ||
DEV_CLIENT_PAGES_MANIFEST, | ||
DEV_MIDDLEWARE_MANIFEST, | ||
} from '../../shared/lib/constants' | ||
import type { BaseNextRequest } from '../base-http' | ||
|
||
|
@@ -193,20 +193,6 @@ export async function makeResolver( | |
// @ts-expect-error protected | ||
const buildId = devServer.buildId | ||
|
||
const pagesManifestRoute = routes.fsRoutes.find( | ||
(r) => | ||
r.name === | ||
`_next/${CLIENT_STATIC_FILES_PATH}/${buildId}/${DEV_CLIENT_PAGES_MANIFEST}` | ||
) | ||
if (pagesManifestRoute) { | ||
// make sure turbopack serves this | ||
pagesManifestRoute.fn = () => { | ||
return { | ||
finished: true, | ||
} | ||
} | ||
} | ||
Comment on lines
-196
to
-208
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unnecessary, because the |
||
|
||
const router = new Router({ | ||
...routes, | ||
catchAllMiddleware, | ||
|
@@ -245,6 +231,8 @@ export async function makeResolver( | |
route.type === 'header' || | ||
route.name === 'catchall route' || | ||
route.name === 'middleware catchall' || | ||
route.name === | ||
`_next/${CLIENT_STATIC_FILES_PATH}/${buildId}/${DEV_MIDDLEWARE_MANIFEST}` || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This allows the router to handle this specific route, returning our |
||
route.name?.includes('check') | ||
) | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is defined, then we'll never fetch the middleware matchers from the server. The fetcher will cache the fetched value afterwards.