{"version":3,"sources":["../../../src/server/dev/hot-middleware.ts"],"sourcesContent":["// Based on https://github.com/webpack-contrib/webpack-hot-middleware/blob/9708d781ae0e46179cf8ea1a94719de4679aaf53/middleware.js\n// Included License below\n\n// Copyright JS Foundation and other contributors\n\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// 'Software'), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type ws from 'next/dist/compiled/ws'\nimport type { DevToolsConfig } from '../../next-devtools/dev-overlay/shared'\nimport { isMiddlewareFilename } from '../../build/utils'\nimport type { VersionInfo } from './parse-version-info'\nimport type { HmrMessageSentToBrowser } from './hot-reloader-types'\nimport { HMR_MESSAGE_SENT_TO_BROWSER } from './hot-reloader-types'\nimport { devIndicatorServerState } from './dev-indicator-server-state'\nimport { createBinaryHmrMessageData } from './messages'\nimport type { NextConfigComplete } from '../config-shared'\n\nfunction isMiddlewareStats(stats: webpack.Stats) {\n  for (const key of stats.compilation.entrypoints.keys()) {\n    if (isMiddlewareFilename(key)) {\n      return true\n    }\n  }\n\n  return false\n}\n\nfunction statsToJson(stats?: webpack.Stats | null) {\n  if (!stats) return {}\n  return stats.toJson({\n    all: false,\n    errors: true,\n    hash: true,\n    warnings: true,\n  })\n}\n\nfunction getStatsForSyncEvent(\n  clientStats: { ts: number; stats: webpack.Stats } | null,\n  serverStats: { ts: number; stats: webpack.Stats } | null\n) {\n  if (!clientStats) return serverStats?.stats\n  if (!serverStats) return clientStats?.stats\n\n  // Prefer the server compiler stats if it has errors.\n  // Otherwise we may end up in a state where the client compilation is the latest but without errors.\n  // This causes the error overlay to not display the build error.\n  if (serverStats.stats.hasErrors()) {\n    return serverStats.stats\n  }\n\n  // Return the latest stats\n  return serverStats.ts > clientStats.ts ? serverStats.stats : clientStats.stats\n}\n\nexport class WebpackHotMiddleware {\n  private clientsWithoutHtmlRequestId = new Set<ws>()\n  private clientsByHtmlRequestId: Map<string, ws> = new Map()\n  private closed = false\n  private clientLatestStats: { ts: number; stats: webpack.Stats } | null = null\n  private middlewareLatestStats: { ts: number; stats: webpack.Stats } | null =\n    null\n  private serverLatestStats: { ts: number; stats: webpack.Stats } | null = null\n\n  constructor(\n    compilers: webpack.Compiler[],\n    private versionInfo: VersionInfo,\n    private devtoolsFrontendUrl: string | undefined,\n    private config: NextConfigComplete,\n    private devToolsConfig: DevToolsConfig\n  ) {\n    compilers[0].hooks.invalid.tap(\n      'webpack-hot-middleware',\n      this.onClientInvalid\n    )\n    compilers[0].hooks.done.tap('webpack-hot-middleware', this.onClientDone)\n    compilers[1].hooks.invalid.tap(\n      'webpack-hot-middleware',\n      this.onServerInvalid\n    )\n    compilers[1].hooks.done.tap('webpack-hot-middleware', this.onServerDone)\n    compilers[2].hooks.done.tap('webpack-hot-middleware', this.onEdgeServerDone)\n    compilers[2].hooks.invalid.tap(\n      'webpack-hot-middleware',\n      this.onEdgeServerInvalid\n    )\n  }\n\n  onClientInvalid = () => {\n    if (this.closed || this.serverLatestStats?.stats.hasErrors()) return\n    this.publish({\n      type: HMR_MESSAGE_SENT_TO_BROWSER.BUILDING,\n    })\n  }\n\n  onClientDone = (statsResult: webpack.Stats) => {\n    this.clientLatestStats = { ts: Date.now(), stats: statsResult }\n    if (this.closed || this.serverLatestStats?.stats.hasErrors()) return\n    this.publishStats(statsResult)\n  }\n\n  onServerInvalid = () => {\n    if (!this.serverLatestStats?.stats.hasErrors()) return\n    this.serverLatestStats = null\n    if (this.clientLatestStats?.stats) {\n      this.publishStats(this.clientLatestStats.stats)\n    }\n  }\n\n  onServerDone = (statsResult: webpack.Stats) => {\n    if (this.closed) return\n    if (statsResult.hasErrors()) {\n      this.serverLatestStats = { ts: Date.now(), stats: statsResult }\n      this.publishStats(statsResult)\n    }\n  }\n\n  onEdgeServerInvalid = () => {\n    if (!this.middlewareLatestStats?.stats.hasErrors()) return\n    this.middlewareLatestStats = null\n    if (this.clientLatestStats?.stats) {\n      this.publishStats(this.clientLatestStats.stats)\n    }\n  }\n\n  onEdgeServerDone = (statsResult: webpack.Stats) => {\n    if (this.closed) return\n    if (!isMiddlewareStats(statsResult)) {\n      this.onServerInvalid()\n      this.onServerDone(statsResult)\n    }\n\n    if (statsResult.hasErrors()) {\n      this.middlewareLatestStats = { ts: Date.now(), stats: statsResult }\n      this.publishStats(statsResult)\n    }\n  }\n\n  public updateDevToolsConfig(newConfig: DevToolsConfig): void {\n    this.devToolsConfig = newConfig\n  }\n\n  /**\n   * To sync we use the most recent stats but also we append middleware\n   * errors. This is because it is possible that middleware fails to compile\n   * and we still want to show the client overlay with the error while\n   * the error page should be rendered just fine.\n   */\n  onHMR = (client: ws, htmlRequestId: string | null) => {\n    if (this.closed) return\n\n    if (htmlRequestId) {\n      this.clientsByHtmlRequestId.set(htmlRequestId, client)\n    } else {\n      this.clientsWithoutHtmlRequestId.add(client)\n    }\n\n    client.addEventListener('close', () => {\n      if (htmlRequestId) {\n        this.clientsByHtmlRequestId.delete(htmlRequestId)\n      } else {\n        this.clientsWithoutHtmlRequestId.delete(client)\n      }\n    })\n\n    const syncStats = getStatsForSyncEvent(\n      this.clientLatestStats,\n      this.serverLatestStats\n    )\n\n    if (syncStats) {\n      const stats = statsToJson(syncStats)\n      const middlewareStats = statsToJson(this.middlewareLatestStats?.stats)\n\n      if (devIndicatorServerState.disabledUntil < Date.now()) {\n        devIndicatorServerState.disabledUntil = 0\n      }\n\n      this.publish({\n        type: HMR_MESSAGE_SENT_TO_BROWSER.SYNC,\n        hash: stats.hash!,\n        errors: [...(stats.errors || []), ...(middlewareStats.errors || [])],\n        warnings: [\n          ...(stats.warnings || []),\n          ...(middlewareStats.warnings || []),\n        ],\n        versionInfo: this.versionInfo,\n        debug: {\n          devtoolsFrontendUrl: this.devtoolsFrontendUrl,\n        },\n        devIndicator: devIndicatorServerState,\n        devToolsConfig: this.devToolsConfig,\n      })\n    }\n  }\n\n  publishStats = (statsResult: webpack.Stats) => {\n    const stats = statsResult.toJson({\n      all: false,\n      hash: true,\n      warnings: true,\n      errors: true,\n      moduleTrace: true,\n    })\n\n    this.publish({\n      type: HMR_MESSAGE_SENT_TO_BROWSER.BUILT,\n      hash: stats.hash!,\n      warnings: stats.warnings || [],\n      errors: stats.errors || [],\n    })\n  }\n\n  getClient = (htmlRequestId: string): ws | undefined => {\n    return this.clientsByHtmlRequestId.get(htmlRequestId)\n  }\n\n  publishToClient = (client: ws, message: HmrMessageSentToBrowser) => {\n    if (this.closed) {\n      return\n    }\n\n    const data =\n      typeof message.type === 'number'\n        ? createBinaryHmrMessageData(message)\n        : JSON.stringify(message)\n\n    client.send(data)\n  }\n\n  publish = (message: HmrMessageSentToBrowser) => {\n    if (this.closed) {\n      return\n    }\n\n    for (const wsClient of [\n      ...this.clientsWithoutHtmlRequestId,\n      ...this.clientsByHtmlRequestId.values(),\n    ]) {\n      this.publishToClient(wsClient, message)\n    }\n  }\n\n  publishToLegacyClients = (message: HmrMessageSentToBrowser) => {\n    if (this.closed) {\n      return\n    }\n\n    // Clients with a request ID are inferred App Router clients. If Cache\n    // Components is not enabled, we consider those legacy clients. Pages\n    // Router clients are also considered legacy clients. TODO: Maybe mark\n    // clients as App Router / Pages Router clients explicitly, instead of\n    // inferring it from the presence of a request ID.\n\n    if (!this.config.cacheComponents) {\n      for (const wsClient of this.clientsByHtmlRequestId.values()) {\n        this.publishToClient(wsClient, message)\n      }\n    }\n\n    for (const wsClient of this.clientsWithoutHtmlRequestId) {\n      this.publishToClient(wsClient, message)\n    }\n  }\n\n  close = () => {\n    if (this.closed) {\n      return\n    }\n\n    // Can't remove compiler plugins, so we just set a flag and noop if closed\n    // https://github.com/webpack/tapable/issues/32#issuecomment-350644466\n    this.closed = true\n\n    for (const wsClient of [\n      ...this.clientsWithoutHtmlRequestId,\n      ...this.clientsByHtmlRequestId.values(),\n    ]) {\n      // it's okay to not cleanly close these websocket connections, this is dev\n      wsClient.terminate()\n    }\n\n    this.clientsWithoutHtmlRequestId.clear()\n    this.clientsByHtmlRequestId.clear()\n  }\n\n  deleteClient = (client: ws, htmlRequestId: string | null) => {\n    if (htmlRequestId) {\n      this.clientsByHtmlRequestId.delete(htmlRequestId)\n    } else {\n      this.clientsWithoutHtmlRequestId.delete(client)\n    }\n  }\n\n  hasClients = () => {\n    return (\n      this.clientsWithoutHtmlRequestId.size + this.clientsByHtmlRequestId.size >\n      0\n    )\n  }\n\n  getClientCount = () => {\n    return (\n      this.clientsWithoutHtmlRequestId.size + this.clientsByHtmlRequestId.size\n    )\n  }\n}\n"],"names":["WebpackHotMiddleware","isMiddlewareStats","stats","key","compilation","entrypoints","keys","isMiddlewareFilename","statsToJson","toJson","all","errors","hash","warnings","getStatsForSyncEvent","clientStats","serverStats","hasErrors","ts","constructor","compilers","versionInfo","devtoolsFrontendUrl","config","devToolsConfig","clientsWithoutHtmlRequestId","Set","clientsByHtmlRequestId","Map","closed","clientLatestStats","middlewareLatestStats","serverLatestStats","onClientInvalid","publish","type","HMR_MESSAGE_SENT_TO_BROWSER","BUILDING","onClientDone","statsResult","Date","now","publishStats","onServerInvalid","onServerDone","onEdgeServerInvalid","onEdgeServerDone","onHMR","client","htmlRequestId","set","add","addEventListener","delete","syncStats","middlewareStats","devIndicatorServerState","disabledUntil","SYNC","debug","devIndicator","moduleTrace","BUILT","getClient","get","publishToClient","message","data","createBinaryHmrMessageData","JSON","stringify","send","wsClient","values","publishToLegacyClients","cacheComponents","close","terminate","clear","deleteClient","hasClients","size","getClientCount","hooks","invalid","tap","done","updateDevToolsConfig","newConfig"],"mappings":"AAAA,iIAAiI;AACjI,yBAAyB;AAEzB,iDAAiD;AAEjD,wEAAwE;AACxE,kEAAkE;AAClE,sEAAsE;AACtE,sEAAsE;AACtE,qEAAqE;AACrE,wEAAwE;AACxE,4BAA4B;AAE5B,iEAAiE;AACjE,kEAAkE;AAElE,kEAAkE;AAClE,qEAAqE;AACrE,yEAAyE;AACzE,uEAAuE;AACvE,uEAAuE;AACvE,oEAAoE;AACpE,yDAAyD;;;;;+BAkD5CA;;;eAAAA;;;uBA9CwB;kCAGO;yCACJ;0BACG;AAG3C,SAASC,kBAAkBC,KAAoB;IAC7C,KAAK,MAAMC,OAAOD,MAAME,WAAW,CAACC,WAAW,CAACC,IAAI,GAAI;QACtD,IAAIC,IAAAA,2BAAoB,EAACJ,MAAM;YAC7B,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEA,SAASK,YAAYN,KAA4B;IAC/C,IAAI,CAACA,OAAO,OAAO,CAAC;IACpB,OAAOA,MAAMO,MAAM,CAAC;QAClBC,KAAK;QACLC,QAAQ;QACRC,MAAM;QACNC,UAAU;IACZ;AACF;AAEA,SAASC,qBACPC,WAAwD,EACxDC,WAAwD;IAExD,IAAI,CAACD,aAAa,OAAOC,+BAAAA,YAAad,KAAK;IAC3C,IAAI,CAACc,aAAa,OAAOD,+BAAAA,YAAab,KAAK;IAE3C,qDAAqD;IACrD,oGAAoG;IACpG,gEAAgE;IAChE,IAAIc,YAAYd,KAAK,CAACe,SAAS,IAAI;QACjC,OAAOD,YAAYd,KAAK;IAC1B;IAEA,0BAA0B;IAC1B,OAA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