Unverified Commit bf46a6fa authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Turbopack: Remove matchers.reload() call on each request (#83720)

## What?

It's likely that because of the bug in #83628 this logic existed in
order to make the tests pass but it adds significant overhead depending
on the size of your `app` directory. Since #83628 matches the watcher no
longer wait for 200ms it should no longer be needed. Let's see how the
tests do with the change.
parent 323eebce
...@@ -606,6 +606,10 @@ export default abstract class Server< ...@@ -606,6 +606,10 @@ export default abstract class Server<
this.responseCache = this.getResponseCache({ dev }) this.responseCache = this.getResponseCache({ dev })
} }
protected reloadMatchers() {
return this.matchers.reload()
}
private handleRSCRequest: RouteHandler<ServerRequest, ServerResponse> = ( private handleRSCRequest: RouteHandler<ServerRequest, ServerResponse> = (
req, req,
_res, _res,
......
...@@ -65,10 +65,6 @@ export class DevRouteMatcherManager extends DefaultRouteMatcherManager { ...@@ -65,10 +65,6 @@ export class DevRouteMatcherManager extends DefaultRouteMatcherManager {
pathname: string, pathname: string,
options: MatchOptions options: MatchOptions
): AsyncGenerator<RouteMatch<RouteDefinition<RouteKind>>, null, undefined> { ): AsyncGenerator<RouteMatch<RouteDefinition<RouteKind>>, null, undefined> {
// Compile the development routes.
// TODO: we may want to only run this during testing, users won't be fast enough to require this many dir scans
await super.reload()
// Iterate over the development matches to see if one of them match the // Iterate over the development matches to see if one of them match the
// request path. // request path.
for await (const developmentMatch of super.matchAll(pathname, options)) { for await (const developmentMatch of super.matchAll(pathname, options)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment