Skip to content

Commit

Permalink
chore: rename typo middlewares to interceptors in hot reloader (#39292)
Browse files Browse the repository at this point in the history
rename `middlewares` (typo, shouldn't have ending **s**) to `interceptors` to distinguish from middleware
  • Loading branch information
huozhi committed Aug 3, 2022
1 parent a189542 commit fc8e024
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/next/server/dev/hot-reloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function erroredPages(compilation: webpack5.Compilation) {
export default class HotReloader {
private dir: string
private buildId: string
private middlewares: any[]
private interceptors: any[]
private pagesDir: string
private distDir: string
private webpackHotMiddleware?: WebpackHotMiddleware
Expand Down Expand Up @@ -201,7 +201,7 @@ export default class HotReloader {
) {
this.buildId = buildId
this.dir = dir
this.middlewares = []
this.interceptors = []
this.pagesDir = pagesDir
this.appDir = appDir
this.distDir = distDir
Expand Down Expand Up @@ -284,7 +284,7 @@ export default class HotReloader {

const { finished } = await handlePageBundleRequest(res, parsedUrl)

for (const fn of this.middlewares) {
for (const fn of this.interceptors) {
await new Promise<void>((resolve, reject) => {
fn(req, res, (err: Error) => {
if (err) return reject(err)
Expand Down Expand Up @@ -933,7 +933,7 @@ export default class HotReloader {
}),
})

this.middlewares = [
this.interceptors = [
getOverlayMiddleware({
rootDirectory: this.dir,
stats: () => this.clientStats,
Expand Down

0 comments on commit fc8e024

Please sign in to comment.