next 15.2.0-canary.65 → 15.2.0-canary.66

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.

Files changed (334) hide show
  1. package/dist/bin/next +5 -1
  2. package/dist/bin/next.map +1 -1
  3. package/dist/build/entries.d.ts +1 -0
  4. package/dist/build/entries.js +12 -1
  5. package/dist/build/entries.js.map +1 -1
  6. package/dist/build/index.js +3 -3
  7. package/dist/build/index.js.map +1 -1
  8. package/dist/build/swc/index.js +1 -1
  9. package/dist/build/webpack/config/blocks/base.js +3 -1
  10. package/dist/build/webpack/config/blocks/base.js.map +1 -1
  11. package/dist/build/webpack/config/blocks/css/index.js +3 -1
  12. package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
  13. package/dist/build/webpack/config/blocks/css/loaders/client.js +3 -1
  14. package/dist/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
  15. package/dist/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
  16. package/dist/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
  17. package/dist/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
  18. package/dist/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
  19. package/dist/build/webpack/loaders/next-flight-loader/index.js +8 -2
  20. package/dist/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
  21. package/dist/build/webpack/loaders/utils.js +1 -1
  22. package/dist/build/webpack/loaders/utils.js.map +1 -1
  23. package/dist/build/webpack/plugins/build-manifest-plugin.d.ts +1 -1
  24. package/dist/build/webpack/plugins/build-manifest-plugin.js +13 -4
  25. package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  26. package/dist/build/webpack/plugins/flight-client-entry-plugin.d.ts +1 -1
  27. package/dist/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
  28. package/dist/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  29. package/dist/build/webpack/plugins/flight-manifest-plugin.js +3 -3
  30. package/dist/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
  31. package/dist/build/webpack/plugins/middleware-plugin.js +6 -3
  32. package/dist/build/webpack/plugins/middleware-plugin.js.map +1 -1
  33. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
  34. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  35. package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
  36. package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
  37. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.d.ts +36 -0
  38. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js +97 -0
  39. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
  40. package/dist/build/webpack/plugins/rspack-profiling-plugin.d.ts +9 -0
  41. package/dist/build/webpack/plugins/rspack-profiling-plugin.js +62 -0
  42. package/dist/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
  43. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
  44. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
  45. package/dist/build/webpack/utils.js +6 -2
  46. package/dist/build/webpack/utils.js.map +1 -1
  47. package/dist/build/webpack-config.js +37 -5
  48. package/dist/build/webpack-config.js.map +1 -1
  49. package/dist/client/app-bootstrap.js +1 -1
  50. package/dist/client/app-dir/link.js +2 -0
  51. package/dist/client/app-dir/link.js.map +1 -1
  52. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
  53. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
  54. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
  55. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
  56. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.d.ts +1 -0
  57. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js +41 -0
  58. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
  59. package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
  60. package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
  61. package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
  62. package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
  63. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.d.ts +2 -0
  64. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +72 -0
  65. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
  66. package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
  67. package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
  68. package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
  69. package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
  70. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
  71. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  72. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
  73. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
  74. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.d.ts +2 -1
  75. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +82 -31
  76. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
  77. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.d.ts +2 -2
  78. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +20 -21
  79. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
  80. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.d.ts +8 -0
  81. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +80 -0
  82. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
  83. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.d.ts +9 -0
  84. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +158 -0
  85. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
  86. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.d.ts +8 -0
  87. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +212 -0
  88. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
  89. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.d.ts +1 -0
  90. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
  91. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
  92. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
  93. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
  94. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.d.ts +2 -2
  95. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
  96. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
  97. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.d.ts +2 -2
  98. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
  99. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
  100. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.d.ts +2 -2
  101. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
  102. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
  103. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
  104. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
  105. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.d.ts +2 -2
  106. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
  107. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
  108. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
  109. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
  110. package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
  111. package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
  112. package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
  113. package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
  114. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.d.ts +2 -2
  115. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
  116. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
  117. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
  118. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
  119. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
  120. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  121. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.d.ts +1 -1
  122. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
  123. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
  124. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
  125. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
  126. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.d.ts +1 -0
  127. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +34 -0
  128. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
  129. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
  130. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
  131. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
  132. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
  133. package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
  134. package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
  135. package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js +2 -2
  136. package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
  137. package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
  138. package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
  139. package/dist/client/components/react-dev-overlay/server/middleware-response.d.ts +9 -0
  140. package/dist/client/components/react-dev-overlay/server/middleware-response.js +46 -0
  141. package/dist/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
  142. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +13 -12
  143. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  144. package/dist/client/components/react-dev-overlay/server/middleware-webpack.js +12 -11
  145. package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
  146. package/dist/client/components/react-dev-overlay/server/shared.d.ts +0 -7
  147. package/dist/client/components/react-dev-overlay/server/shared.js +1 -51
  148. package/dist/client/components/react-dev-overlay/server/shared.js.map +1 -1
  149. package/dist/client/components/react-dev-overlay/shared.d.ts +1 -0
  150. package/dist/client/components/react-dev-overlay/shared.js +2 -0
  151. package/dist/client/components/react-dev-overlay/shared.js.map +1 -1
  152. package/dist/client/index.js +2 -3
  153. package/dist/client/index.js.map +1 -1
  154. package/dist/client/link.js.map +1 -1
  155. package/dist/compiled/@next/font/dist/google/fetch-css-from-google-fonts.js +8 -44
  156. package/dist/compiled/@next/font/dist/google/fetch-font-file.d.ts +2 -1
  157. package/dist/compiled/@next/font/dist/google/fetch-font-file.js +6 -20
  158. package/dist/compiled/@next/font/dist/google/fetch-resource.d.ts +6 -0
  159. package/dist/compiled/@next/font/dist/google/fetch-resource.js +46 -0
  160. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +3 -3
  161. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
  162. package/dist/compiled/next-server/app-page.runtime.dev.js +3 -3
  163. package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
  164. package/dist/compiled/next-server/server.runtime.prod.js +2 -2
  165. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  166. package/dist/compiled/node-fetch/index.js +1 -1
  167. package/dist/compiled/sass-loader/cjs.js +1 -1
  168. package/dist/compiled/webpack/webpack.js +23 -1
  169. package/dist/esm/build/entries.js +9 -2
  170. package/dist/esm/build/entries.js.map +1 -1
  171. package/dist/esm/build/index.js +3 -3
  172. package/dist/esm/build/index.js.map +1 -1
  173. package/dist/esm/build/swc/index.js +1 -1
  174. package/dist/esm/build/webpack/config/blocks/base.js +3 -1
  175. package/dist/esm/build/webpack/config/blocks/base.js.map +1 -1
  176. package/dist/esm/build/webpack/config/blocks/css/index.js +3 -1
  177. package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
  178. package/dist/esm/build/webpack/config/blocks/css/loaders/client.js +3 -1
  179. package/dist/esm/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
  180. package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
  181. package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
  182. package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
  183. package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
  184. package/dist/esm/build/webpack/loaders/next-flight-loader/index.js +8 -2
  185. package/dist/esm/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
  186. package/dist/esm/build/webpack/loaders/utils.js +1 -1
  187. package/dist/esm/build/webpack/loaders/utils.js.map +1 -1
  188. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +14 -5
  189. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  190. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
  191. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  192. package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js +3 -3
  193. package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
  194. package/dist/esm/build/webpack/plugins/middleware-plugin.js +6 -3
  195. package/dist/esm/build/webpack/plugins/middleware-plugin.js.map +1 -1
  196. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
  197. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  198. package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
  199. package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
  200. package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js +87 -0
  201. package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
  202. package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js +40 -0
  203. package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
  204. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
  205. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
  206. package/dist/esm/build/webpack/utils.js +6 -2
  207. package/dist/esm/build/webpack/utils.js.map +1 -1
  208. package/dist/esm/build/webpack-config.js +37 -5
  209. package/dist/esm/build/webpack-config.js.map +1 -1
  210. package/dist/esm/client/app-bootstrap.js +1 -1
  211. package/dist/esm/client/app-dir/link.js +2 -0
  212. package/dist/esm/client/app-dir/link.js.map +1 -1
  213. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
  214. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
  215. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
  216. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
  217. package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js +25 -0
  218. package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
  219. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
  220. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
  221. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
  222. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
  223. package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +54 -0
  224. package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
  225. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
  226. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
  227. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
  228. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
  229. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
  230. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  231. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
  232. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
  233. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +83 -31
  234. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
  235. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +13 -14
  236. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
  237. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +52 -0
  238. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
  239. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +130 -0
  240. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
  241. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +184 -0
  242. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
  243. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
  244. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
  245. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
  246. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
  247. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
  248. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
  249. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
  250. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
  251. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
  252. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
  253. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
  254. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
  255. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
  256. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
  257. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
  258. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
  259. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
  260. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
  261. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
  262. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
  263. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
  264. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
  265. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
  266. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
  267. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
  268. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  269. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
  270. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
  271. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
  272. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
  273. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +18 -0
  274. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
  275. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
  276. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
  277. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
  278. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
  279. package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
  280. package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
  281. package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js +1 -1
  282. package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
  283. package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
  284. package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
  285. package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js +30 -0
  286. package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
  287. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +14 -13
  288. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  289. package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js +13 -12
  290. package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
  291. package/dist/esm/client/components/react-dev-overlay/server/shared.js +0 -26
  292. package/dist/esm/client/components/react-dev-overlay/server/shared.js.map +1 -1
  293. package/dist/esm/client/components/react-dev-overlay/shared.js +2 -0
  294. package/dist/esm/client/components/react-dev-overlay/shared.js.map +1 -1
  295. package/dist/esm/client/index.js +2 -3
  296. package/dist/esm/client/index.js.map +1 -1
  297. package/dist/esm/client/link.js.map +1 -1
  298. package/dist/esm/server/base-server.js +15 -15
  299. package/dist/esm/server/base-server.js.map +1 -1
  300. package/dist/esm/server/config-shared.js.map +1 -1
  301. package/dist/esm/server/config.js +1 -1
  302. package/dist/esm/server/dev/hot-reloader-turbopack.js +4 -2
  303. package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
  304. package/dist/esm/server/dev/hot-reloader-webpack.js +4 -2
  305. package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
  306. package/dist/esm/server/lib/app-info-log.js +1 -1
  307. package/dist/esm/server/lib/start-server.js +1 -1
  308. package/dist/esm/shared/lib/get-rspack.js +32 -0
  309. package/dist/esm/shared/lib/get-rspack.js.map +1 -0
  310. package/dist/server/base-server.js +15 -15
  311. package/dist/server/base-server.js.map +1 -1
  312. package/dist/server/config-shared.d.ts +3 -3
  313. package/dist/server/config-shared.js.map +1 -1
  314. package/dist/server/config.js +1 -1
  315. package/dist/server/dev/hot-reloader-turbopack.js +4 -2
  316. package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
  317. package/dist/server/dev/hot-reloader-webpack.js +4 -2
  318. package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
  319. package/dist/server/lib/app-info-log.js +1 -1
  320. package/dist/server/lib/start-server.js +1 -1
  321. package/dist/shared/lib/get-rspack.d.ts +2 -0
  322. package/dist/shared/lib/get-rspack.js +54 -0
  323. package/dist/shared/lib/get-rspack.js.map +1 -0
  324. package/dist/telemetry/anonymous-meta.js +1 -1
  325. package/dist/telemetry/events/session-stopped.js +2 -2
  326. package/dist/telemetry/events/version.js +2 -2
  327. package/dist/trace/trace-uploader.js +1 -2
  328. package/dist/trace/trace-uploader.js.map +1 -1
  329. package/package.json +15 -15
  330. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.d.ts +0 -3
  331. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -43
  332. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
  333. package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -27
  334. package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/build/webpack/plugins/next-trace-entrypoints-plugin.ts"],"sourcesContent":["import nodePath from 'path'\nimport type { Span } from '../../../trace'\nimport { spans } from './profiling-plugin'\nimport isError from '../../../lib/is-error'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport type { NodeFileTraceReasons } from 'next/dist/compiled/@vercel/nft'\nimport {\n CLIENT_REFERENCE_MANIFEST,\n TRACE_OUTPUT_VERSION,\n type CompilerNameValues,\n} from '../../../shared/lib/constants'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n NODE_ESM_RESOLVE_OPTIONS,\n NODE_RESOLVE_OPTIONS,\n} from '../../webpack-config'\nimport type { NextConfigComplete } from '../../../server/config-shared'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getPageFilePath } from '../../entries'\nimport { resolveExternal } from '../../handle-externals'\nimport { isStaticMetadataRoute } from '../../../lib/metadata/is-metadata-route'\n\nconst PLUGIN_NAME = 'TraceEntryPointsPlugin'\nexport const TRACE_IGNORES = [\n '**/*/next/dist/server/next.js',\n '**/*/next/dist/bin/next',\n]\n\nconst NOT_TRACEABLE = [\n '.wasm',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n '.bmp',\n '.svg',\n]\n\nfunction getModuleFromDependency(\n compilation: any,\n dep: any\n): webpack.Module & { resource?: string; request?: string } {\n return compilation.moduleGraph.getModule(dep)\n}\n\nexport function getFilesMapFromReasons(\n fileList: Set<string>,\n reasons: NodeFileTraceReasons,\n ignoreFn?: (file: string, parent?: string) => Boolean\n) {\n // this uses the reasons tree to collect files specific to a\n // certain parent allowing us to not have to trace each parent\n // separately\n const parentFilesMap = new Map<string, Map<string, { ignored: boolean }>>()\n\n function propagateToParents(\n parents: Set<string>,\n file: string,\n seen = new Set<string>()\n ) {\n for (const parent of parents || []) {\n if (!seen.has(parent)) {\n seen.add(parent)\n let parentFiles = parentFilesMap.get(parent)\n\n if (!parentFiles) {\n parentFiles = new Map()\n parentFilesMap.set(parent, parentFiles)\n }\n const ignored = Boolean(ignoreFn?.(file, parent))\n parentFiles.set(file, { ignored })\n\n const parentReason = reasons.get(parent)\n\n if (parentReason?.parents) {\n propagateToParents(parentReason.parents, file, seen)\n }\n }\n }\n }\n\n for (const file of fileList!) {\n const reason = reasons!.get(file)\n const isInitial =\n reason?.type.length === 1 && reason.type.includes('initial')\n\n if (\n !reason ||\n !reason.parents ||\n (isInitial && reason.parents.size === 0)\n ) {\n continue\n }\n propagateToParents(reason.parents, file)\n }\n return parentFilesMap\n}\n\nexport interface TurbotraceAction {\n action: 'print' | 'annotate'\n input: string[]\n contextDirectory: string\n processCwd: string\n showAll?: boolean\n memoryLimit?: number\n}\n\nexport interface BuildTraceContext {\n entriesTrace?: {\n action: TurbotraceAction\n appDir: string\n outputPath: string\n depModArray: string[]\n entryNameMap: Record<string, string>\n absolutePathByEntryName: Record<string, string>\n }\n chunksTrace?: {\n action: TurbotraceAction\n outputPath: string\n entryNameFilesMap: Record<string, Array<string>>\n }\n}\n\nexport class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {\n public buildTraceContext: BuildTraceContext = {}\n\n private rootDir: string\n private appDir: string | undefined\n private pagesDir: string | undefined\n private optOutBundlingPackages: string[]\n private appDirEnabled?: boolean\n private tracingRoot: string\n private entryTraces: Map<string, Map<string, { bundled: boolean }>>\n private traceIgnores: string[]\n private esmExternals?: NextConfigComplete['experimental']['esmExternals']\n private compilerType: CompilerNameValues\n\n constructor({\n rootDir,\n appDir,\n pagesDir,\n compilerType,\n optOutBundlingPackages,\n appDirEnabled,\n traceIgnores,\n esmExternals,\n outputFileTracingRoot,\n }: {\n rootDir: string\n compilerType: CompilerNameValues\n appDir: string | undefined\n pagesDir: string | undefined\n optOutBundlingPackages: string[]\n appDirEnabled?: boolean\n traceIgnores?: string[]\n outputFileTracingRoot?: string\n esmExternals?: NextConfigComplete['experimental']['esmExternals']\n }) {\n this.rootDir = rootDir\n this.appDir = appDir\n this.pagesDir = pagesDir\n this.entryTraces = new Map()\n this.esmExternals = esmExternals\n this.appDirEnabled = appDirEnabled\n this.traceIgnores = traceIgnores || []\n this.tracingRoot = outputFileTracingRoot || rootDir\n this.optOutBundlingPackages = optOutBundlingPackages\n this.compilerType = compilerType\n }\n\n // Here we output all traced assets and webpack chunks to a\n // ${page}.js.nft.json file\n async createTraceAssets(compilation: webpack.Compilation, span: Span) {\n const outputPath = compilation.outputOptions.path || ''\n\n await span.traceChild('create-trace-assets').traceAsyncFn(async () => {\n const entryFilesMap = new Map<any, Set<string>>()\n const chunksToTrace = new Set<string>()\n const entryNameFilesMap = new Map<string, Array<string>>()\n\n const isTraceable = (file: string) =>\n !NOT_TRACEABLE.some((suffix) => {\n return file.endsWith(suffix)\n })\n\n for (const entrypoint of compilation.entrypoints.values()) {\n const entryFiles = new Set<string>()\n\n for (const chunk of entrypoint\n .getEntrypointChunk()\n .getAllReferencedChunks()) {\n for (const file of chunk.files) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n for (const file of chunk.auxiliaryFiles) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n }\n entryFilesMap.set(entrypoint, entryFiles)\n entryNameFilesMap.set(entrypoint.name || '', [...entryFiles])\n }\n\n // startTrace existed and callable\n this.buildTraceContext.chunksTrace = {\n action: {\n action: 'annotate',\n input: [...chunksToTrace],\n contextDirectory: this.tracingRoot,\n processCwd: this.rootDir,\n },\n outputPath,\n entryNameFilesMap: Object.fromEntries(entryNameFilesMap),\n }\n\n // server compiler outputs to `server/chunks` so we traverse up\n // one, but edge-server does not so don't for that one\n const outputPrefix = this.compilerType === 'server' ? '../' : ''\n\n for (const [entrypoint, entryFiles] of entryFilesMap) {\n const traceOutputName = `${outputPrefix}${entrypoint.name}.js.nft.json`\n const traceOutputPath = nodePath.dirname(\n nodePath.join(outputPath, traceOutputName)\n )\n\n // don't include the entry itself in the trace\n entryFiles.delete(\n nodePath.join(outputPath, `${outputPrefix}${entrypoint.name}.js`)\n )\n\n if (entrypoint.name.startsWith('app/') && this.appDir) {\n const appDirRelativeEntryPath =\n this.buildTraceContext.entriesTrace?.absolutePathByEntryName[\n entrypoint.name\n ]?.replace(this.appDir, '')\n\n const entryIsStaticMetadataRoute =\n appDirRelativeEntryPath &&\n isStaticMetadataRoute(appDirRelativeEntryPath)\n\n // Include the client reference manifest in the trace, but not for\n // static metadata routes, for which we don't generate those.\n if (!entryIsStaticMetadataRoute) {\n entryFiles.add(\n nodePath.join(\n outputPath,\n outputPrefix,\n entrypoint.name.replace(/%5F/g, '_') +\n '_' +\n CLIENT_REFERENCE_MANIFEST +\n '.js'\n )\n )\n }\n }\n\n const finalFiles: string[] = []\n\n await Promise.all(\n [\n ...new Set([\n ...entryFiles,\n ...(this.entryTraces.get(entrypoint.name)?.keys() || []),\n ]),\n ].map(async (file) => {\n const fileInfo = this.entryTraces.get(entrypoint.name)?.get(file)\n\n const relativeFile = nodePath\n .relative(traceOutputPath, file)\n .replace(/\\\\/g, '/')\n\n if (file) {\n if (!fileInfo?.bundled) {\n finalFiles.push(relativeFile)\n }\n }\n })\n )\n\n compilation.emitAsset(\n traceOutputName,\n new sources.RawSource(\n JSON.stringify({\n version: TRACE_OUTPUT_VERSION,\n files: finalFiles,\n })\n ) as unknown as webpack.sources.RawSource\n )\n }\n })\n }\n\n tapfinishModules(\n compilation: webpack.Compilation,\n traceEntrypointsPluginSpan: Span,\n doResolve: (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ) => Promise<string>,\n readlink: any,\n stat: any\n ) {\n compilation.hooks.finishModules.tapAsync(\n PLUGIN_NAME,\n async (_stats: any, callback: any) => {\n const finishModulesSpan =\n traceEntrypointsPluginSpan.traceChild('finish-modules')\n await finishModulesSpan\n .traceAsyncFn(async () => {\n // we create entry -> module maps so that we can\n // look them up faster instead of having to iterate\n // over the compilation modules list\n const entryNameMap = new Map<string, string>()\n const entryModMap = new Map<string, any>()\n const additionalEntries = new Map<string, Map<string, any>>()\n const absolutePathByEntryName = new Map<string, string>()\n\n const depModMap = new Map<string, any>()\n\n await finishModulesSpan\n .traceChild('get-entries')\n .traceAsyncFn(async () => {\n for (const [name, entry] of compilation.entries.entries()) {\n const normalizedName = name?.replace(/\\\\/g, '/')\n\n const isPage = normalizedName.startsWith('pages/')\n const isApp =\n this.appDirEnabled && normalizedName.startsWith('app/')\n\n if (isApp || isPage) {\n for (const dep of entry.dependencies) {\n if (!dep) continue\n const entryMod = getModuleFromDependency(compilation, dep)\n\n // Handle case where entry is a loader coming from Next.js.\n // For example edge-loader or app-loader.\n if (entryMod && entryMod.resource === '') {\n const moduleBuildInfo = getModuleBuildInfo(entryMod)\n // All loaders that are used to create entries have a `route` property on the buildInfo.\n if (moduleBuildInfo.route) {\n const absolutePath = getPageFilePath({\n absolutePagePath:\n moduleBuildInfo.route.absolutePagePath,\n rootDir: this.rootDir,\n appDir: this.appDir,\n pagesDir: this.pagesDir,\n })\n\n // Ensures we don't handle non-pages.\n if (\n (this.pagesDir &&\n absolutePath.startsWith(this.pagesDir)) ||\n (this.appDir &&\n absolutePath.startsWith(this.appDir))\n ) {\n entryModMap.set(absolutePath, entryMod)\n entryNameMap.set(absolutePath, name)\n absolutePathByEntryName.set(name, absolutePath)\n }\n }\n\n // If there was no `route` property, we can assume that it was something custom instead.\n // In order to trace these we add them to the additionalEntries map.\n if (entryMod.request) {\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.request, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n\n if (entryMod && entryMod.resource) {\n entryNameMap.set(entryMod.resource, name)\n entryModMap.set(entryMod.resource, entryMod)\n\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.resource, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n }\n }\n })\n\n const readFile = async (\n path: string\n ): Promise<Buffer | string | null> => {\n const mod = depModMap.get(path) || entryModMap.get(path)\n\n // map the transpiled source when available to avoid\n // parse errors in node-file-trace\n let source: Buffer | string = mod?.originalSource?.()?.buffer()\n return source || ''\n }\n\n const entryPaths = Array.from(entryModMap.keys())\n\n const collectDependencies = async (mod: any, parent: string) => {\n if (!mod || !mod.dependencies) return\n\n for (const dep of mod.dependencies) {\n const depMod = getModuleFromDependency(compilation, dep)\n\n if (depMod?.resource && !depModMap.get(depMod.resource)) {\n depModMap.set(depMod.resource, depMod)\n await collectDependencies(depMod, parent)\n }\n }\n }\n const entriesToTrace = [...entryPaths]\n\n for (const entry of entryPaths) {\n await collectDependencies(entryModMap.get(entry), entry)\n const entryName = entryNameMap.get(entry)!\n const curExtraEntries = additionalEntries.get(entryName)\n\n if (curExtraEntries) {\n entriesToTrace.push(...curExtraEntries.keys())\n }\n }\n\n const contextDirectory = this.tracingRoot\n const chunks = [...entriesToTrace]\n\n this.buildTraceContext.entriesTrace = {\n action: {\n action: 'print',\n input: chunks,\n contextDirectory,\n processCwd: this.rootDir,\n },\n appDir: this.rootDir,\n depModArray: Array.from(depModMap.keys()),\n entryNameMap: Object.fromEntries(entryNameMap),\n absolutePathByEntryName: Object.fromEntries(\n absolutePathByEntryName\n ),\n outputPath: compilation.outputOptions.path!,\n }\n\n let fileList: Set<string>\n let reasons: NodeFileTraceReasons\n const ignores = [\n ...TRACE_IGNORES,\n ...this.traceIgnores,\n '**/node_modules/**',\n ]\n\n // pre-compile the ignore matcher to avoid repeating on every ignoreFn call\n const isIgnoreMatcher = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n const ignoreFn = (path: string) => {\n return isIgnoreMatcher(path)\n }\n\n await finishModulesSpan\n .traceChild('node-file-trace-plugin', {\n traceEntryCount: entriesToTrace.length + '',\n })\n .traceAsyncFn(async () => {\n const result = await nodeFileTrace(entriesToTrace, {\n base: this.tracingRoot,\n processCwd: this.rootDir,\n readFile,\n readlink,\n stat,\n resolve: doResolve\n ? async (id, parent, job, isCjs) => {\n return doResolve(id, parent, job, !isCjs)\n }\n : undefined,\n ignore: ignoreFn,\n mixedModules: true,\n })\n // @ts-ignore\n fileList = result.fileList\n result.esmFileList.forEach((file) => fileList.add(file))\n reasons = result.reasons\n })\n\n await finishModulesSpan\n .traceChild('collect-traced-files')\n .traceAsyncFn(() => {\n const parentFilesMap = getFilesMapFromReasons(\n fileList,\n reasons,\n (file) => {\n // if a file was imported and a loader handled it\n // we don't include it in the trace e.g.\n // static image imports, CSS imports\n file = nodePath.join(this.tracingRoot, file)\n const depMod = depModMap.get(file)\n const isAsset = reasons\n .get(nodePath.relative(this.tracingRoot, file))\n ?.type.includes('asset')\n\n return (\n !isAsset &&\n Array.isArray(depMod?.loaders) &&\n depMod.loaders.length > 0\n )\n }\n )\n\n for (const entry of entryPaths) {\n const entryName = entryNameMap.get(entry)!\n const normalizedEntry = nodePath.relative(\n this.tracingRoot,\n entry\n )\n const curExtraEntries = additionalEntries.get(entryName)\n const finalDeps = new Map<string, { bundled: boolean }>()\n\n // ensure we include entry source file as well for\n // hash comparison\n finalDeps.set(entry, {\n bundled: true,\n })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n\n if (curExtraEntries) {\n for (const extraEntry of curExtraEntries.keys()) {\n const normalizedExtraEntry = nodePath.relative(\n this.tracingRoot,\n extraEntry\n )\n finalDeps.set(extraEntry, { bundled: false })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedExtraEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n }\n }\n this.entryTraces.set(entryName, finalDeps)\n }\n })\n })\n .then(\n () => callback(),\n (err) => callback(err)\n )\n }\n )\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {\n const readlink = async (path: string): Promise<string | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(\n compilation.inputFileSystem\n .readlink as typeof import('fs').readlink\n )(path, (err, link) => {\n if (err) return reject(err)\n resolve(link)\n })\n })\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' || e.code === 'ENOENT' || e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n }\n const stat = async (path: string): Promise<import('fs').Stats | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(compilation.inputFileSystem.stat as typeof import('fs').stat)(\n path,\n (err, stats) => {\n if (err) return reject(err)\n resolve(stats)\n }\n )\n })\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n }\n\n const compilationSpan = spans.get(compilation) || spans.get(compiler)!\n const traceEntrypointsPluginSpan = compilationSpan.traceChild(\n 'next-trace-entrypoint-plugin'\n )\n traceEntrypointsPluginSpan.traceFn(() => {\n compilation.hooks.processAssets.tapAsync(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,\n },\n (_, callback: any) => {\n this.createTraceAssets(compilation, traceEntrypointsPluginSpan)\n .then(() => callback())\n .catch((err) => callback(err))\n }\n )\n\n let resolver = compilation.resolverFactory.get('normal')\n\n function getPkgName(name: string) {\n const segments = name.split('/')\n if (name[0] === '@' && segments.length > 1)\n return segments.length > 1 ? segments.slice(0, 2).join('/') : null\n return segments.length ? segments[0] : null\n }\n\n const getResolve = (\n options: Parameters<typeof resolver.withOptions>[0]\n ) => {\n const curResolver = resolver.withOptions(options)\n\n return (\n parent: string,\n request: string,\n job: import('@vercel/nft/out/node-file-trace').Job\n ) =>\n new Promise<[string, boolean]>((resolve, reject) => {\n const context = nodePath.dirname(parent)\n\n curResolver.resolve(\n {},\n context,\n request,\n {\n fileDependencies: compilation.fileDependencies,\n missingDependencies: compilation.missingDependencies,\n contextDependencies: compilation.contextDependencies,\n },\n async (err: any, result?, resContext?) => {\n if (err) return reject(err)\n\n if (!result) {\n return reject(new Error('module not found'))\n }\n\n // webpack resolver doesn't strip loader query info\n // from the result so use path instead\n if (result.includes('?') || result.includes('!')) {\n result = resContext?.path || result\n }\n\n try {\n // we need to collect all parent package.json's used\n // as webpack's resolve doesn't expose this and parent\n // package.json could be needed for resolving e.g. stylis\n // stylis/package.json -> stylis/dist/umd/package.json\n if (result.includes('node_modules')) {\n let requestPath = result\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n\n if (\n !nodePath.isAbsolute(request) &&\n request.includes('/') &&\n resContext?.descriptionFileRoot\n ) {\n requestPath = (\n resContext.descriptionFileRoot +\n request.slice(getPkgName(request)?.length || 0) +\n nodePath.sep +\n 'package.json'\n )\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n }\n\n const rootSeparatorIndex = requestPath.indexOf('/')\n let separatorIndex: number\n while (\n (separatorIndex = requestPath.lastIndexOf('/')) >\n rootSeparatorIndex\n ) {\n requestPath = requestPath.slice(0, separatorIndex)\n const curPackageJsonPath = `${requestPath}/package.json`\n if (await job.isFile(curPackageJsonPath)) {\n await job.emitFile(\n await job.realpath(curPackageJsonPath),\n 'resolve',\n parent\n )\n }\n }\n }\n } catch (_err) {\n // we failed to resolve the package.json boundary,\n // we don't block emitting the initial asset from this\n }\n resolve([result, options.dependencyType === 'esm'])\n }\n )\n })\n }\n\n const CJS_RESOLVE_OPTIONS = {\n ...NODE_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_CJS_RESOLVE_OPTIONS = {\n ...CJS_RESOLVE_OPTIONS,\n alias: false,\n }\n const ESM_RESOLVE_OPTIONS = {\n ...NODE_ESM_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_ESM_RESOLVE_OPTIONS = {\n ...ESM_RESOLVE_OPTIONS,\n alias: false,\n }\n\n const doResolve = async (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ): Promise<string> => {\n const context = nodePath.dirname(parent)\n // When in esm externals mode, and using import, we resolve with\n // ESM resolving options.\n const { res } = await resolveExternal(\n this.rootDir,\n this.esmExternals,\n context,\n request,\n isEsmRequested,\n this.optOutBundlingPackages,\n (options) => (_: string, resRequest: string) => {\n return getResolve(options)(parent, resRequest, job)\n },\n undefined,\n undefined,\n ESM_RESOLVE_OPTIONS,\n CJS_RESOLVE_OPTIONS,\n BASE_ESM_RESOLVE_OPTIONS,\n BASE_CJS_RESOLVE_OPTIONS\n )\n\n if (!res) {\n throw new Error(`failed to resolve ${request} from ${parent}`)\n }\n return res.replace(/\\0/g, '')\n }\n\n this.tapfinishModules(\n compilation,\n traceEntrypointsPluginSpan,\n doResolve,\n readlink,\n stat\n )\n })\n })\n }\n}\n"],"names":["TRACE_IGNORES","TraceEntryPointsPlugin","getFilesMapFromReasons","PLUGIN_NAME","NOT_TRACEABLE","getModuleFromDependency","compilation","dep","moduleGraph","getModule","fileList","reasons","ignoreFn","parentFilesMap","Map","propagateToParents","parents","file","seen","Set","parent","has","add","parentFiles","get","set","ignored","Boolean","parentReason","reason","isInitial","type","length","includes","size","constructor","rootDir","appDir","pagesDir","compilerType","optOutBundlingPackages","appDirEnabled","traceIgnores","esmExternals","outputFileTracingRoot","buildTraceContext","entryTraces","tracingRoot","createTraceAssets","span","outputPath","outputOptions","path","traceChild","traceAsyncFn","entryFilesMap","chunksToTrace","entryNameFilesMap","isTraceable","some","suffix","endsWith","entrypoint","entrypoints","values","entryFiles","chunk","getEntrypointChunk","getAllReferencedChunks","files","filePath","nodePath","join","auxiliaryFiles","name","chunksTrace","action","input","contextDirectory","processCwd","Object","fromEntries","outputPrefix","traceOutputName","traceOutputPath","dirname","delete","startsWith","appDirRelativeEntryPath","entriesTrace","absolutePathByEntryName","replace","entryIsStaticMetadataRoute","isStaticMetadataRoute","CLIENT_REFERENCE_MANIFEST","finalFiles","Promise","all","keys","map","fileInfo","relativeFile","relative","bundled","push","emitAsset","sources","RawSource","JSON","stringify","version","TRACE_OUTPUT_VERSION","tapfinishModules","traceEntrypointsPluginSpan","doResolve","readlink","stat","hooks","finishModules","tapAsync","_stats","callback","finishModulesSpan","entryNameMap","entryModMap","additionalEntries","depModMap","entry","entries","normalizedName","isPage","isApp","dependencies","entryMod","resource","moduleBuildInfo","getModuleBuildInfo","route","absolutePath","getPageFilePath","absolutePagePath","request","curMap","readFile","mod","source","originalSource","buffer","entryPaths","Array","from","collectDependencies","depMod","entriesToTrace","entryName","curExtraEntries","chunks","depModArray","ignores","isIgnoreMatcher","picomatch","contains","dot","traceEntryCount","result","nodeFileTrace","base","resolve","id","job","isCjs","undefined","ignore","mixedModules","esmFileList","forEach","isAsset","isArray","loaders","normalizedEntry","finalDeps","info","extraEntry","normalizedExtraEntry","then","err","apply","compiler","tap","reject","inputFileSystem","link","e","isError","code","stats","compilationSpan","spans","traceFn","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_SUMMARIZE","_","catch","resolver","resolverFactory","getPkgName","segments","split","slice","getResolve","options","curResolver","withOptions","context","fileDependencies","missingDependencies","contextDependencies","resContext","Error","requestPath","isAbsolute","descriptionFileRoot","sep","rootSeparatorIndex","indexOf","separatorIndex","lastIndexOf","curPackageJsonPath","isFile","emitFile","realpath","_err","dependencyType","CJS_RESOLVE_OPTIONS","NODE_RESOLVE_OPTIONS","fullySpecified","modules","extensions","BASE_CJS_RESOLVE_OPTIONS","alias","ESM_RESOLVE_OPTIONS","NODE_ESM_RESOLVE_OPTIONS","BASE_ESM_RESOLVE_OPTIONS","isEsmRequested","res","resolveExternal","resRequest"],"mappings":";;;;;;;;;;;;;;;;IAwBaA,aAAa;eAAbA;;IAuGAC,sBAAsB;eAAtBA;;IA9EGC,sBAAsB;eAAtBA;;;6DAjDK;iCAEC;gEACF;qBACU;2BAMvB;yBAC0B;+BAI1B;kEAEe;oCACa;yBACH;iCACA;iCACM;;;;;;AAEtC,MAAMC,cAAc;AACb,MAAMH,gBAAgB;IAC3B;IACA;CACD;AAED,MAAMI,gBAAgB;IACpB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,SAASC,wBACPC,WAAgB,EAChBC,GAAQ;IAER,OAAOD,YAAYE,WAAW,CAACC,SAAS,CAACF;AAC3C;AAEO,SAASL,uBACdQ,QAAqB,EACrBC,OAA6B,EAC7BC,QAAqD;IAErD,4DAA4D;IAC5D,8DAA8D;IAC9D,aAAa;IACb,MAAMC,iBAAiB,IAAIC;IAE3B,SAASC,mBACPC,OAAoB,EACpBC,IAAY,EACZC,OAAO,IAAIC,KAAa;QAExB,KAAK,MAAMC,UAAUJ,WAAW,EAAE,CAAE;YAClC,IAAI,CAACE,KAAKG,GAAG,CAACD,SAAS;gBACrBF,KAAKI,GAAG,CAACF;gBACT,IAAIG,cAAcV,eAAeW,GAAG,CAACJ;gBAErC,IAAI,CAACG,aAAa;oBAChBA,cAAc,IAAIT;oBAClBD,eAAeY,GAAG,CAACL,QAAQG;gBAC7B;gBACA,MAAMG,UAAUC,QAAQf,4BAAAA,SAAWK,MAAMG;gBACzCG,YAAYE,GAAG,CAAC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SACA3E,SACAyG,gBACA,IAAI,CAAC9M,sBAAsB,EAC3B,CAAC6K,UAAY,CAACT,GAAW6C;4BACvB,OAAOrC,WAAWC,SAASjM,QAAQqO,YAAYhF;wBACjD,GACAE,WACAA,WACAwE,qBACAP,qBACAS,0BACAJ;oBAGF,IAAI,CAACM,KAAK;wBACR,MAAM,qBAAwD,CAAxD,IAAI1B,MAAM,CAAC,kBAAkB,EAAEhF,QAAQ,MAAM,EAAEzH,QAAQ,GAAvD,qBAAA;mCAAA;wCAAA;0CAAA;wBAAuD;oBAC/D;oBACA,OAAOmO,IAAI5J,OAAO,CAAC,OAAO;gBAC5B;gBAEA,IAAI,CAACqB,gBAAgB,CACnB1G,aACA2G,4BACAC,WACAC,UACAC;YAEJ;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/build/webpack/plugins/next-trace-entrypoints-plugin.ts"],"sourcesContent":["import nodePath from 'path'\nimport type { Span } from '../../../trace'\nimport { spans } from './profiling-plugin'\nimport isError from '../../../lib/is-error'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport type { NodeFileTraceReasons } from 'next/dist/compiled/@vercel/nft'\nimport {\n CLIENT_REFERENCE_MANIFEST,\n TRACE_OUTPUT_VERSION,\n type CompilerNameValues,\n} from '../../../shared/lib/constants'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n NODE_ESM_RESOLVE_OPTIONS,\n NODE_RESOLVE_OPTIONS,\n} from '../../webpack-config'\nimport type { NextConfigComplete } from '../../../server/config-shared'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getPageFilePath } from '../../entries'\nimport { resolveExternal } from '../../handle-externals'\nimport { isStaticMetadataRoute } from '../../../lib/metadata/is-metadata-route'\n\nconst PLUGIN_NAME = 'TraceEntryPointsPlugin'\nexport const TRACE_IGNORES = [\n '**/*/next/dist/server/next.js',\n '**/*/next/dist/bin/next',\n]\n\nconst NOT_TRACEABLE = [\n '.wasm',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n '.bmp',\n '.svg',\n]\n\nfunction getModuleFromDependency(\n compilation: any,\n dep: any\n): webpack.Module & { resource?: string; request?: string } {\n return compilation.moduleGraph.getModule(dep)\n}\n\nexport function getFilesMapFromReasons(\n fileList: Set<string>,\n reasons: NodeFileTraceReasons,\n ignoreFn?: (file: string, parent?: string) => Boolean\n) {\n // this uses the reasons tree to collect files specific to a\n // certain parent allowing us to not have to trace each parent\n // separately\n const parentFilesMap = new Map<string, Map<string, { ignored: boolean }>>()\n\n function propagateToParents(\n parents: Set<string>,\n file: string,\n seen = new Set<string>()\n ) {\n for (const parent of parents || []) {\n if (!seen.has(parent)) {\n seen.add(parent)\n let parentFiles = parentFilesMap.get(parent)\n\n if (!parentFiles) {\n parentFiles = new Map()\n parentFilesMap.set(parent, parentFiles)\n }\n const ignored = Boolean(ignoreFn?.(file, parent))\n parentFiles.set(file, { ignored })\n\n const parentReason = reasons.get(parent)\n\n if (parentReason?.parents) {\n propagateToParents(parentReason.parents, file, seen)\n }\n }\n }\n }\n\n for (const file of fileList!) {\n const reason = reasons!.get(file)\n const isInitial =\n reason?.type.length === 1 && reason.type.includes('initial')\n\n if (\n !reason ||\n !reason.parents ||\n (isInitial && reason.parents.size === 0)\n ) {\n continue\n }\n propagateToParents(reason.parents, file)\n }\n return parentFilesMap\n}\n\nexport interface TurbotraceAction {\n action: 'print' | 'annotate'\n input: string[]\n contextDirectory: string\n processCwd: string\n showAll?: boolean\n memoryLimit?: number\n}\n\nexport interface BuildTraceContext {\n entriesTrace?: {\n action: TurbotraceAction\n appDir: string\n outputPath: string\n depModArray: string[]\n entryNameMap: Record<string, string>\n absolutePathByEntryName: Record<string, string>\n }\n chunksTrace?: {\n action: TurbotraceAction\n outputPath: string\n entryNameFilesMap: Record<string, Array<string>>\n }\n}\n\nexport class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {\n public buildTraceContext: BuildTraceContext = {}\n\n private rootDir: string\n private appDir: string | undefined\n private pagesDir: string | undefined\n private optOutBundlingPackages: string[]\n private appDirEnabled?: boolean\n private tracingRoot: string\n private entryTraces: Map<string, Map<string, { bundled: boolean }>>\n private traceIgnores: string[]\n private esmExternals?: NextConfigComplete['experimental']['esmExternals']\n private compilerType: CompilerNameValues\n\n constructor({\n rootDir,\n appDir,\n pagesDir,\n compilerType,\n optOutBundlingPackages,\n appDirEnabled,\n traceIgnores,\n esmExternals,\n outputFileTracingRoot,\n }: {\n rootDir: string\n compilerType: CompilerNameValues\n appDir: string | undefined\n pagesDir: string | undefined\n optOutBundlingPackages: string[]\n appDirEnabled?: boolean\n traceIgnores?: string[]\n outputFileTracingRoot?: string\n esmExternals?: NextConfigComplete['experimental']['esmExternals']\n }) {\n this.rootDir = rootDir\n this.appDir = appDir\n this.pagesDir = pagesDir\n this.entryTraces = new Map()\n this.esmExternals = esmExternals\n this.appDirEnabled = appDirEnabled\n this.traceIgnores = traceIgnores || []\n this.tracingRoot = outputFileTracingRoot || rootDir\n this.optOutBundlingPackages = optOutBundlingPackages\n this.compilerType = compilerType\n }\n\n // Here we output all traced assets and webpack chunks to a\n // ${page}.js.nft.json file\n async createTraceAssets(compilation: webpack.Compilation, span: Span) {\n const outputPath = compilation.outputOptions.path || ''\n\n await span.traceChild('create-trace-assets').traceAsyncFn(async () => {\n const entryFilesMap = new Map<any, Set<string>>()\n const chunksToTrace = new Set<string>()\n const entryNameFilesMap = new Map<string, Array<string>>()\n\n const isTraceable = (file: string) =>\n !NOT_TRACEABLE.some((suffix) => {\n return file.endsWith(suffix)\n })\n\n for (const entrypoint of compilation.entrypoints.values()) {\n const entryFiles = new Set<string>()\n\n for (const chunk of process.env.NEXT_RSPACK\n ? entrypoint.chunks\n : entrypoint.getEntrypointChunk().getAllReferencedChunks()) {\n for (const file of chunk.files) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n for (const file of chunk.auxiliaryFiles) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n }\n entryFilesMap.set(entrypoint, entryFiles)\n entryNameFilesMap.set(entrypoint.name || '', [...entryFiles])\n }\n\n // startTrace existed and callable\n this.buildTraceContext.chunksTrace = {\n action: {\n action: 'annotate',\n input: [...chunksToTrace],\n contextDirectory: this.tracingRoot,\n processCwd: this.rootDir,\n },\n outputPath,\n entryNameFilesMap: Object.fromEntries(entryNameFilesMap),\n }\n\n // server compiler outputs to `server/chunks` so we traverse up\n // one, but edge-server does not so don't for that one\n const outputPrefix = this.compilerType === 'server' ? '../' : ''\n\n for (const [entrypoint, entryFiles] of entryFilesMap) {\n const traceOutputName = `${outputPrefix}${entrypoint.name}.js.nft.json`\n const traceOutputPath = nodePath.dirname(\n nodePath.join(outputPath, traceOutputName)\n )\n\n // don't include the entry itself in the trace\n entryFiles.delete(\n nodePath.join(outputPath, `${outputPrefix}${entrypoint.name}.js`)\n )\n\n if (entrypoint.name.startsWith('app/') && this.appDir) {\n const appDirRelativeEntryPath =\n this.buildTraceContext.entriesTrace?.absolutePathByEntryName[\n entrypoint.name\n ]?.replace(this.appDir, '')\n\n const entryIsStaticMetadataRoute =\n appDirRelativeEntryPath &&\n isStaticMetadataRoute(appDirRelativeEntryPath)\n\n // Include the client reference manifest in the trace, but not for\n // static metadata routes, for which we don't generate those.\n if (!entryIsStaticMetadataRoute) {\n entryFiles.add(\n nodePath.join(\n outputPath,\n outputPrefix,\n entrypoint.name.replace(/%5F/g, '_') +\n '_' +\n CLIENT_REFERENCE_MANIFEST +\n '.js'\n )\n )\n }\n }\n\n const finalFiles: string[] = []\n\n await Promise.all(\n [\n ...new Set([\n ...entryFiles,\n ...(this.entryTraces.get(entrypoint.name)?.keys() || []),\n ]),\n ].map(async (file) => {\n const fileInfo = this.entryTraces.get(entrypoint.name)?.get(file)\n\n const relativeFile = nodePath\n .relative(traceOutputPath, file)\n .replace(/\\\\/g, '/')\n\n if (file) {\n if (!fileInfo?.bundled) {\n finalFiles.push(relativeFile)\n }\n }\n })\n )\n\n compilation.emitAsset(\n traceOutputName,\n new sources.RawSource(\n JSON.stringify({\n version: TRACE_OUTPUT_VERSION,\n files: finalFiles,\n })\n ) as unknown as webpack.sources.RawSource\n )\n }\n })\n }\n\n tapfinishModules(\n compilation: webpack.Compilation,\n traceEntrypointsPluginSpan: Span,\n doResolve: (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ) => Promise<string>,\n readlink: any,\n stat: any\n ) {\n compilation.hooks.finishModules.tapAsync(\n PLUGIN_NAME,\n async (_stats: any, callback: any) => {\n const finishModulesSpan =\n traceEntrypointsPluginSpan.traceChild('finish-modules')\n await finishModulesSpan\n .traceAsyncFn(async () => {\n // we create entry -> module maps so that we can\n // look them up faster instead of having to iterate\n // over the compilation modules list\n const entryNameMap = new Map<string, string>()\n const entryModMap = new Map<string, any>()\n const additionalEntries = new Map<string, Map<string, any>>()\n const absolutePathByEntryName = new Map<string, string>()\n\n const depModMap = new Map<string, any>()\n\n await finishModulesSpan\n .traceChild('get-entries')\n .traceAsyncFn(async () => {\n for (const [name, entry] of compilation.entries.entries()) {\n const normalizedName = name?.replace(/\\\\/g, '/')\n\n const isPage = normalizedName.startsWith('pages/')\n const isApp =\n this.appDirEnabled && normalizedName.startsWith('app/')\n\n if (isApp || isPage) {\n for (const dep of entry.dependencies) {\n if (!dep) continue\n const entryMod = getModuleFromDependency(compilation, dep)\n\n // Handle case where entry is a loader coming from Next.js.\n // For example edge-loader or app-loader.\n if (entryMod && entryMod.resource === '') {\n const moduleBuildInfo = getModuleBuildInfo(entryMod)\n // All loaders that are used to create entries have a `route` property on the buildInfo.\n if (moduleBuildInfo.route) {\n const absolutePath = getPageFilePath({\n absolutePagePath:\n moduleBuildInfo.route.absolutePagePath,\n rootDir: this.rootDir,\n appDir: this.appDir,\n pagesDir: this.pagesDir,\n })\n\n // Ensures we don't handle non-pages.\n if (\n (this.pagesDir &&\n absolutePath.startsWith(this.pagesDir)) ||\n (this.appDir &&\n absolutePath.startsWith(this.appDir))\n ) {\n entryModMap.set(absolutePath, entryMod)\n entryNameMap.set(absolutePath, name)\n absolutePathByEntryName.set(name, absolutePath)\n }\n }\n\n // If there was no `route` property, we can assume that it was something custom instead.\n // In order to trace these we add them to the additionalEntries map.\n if (entryMod.request) {\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.request, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n\n if (entryMod && entryMod.resource) {\n entryNameMap.set(entryMod.resource, name)\n entryModMap.set(entryMod.resource, entryMod)\n\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.resource, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n }\n }\n })\n\n const readFile = async (\n path: string\n ): Promise<Buffer | string | null> => {\n const mod = depModMap.get(path) || entryModMap.get(path)\n\n // map the transpiled source when available to avoid\n // parse errors in node-file-trace\n let source: Buffer | string = mod?.originalSource?.()?.buffer()\n return source || ''\n }\n\n const entryPaths = Array.from(entryModMap.keys())\n\n const collectDependencies = async (mod: any, parent: string) => {\n if (!mod || !mod.dependencies) return\n\n for (const dep of mod.dependencies) {\n const depMod = getModuleFromDependency(compilation, dep)\n\n if (depMod?.resource && !depModMap.get(depMod.resource)) {\n depModMap.set(depMod.resource, depMod)\n await collectDependencies(depMod, parent)\n }\n }\n }\n const entriesToTrace = [...entryPaths]\n\n for (const entry of entryPaths) {\n await collectDependencies(entryModMap.get(entry), entry)\n const entryName = entryNameMap.get(entry)!\n const curExtraEntries = additionalEntries.get(entryName)\n\n if (curExtraEntries) {\n entriesToTrace.push(...curExtraEntries.keys())\n }\n }\n\n const contextDirectory = this.tracingRoot\n const chunks = [...entriesToTrace]\n\n this.buildTraceContext.entriesTrace = {\n action: {\n action: 'print',\n input: chunks,\n contextDirectory,\n processCwd: this.rootDir,\n },\n appDir: this.rootDir,\n depModArray: Array.from(depModMap.keys()),\n entryNameMap: Object.fromEntries(entryNameMap),\n absolutePathByEntryName: Object.fromEntries(\n absolutePathByEntryName\n ),\n outputPath: compilation.outputOptions.path!,\n }\n\n let fileList: Set<string>\n let reasons: NodeFileTraceReasons\n const ignores = [\n ...TRACE_IGNORES,\n ...this.traceIgnores,\n '**/node_modules/**',\n ]\n\n // pre-compile the ignore matcher to avoid repeating on every ignoreFn call\n const isIgnoreMatcher = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n const ignoreFn = (path: string) => {\n return isIgnoreMatcher(path)\n }\n\n await finishModulesSpan\n .traceChild('node-file-trace-plugin', {\n traceEntryCount: entriesToTrace.length + '',\n })\n .traceAsyncFn(async () => {\n const result = await nodeFileTrace(entriesToTrace, {\n base: this.tracingRoot,\n processCwd: this.rootDir,\n readFile,\n readlink,\n stat,\n resolve: doResolve\n ? async (id, parent, job, isCjs) => {\n return doResolve(id, parent, job, !isCjs)\n }\n : undefined,\n ignore: ignoreFn,\n mixedModules: true,\n })\n // @ts-ignore\n fileList = result.fileList\n result.esmFileList.forEach((file) => fileList.add(file))\n reasons = result.reasons\n })\n\n await finishModulesSpan\n .traceChild('collect-traced-files')\n .traceAsyncFn(() => {\n const parentFilesMap = getFilesMapFromReasons(\n fileList,\n reasons,\n (file) => {\n // if a file was imported and a loader handled it\n // we don't include it in the trace e.g.\n // static image imports, CSS imports\n file = nodePath.join(this.tracingRoot, file)\n const depMod = depModMap.get(file)\n const isAsset = reasons\n .get(nodePath.relative(this.tracingRoot, file))\n ?.type.includes('asset')\n\n return (\n !isAsset &&\n Array.isArray(depMod?.loaders) &&\n depMod.loaders.length > 0\n )\n }\n )\n\n for (const entry of entryPaths) {\n const entryName = entryNameMap.get(entry)!\n const normalizedEntry = nodePath.relative(\n this.tracingRoot,\n entry\n )\n const curExtraEntries = additionalEntries.get(entryName)\n const finalDeps = new Map<string, { bundled: boolean }>()\n\n // ensure we include entry source file as well for\n // hash comparison\n finalDeps.set(entry, {\n bundled: true,\n })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n\n if (curExtraEntries) {\n for (const extraEntry of curExtraEntries.keys()) {\n const normalizedExtraEntry = nodePath.relative(\n this.tracingRoot,\n extraEntry\n )\n finalDeps.set(extraEntry, { bundled: false })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedExtraEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n }\n }\n this.entryTraces.set(entryName, finalDeps)\n }\n })\n })\n .then(\n () => callback(),\n (err) => callback(err)\n )\n }\n )\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {\n compilation.hooks.processAssets.tapAsync(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,\n },\n (_assets: any, callback: any) => {\n this.createTraceAssets(compilation, traceEntrypointsPluginSpan)\n .then(() => callback())\n .catch((err) => callback(err))\n }\n )\n\n // rspack doesn't support all API below so only create trace assets\n if (process.env.NEXT_RSPACK) {\n return\n }\n\n const readlink = async (path: string): Promise<string | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(\n compilation.inputFileSystem\n .readlink as typeof import('fs').readlink\n )(path, (err, link) => {\n if (err) return reject(err)\n resolve(link)\n })\n })\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' || e.code === 'ENOENT' || e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n }\n const stat = async (path: string): Promise<import('fs').Stats | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(compilation.inputFileSystem.stat as typeof import('fs').stat)(\n path,\n (err, stats) => {\n if (err) return reject(err)\n resolve(stats)\n }\n )\n })\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n }\n\n const compilationSpan = spans.get(compilation) || spans.get(compiler)!\n const traceEntrypointsPluginSpan = compilationSpan.traceChild(\n 'next-trace-entrypoint-plugin'\n )\n traceEntrypointsPluginSpan.traceFn(() => {\n compilation.hooks.processAssets.tapAsync(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,\n },\n (_, callback: any) => {\n this.createTraceAssets(compilation, traceEntrypointsPluginSpan)\n .then(() => callback())\n .catch((err) => callback(err))\n }\n )\n\n let resolver = compilation.resolverFactory.get('normal')\n\n function getPkgName(name: string) {\n const segments = name.split('/')\n if (name[0] === '@' && segments.length > 1)\n return segments.length > 1 ? segments.slice(0, 2).join('/') : null\n return segments.length ? segments[0] : null\n }\n\n const getResolve = (\n options: Parameters<typeof resolver.withOptions>[0]\n ) => {\n const curResolver = resolver.withOptions(options)\n\n return (\n parent: string,\n request: string,\n job: import('@vercel/nft/out/node-file-trace').Job\n ) =>\n new Promise<[string, boolean]>((resolve, reject) => {\n const context = nodePath.dirname(parent)\n\n curResolver.resolve(\n {},\n context,\n request,\n {\n fileDependencies: compilation.fileDependencies,\n missingDependencies: compilation.missingDependencies,\n contextDependencies: compilation.contextDependencies,\n },\n async (err: any, result?, resContext?) => {\n if (err) return reject(err)\n\n if (!result) {\n return reject(new Error('module not found'))\n }\n\n // webpack resolver doesn't strip loader query info\n // from the result so use path instead\n if (result.includes('?') || result.includes('!')) {\n result = resContext?.path || result\n }\n\n try {\n // we need to collect all parent package.json's used\n // as webpack's resolve doesn't expose this and parent\n // package.json could be needed for resolving e.g. stylis\n // stylis/package.json -> stylis/dist/umd/package.json\n if (result.includes('node_modules')) {\n let requestPath = result\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n\n if (\n !nodePath.isAbsolute(request) &&\n request.includes('/') &&\n resContext?.descriptionFileRoot\n ) {\n requestPath = (\n resContext.descriptionFileRoot +\n request.slice(getPkgName(request)?.length || 0) +\n nodePath.sep +\n 'package.json'\n )\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n }\n\n const rootSeparatorIndex = requestPath.indexOf('/')\n let separatorIndex: number\n while (\n (separatorIndex = requestPath.lastIndexOf('/')) >\n rootSeparatorIndex\n ) {\n requestPath = requestPath.slice(0, separatorIndex)\n const curPackageJsonPath = `${requestPath}/package.json`\n if (await job.isFile(curPackageJsonPath)) {\n await job.emitFile(\n await job.realpath(curPackageJsonPath),\n 'resolve',\n parent\n )\n }\n }\n }\n } catch (_err) {\n // we failed to resolve the package.json boundary,\n // we don't block emitting the initial asset from this\n }\n resolve([result, options.dependencyType === 'esm'])\n }\n )\n })\n }\n\n const CJS_RESOLVE_OPTIONS = {\n ...NODE_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_CJS_RESOLVE_OPTIONS = {\n ...CJS_RESOLVE_OPTIONS,\n alias: false,\n }\n const ESM_RESOLVE_OPTIONS = {\n ...NODE_ESM_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_ESM_RESOLVE_OPTIONS = {\n ...ESM_RESOLVE_OPTIONS,\n alias: false,\n }\n\n const doResolve = async (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ): Promise<string> => {\n const context = nodePath.dirname(parent)\n // When in esm externals mode, and using import, we resolve with\n // ESM resolving options.\n const { res } = await resolveExternal(\n this.rootDir,\n this.esmExternals,\n context,\n request,\n isEsmRequested,\n this.optOutBundlingPackages,\n (options) => (_: string, resRequest: string) => {\n return getResolve(options)(parent, resRequest, job)\n },\n undefined,\n undefined,\n ESM_RESOLVE_OPTIONS,\n CJS_RESOLVE_OPTIONS,\n BASE_ESM_RESOLVE_OPTIONS,\n BASE_CJS_RESOLVE_OPTIONS\n )\n\n if (!res) {\n throw new Error(`failed to resolve ${request} from ${parent}`)\n }\n return res.replace(/\\0/g, '')\n }\n\n this.tapfinishModules(\n compilation,\n traceEntrypointsPluginSpan,\n doResolve,\n readlink,\n stat\n )\n })\n })\n }\n}\n"],"names":["TRACE_IGNORES","TraceEntryPointsPlugin","getFilesMapFromReasons","PLUGIN_NAME","NOT_TRACEABLE","getModuleFromDependency","compilation","dep","moduleGraph","getModule","fileList","reasons","ignoreFn","parentFilesMap","Map","propagateToParents","parents","file","seen","Set","parent","has","add","parentFiles","get","set","ignored","Boolean","parentReason","reason","isInitial","type","length","includes","size","constructor","rootDir","appDir","pagesDir","compilerType","optOutBundlingPackages","appDirEnabled","traceIgnores","esmExternals","outputFileTracingRoot","buildTraceContext","entryTraces","tracingRoot","createTraceAssets","span","outputPath","outputOptions","path","traceChild","traceAsyncFn","entryFilesMap","chunksToTrace","entryNameFilesMap","isTraceable","some","suffix","endsWith","entrypoint","entrypoints","values","entryFiles","chunk","process","env","NEXT_RSPACK","chunks","getEntrypointChunk","getAllReferencedChunks","files","filePath","nodePath","join","auxiliaryFiles","name","chunksTrace","action","input","contextDirectory","processCwd","Object","fromEntries","outputPrefix","traceOutputName","traceOutputPath","dirname","delete","startsWith","appDirRelativeEntryPath","entriesTrace","absolutePathByEntryName","replace","entryIsStaticMetadataRoute","isStaticMetadataRoute","CLIENT_REFERENCE_MANIFEST","finalFiles","Promise","all","keys","map","fileInfo","relativeFile","relative","bundled","push","emitAsset","sources","RawSource","JSON","stringify","version","TRACE_OUTPUT_VERSION","tapfinishModules","traceEntrypointsPluginSpan","doResolve","readlink","stat","hooks","finishModules","tapAsync","_stats","callback","finishModulesSpan","entryNameMap","entryModMap","additionalEntries","depModMap","entry","entries","normalizedName","isPage","isApp","dependencies","entryMod","resource","moduleBuildInfo","getModuleBuildInfo","route","absolutePath","getPageFilePath","absolutePagePath","request","curMap","readFile","mod","source","originalSource","buffer","entryPaths","Array","from","collectDependencies","depMod","entriesToTrace","entryName","curExtraEntries","depModArray","ignores","isIgnoreMatcher","picomatch","contains","dot","traceEntryCount","result","nodeFileTrace","base","resolve","id","job","isCjs","undefined","ignore","mixedModules","esmFileList","forEach","isAsset","isArray","loaders","normalizedEntry","finalDeps","info","extraEntry","normalizedExtraEntry","then","err","apply","compiler","tap","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_SUMMARIZE","_assets","catch","reject","inputFileSystem","link","e","isError","code","stats","compilationSpan","spans","traceFn","_","resolver","resolverFactory","getPkgName","segments","split","slice","getResolve","options","curResolver","withOptions","context","fileDependencies","missingDependencies","contextDependencies","resContext","Error","requestPath","isAbsolute","descriptionFileRoot","sep","rootSeparatorIndex","indexOf","separatorIndex","lastIndexOf","curPackageJsonPath","isFile","emitFile","realpath","_err","dependencyType","CJS_RESOLVE_OPTIONS","NODE_RESOLVE_OPTIONS","fullySpecified","modules","extensions","BASE_CJS_RESOLVE_OPTIONS","alias","ESM_RESOLVE_OPTIONS","NODE_ESM_RESOLVE_OPTIONS","BASE_ESM_RESOLVE_OPTIONS","isEsmRequested","res","resolveExternal","resRequest"],"mappings":";;;;;;;;;;;;;;;;IAwBaA,aAAa;eAAbA;;IAuGAC,sBAAsB;eAAtBA;;IA9EGC,sBAAsB;eAAtBA;;;6DAjDK;iCAEC;gEACF;qBACU;2BAMvB;yBAC0B;+BAI1B;kEAEe;oCACa;yBACH;iCACA;iCACM;;;;;;AAEtC,MAAMC,cAAc;AACb,MAAMH,gBAAgB;IAC3B;IACA;CACD;AAED,MAAMI,gBAAgB;IACpB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,SAASC,wBACPC,WAAgB,EAChBC,GAAQ;IAER,OAAOD,YAAYE,WAAW,CAACC,SAAS,CAACF;AAC3C;AAEO,SAASL,uBACdQ,QAAqB,EACrBC,OAA6B,EA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/D;oBACA,OAAOuO,IAAI5J,OAAO,CAAC,OAAO;gBAC5B;gBAEA,IAAI,CAACqB,gBAAgB,CACnB9G,aACA+G,4BACAC,WACAC,UACAC;YAEJ;QACF;IACF;AACF"}
@@ -41,7 +41,7 @@ class NextJsRequireCacheHotReloader {
41
41
  // since they can have a stale webpack-runtime cache
42
42
  // which needs to always be in-sync
43
43
  const entries = [
44
- ...compilation.entries.keys()
44
+ ...compilation.entrypoints.keys()
45
45
  ].filter((entry)=>{
46
46
  const isAppPath = entry.toString().startsWith('app/');
47
47
  return entry.toString().startsWith('pages/') || isAppPath;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { deleteCache } from '../../../server/dev/require-cache'\nimport { clearModuleContext } from '../../../server/web/sandbox'\nimport path from 'path'\n\ntype Compiler = webpack.Compiler\ntype WebpackPluginInstance = webpack.WebpackPluginInstance\n\nconst RUNTIME_NAMES = ['webpack-runtime', 'webpack-api-runtime']\nconst PLUGIN_NAME = 'NextJsRequireCacheHotReloader'\n\n// This plugin flushes require.cache after emitting the files. Providing 'hot reloading' of server files.\nexport class NextJsRequireCacheHotReloader implements WebpackPluginInstance {\n prevAssets: any = null\n serverComponents: boolean\n\n constructor(opts: { serverComponents: boolean }) {\n this.serverComponents = opts.serverComponents\n }\n\n apply(compiler: Compiler) {\n compiler.hooks.assetEmitted.tap(PLUGIN_NAME, (_file, { targetPath }) => {\n // Clear module context in this process\n clearModuleContext(targetPath)\n deleteCache(targetPath)\n })\n\n compiler.hooks.afterEmit.tapPromise(PLUGIN_NAME, async (compilation) => {\n for (const name of RUNTIME_NAMES) {\n const runtimeChunkPath = path.join(\n compilation.outputOptions.path!,\n `${name}.js`\n )\n deleteCache(runtimeChunkPath)\n }\n\n // we need to make sure to clear all server entries from cache\n // since they can have a stale webpack-runtime cache\n // which needs to always be in-sync\n const entries = [...compilation.entries.keys()].filter((entry) => {\n const isAppPath = entry.toString().startsWith('app/')\n return entry.toString().startsWith('pages/') || isAppPath\n })\n\n for (const page of entries) {\n const outputPath = path.join(\n compilation.outputOptions.path!,\n page + '.js'\n )\n deleteCache(outputPath)\n }\n })\n }\n}\n"],"names":["NextJsRequireCacheHotReloader","RUNTIME_NAMES","PLUGIN_NAME","constructor","opts","prevAssets","serverComponents","apply","compiler","hooks","assetEmitted","tap","_file","targetPath","clearModuleContext","deleteCache","afterEmit","tapPromise","compilation","name","runtimeChunkPath","path","join","outputOptions","entries","keys","filter","entry","isAppPath","toString","startsWith","page","outputPath"],"mappings":";;;;+BAYaA;;;eAAAA;;;8BAXe;yBACO;6DAClB;;;;;;AAKjB,MAAMC,gBAAgB;IAAC;IAAmB;CAAsB;AAChE,MAAMC,cAAc;AAGb,MAAMF;IAIXG,YAAYC,IAAmC,CAAE;aAHjDC,aAAkB;QAIhB,IAAI,CAACC,gBAAgB,GAAGF,KAAKE,gBAAgB;IAC/C;IAEAC,MAAMC,QAAkB,EAAE;QACxBA,SAASC,KAAK,CAACC,YAAY,CAACC,GAAG,CAACT,aAAa,CAACU,OAAO,EAAEC,UAAU,EAAE;YACjE,uCAAuC;YACvCC,IAAAA,2BAAkB,EAACD;YACnBE,IAAAA,yBAAW,EAACF;QACd;QAEAL,SAASC,KAAK,CAACO,SAAS,CAACC,UAAU,CAACf,aAAa,OAAOgB;YACtD,KAAK,MAAMC,QAAQlB,cAAe;gBAChC,MAAMmB,mBAAmBC,aAAI,CAACC,IAAI,CAChCJ,YAAYK,aAAa,CAACF,IAAI,EAC9B,GAAGF,KAAK,GAAG,CAAC;gBAEdJ,IAAAA,yBAAW,EAACK;YACd;YAEA,8DAA8D;YAC9D,oDAAoD;YACpD,mCAAmC;YACnC,MAAMI,UAAU;mBAAIN,YAAYM,OAAO,CAACC,IAAI;aAAG,CAACC,MAAM,CAAC,CAACC;gBACtD,MAAMC,YAAYD,MAAME,QAAQ,GAAGC,UAAU,CAAC;gBAC9C,OAAOH,MAAME,QAAQ,GAAGC,UAAU,CAAC,aAAaF;YAClD;YAEA,KAAK,MAAMG,QAAQP,QAAS;gBAC1B,MAAMQ,aAAaX,aAAI,CAACC,IAAI,CAC1BJ,YAAYK,aAAa,CAACF,IAAI,EAC9BU,OAAO;gBAEThB,IAAAA,yBAAW,EAACiB;YACd;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { deleteCache } from '../../../server/dev/require-cache'\nimport { clearModuleContext } from '../../../server/web/sandbox'\nimport path from 'path'\n\ntype Compiler = webpack.Compiler\ntype WebpackPluginInstance = webpack.WebpackPluginInstance\n\nconst RUNTIME_NAMES = ['webpack-runtime', 'webpack-api-runtime']\nconst PLUGIN_NAME = 'NextJsRequireCacheHotReloader'\n\n// This plugin flushes require.cache after emitting the files. Providing 'hot reloading' of server files.\nexport class NextJsRequireCacheHotReloader implements WebpackPluginInstance {\n prevAssets: any = null\n serverComponents: boolean\n\n constructor(opts: { serverComponents: boolean }) {\n this.serverComponents = opts.serverComponents\n }\n\n apply(compiler: Compiler) {\n compiler.hooks.assetEmitted.tap(PLUGIN_NAME, (_file, { targetPath }) => {\n // Clear module context in this process\n clearModuleContext(targetPath)\n deleteCache(targetPath)\n })\n\n compiler.hooks.afterEmit.tapPromise(PLUGIN_NAME, async (compilation) => {\n for (const name of RUNTIME_NAMES) {\n const runtimeChunkPath = path.join(\n compilation.outputOptions.path!,\n `${name}.js`\n )\n deleteCache(runtimeChunkPath)\n }\n\n // we need to make sure to clear all server entries from cache\n // since they can have a stale webpack-runtime cache\n // which needs to always be in-sync\n const entries = [...compilation.entrypoints.keys()].filter((entry) => {\n const isAppPath = entry.toString().startsWith('app/')\n return entry.toString().startsWith('pages/') || isAppPath\n })\n\n for (const page of entries) {\n const outputPath = path.join(\n compilation.outputOptions.path!,\n page + '.js'\n )\n deleteCache(outputPath)\n }\n })\n }\n}\n"],"names":["NextJsRequireCacheHotReloader","RUNTIME_NAMES","PLUGIN_NAME","constructor","opts","prevAssets","serverComponents","apply","compiler","hooks","assetEmitted","tap","_file","targetPath","clearModuleContext","deleteCache","afterEmit","tapPromise","compilation","name","runtimeChunkPath","path","join","outputOptions","entries","entrypoints","keys","filter","entry","isAppPath","toString","startsWith","page","outputPath"],"mappings":";;;;+BAYaA;;;eAAAA;;;8BAXe;yBACO;6DAClB;;;;;;AAKjB,MAAMC,gBAAgB;IAAC;IAAmB;CAAsB;AAChE,MAAMC,cAAc;AAGb,MAAMF;IAIXG,YAAYC,IAAmC,CAAE;aAHjDC,aAAkB;QAIhB,IAAI,CAACC,gBAAgB,GAAGF,KAAKE,gBAAgB;IAC/C;IAEAC,MAAMC,QAAkB,EAAE;QACxBA,SAASC,KAAK,CAACC,YAAY,CAACC,GAAG,CAACT,aAAa,CAACU,OAAO,EAAEC,UAAU,EAAE;YACjE,uCAAuC;YACvCC,IAAAA,2BAAkB,EAACD;YACnBE,IAAAA,yBAAW,EAACF;QACd;QAEAL,SAASC,KAAK,CAACO,SAAS,CAACC,UAAU,CAACf,aAAa,OAAOgB;YACtD,KAAK,MAAMC,QAAQlB,cAAe;gBAChC,MAAMmB,mBAAmBC,aAAI,CAACC,IAAI,CAChCJ,YAAYK,aAAa,CAACF,IAAI,EAC9B,GAAGF,KAAK,GAAG,CAAC;gBAEdJ,IAAAA,yBAAW,EAACK;YACd;YAEA,8DAA8D;YAC9D,oDAAoD;YACpD,mCAAmC;YACnC,MAAMI,UAAU;mBAAIN,YAAYO,WAAW,CAACC,IAAI;aAAG,CAACC,MAAM,CAAC,CAACC;gBAC1D,MAAMC,YAAYD,MAAME,QAAQ,GAAGC,UAAU,CAAC;gBAC9C,OAAOH,MAAME,QAAQ,GAAGC,UAAU,CAAC,aAAaF;YAClD;YAEA,KAAK,MAAMG,QAAQR,QAAS;gBAC1B,MAAMS,aAAaZ,aAAI,CAACC,IAAI,CAC1BJ,YAAYK,aAAa,CAACF,IAAI,EAC9BW,OAAO;gBAETjB,IAAAA,yBAAW,EAACkB;YACd;QACF;IACF;AACF"}
@@ -0,0 +1,36 @@
1
+ import type { Compiler } from '@rspack/core';
2
+ type Actions = {
3
+ [actionId: string]: {
4
+ workers: {
5
+ [name: string]: {
6
+ moduleId: string | number;
7
+ async: boolean;
8
+ };
9
+ };
10
+ layer: {
11
+ [name: string]: string;
12
+ };
13
+ };
14
+ };
15
+ export type ActionManifest = {
16
+ encryptionKey: string;
17
+ node: Actions;
18
+ edge: Actions;
19
+ };
20
+ export interface ModuleInfo {
21
+ moduleId: string | number;
22
+ async: boolean;
23
+ }
24
+ interface Options {
25
+ dev: boolean;
26
+ appDir: string;
27
+ isEdgeServer: boolean;
28
+ encryptionKey: string;
29
+ }
30
+ export declare class RspackFlightClientEntryPlugin {
31
+ plugin: any;
32
+ compiler?: Compiler;
33
+ constructor(options: Options);
34
+ apply(compiler: Compiler): void;
35
+ }
36
+ export {};
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "RspackFlightClientEntryPlugin", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return RspackFlightClientEntryPlugin;
9
+ }
10
+ });
11
+ const _ondemandentryhandler = require("../../../server/dev/on-demand-entry-handler");
12
+ const _constants = require("../../../shared/lib/constants");
13
+ const _buildcontext = require("../../build-context");
14
+ const _pagetypes = require("../../../lib/page-types");
15
+ const _getrspack = require("../../../shared/lib/get-rspack");
16
+ const pluginState = (0, _buildcontext.getProxiedPluginState)({
17
+ // A map to track "action" -> "list of bundles".
18
+ serverActions: {},
19
+ edgeServerActions: {},
20
+ serverActionModules: {},
21
+ edgeServerActionModules: {},
22
+ ssrModules: {},
23
+ edgeSsrModules: {},
24
+ rscModules: {},
25
+ edgeRscModules: {},
26
+ injectedClientEntries: {}
27
+ });
28
+ class RspackFlightClientEntryPlugin {
29
+ constructor(options){
30
+ const { FlightClientEntryPlugin } = (0, _getrspack.getRspackCore)();
31
+ this.plugin = new FlightClientEntryPlugin({
32
+ ...options,
33
+ builtinAppLoader: !!process.env.BUILTIN_SWC_LOADER,
34
+ shouldInvalidateCb: ({ bundlePath, entryName, absolutePagePath, clientBrowserLoader })=>{
35
+ let shouldInvalidate = false;
36
+ const compiler = this.compiler;
37
+ const entries = (0, _ondemandentryhandler.getEntries)(compiler.outputPath);
38
+ const pageKey = (0, _ondemandentryhandler.getEntryKey)(_constants.COMPILER_NAMES.client, _pagetypes.PAGE_TYPES.APP, bundlePath);
39
+ if (!entries[pageKey]) {
40
+ entries[pageKey] = {
41
+ type: _ondemandentryhandler.EntryTypes.CHILD_ENTRY,
42
+ parentEntries: new Set([
43
+ entryName
44
+ ]),
45
+ absoluteEntryFilePath: absolutePagePath,
46
+ bundlePath,
47
+ request: clientBrowserLoader,
48
+ dispose: false,
49
+ lastActiveTime: Date.now()
50
+ };
51
+ shouldInvalidate = true;
52
+ } else {
53
+ const entryData = entries[pageKey];
54
+ // New version of the client loader
55
+ if (entryData.request !== clientBrowserLoader) {
56
+ entryData.request = clientBrowserLoader;
57
+ shouldInvalidate = true;
58
+ }
59
+ if (entryData.type === _ondemandentryhandler.EntryTypes.CHILD_ENTRY) {
60
+ entryData.parentEntries.add(entryName);
61
+ }
62
+ entryData.dispose = false;
63
+ entryData.lastActiveTime = Date.now();
64
+ }
65
+ return shouldInvalidate;
66
+ },
67
+ invalidateCb: ()=>{
68
+ const compiler = this.compiler;
69
+ // Invalidate in development to trigger recompilation
70
+ const invalidator = (0, _ondemandentryhandler.getInvalidator)(compiler.outputPath);
71
+ // Check if any of the entry injections need an invalidation
72
+ if (invalidator) {
73
+ invalidator.invalidate([
74
+ _constants.COMPILER_NAMES.client
75
+ ]);
76
+ }
77
+ },
78
+ stateCb: (state)=>{
79
+ Object.assign(pluginState.serverActions, state.serverActions);
80
+ Object.assign(pluginState.edgeServerActions, state.edgeServerActions);
81
+ Object.assign(pluginState.serverActionModules, state.serverActionModules);
82
+ Object.assign(pluginState.edgeServerActionModules, state.edgeServerActionModules);
83
+ Object.assign(pluginState.ssrModules, state.ssrModules);
84
+ Object.assign(pluginState.edgeSsrModules, state.edgeSsrModules);
85
+ Object.assign(pluginState.rscModules, state.rscModules);
86
+ Object.assign(pluginState.edgeRscModules, state.edgeRscModules);
87
+ Object.assign(pluginState.injectedClientEntries, state.injectedClientEntries);
88
+ }
89
+ });
90
+ }
91
+ apply(compiler) {
92
+ this.compiler = compiler;
93
+ this.plugin.apply(compiler);
94
+ }
95
+ }
96
+
97
+ //# sourceMappingURL=rspack-flight-client-entry-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/build/webpack/plugins/rspack-flight-client-entry-plugin.ts"],"sourcesContent":["import type { Compiler } from '@rspack/core'\nimport {\n getInvalidator,\n getEntries,\n EntryTypes,\n getEntryKey,\n} from '../../../server/dev/on-demand-entry-handler'\nimport { COMPILER_NAMES } from '../../../shared/lib/constants'\n\nimport { getProxiedPluginState } from '../../build-context'\nimport { PAGE_TYPES } from '../../../lib/page-types'\nimport { getRspackCore } from '../../../shared/lib/get-rspack'\n\ntype Actions = {\n [actionId: string]: {\n workers: {\n [name: string]: { moduleId: string | number; async: boolean }\n }\n // Record which layer the action is in (rsc or sc_action), in the specific entry.\n layer: {\n [name: string]: string\n }\n }\n}\n\nexport type ActionManifest = {\n // Assign a unique encryption key during production build.\n encryptionKey: string\n node: Actions\n edge: Actions\n}\n\nexport interface ModuleInfo {\n moduleId: string | number\n async: boolean\n}\n\nconst pluginState = getProxiedPluginState({\n // A map to track \"action\" -> \"list of bundles\".\n serverActions: {} as ActionManifest['node'],\n edgeServerActions: {} as ActionManifest['edge'],\n\n serverActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n edgeServerActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n ssrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n edgeSsrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n\n rscModules: {} as { [rscModuleId: string]: ModuleInfo },\n edgeRscModules: {} as { [rscModuleId: string]: ModuleInfo },\n\n injectedClientEntries: {} as Record<string, string>,\n})\n\ninterface Options {\n dev: boolean\n appDir: string\n isEdgeServer: boolean\n encryptionKey: string\n}\n\nexport class RspackFlightClientEntryPlugin {\n plugin: any\n compiler?: Compiler\n\n constructor(options: Options) {\n const { FlightClientEntryPlugin } = getRspackCore()\n\n this.plugin = new FlightClientEntryPlugin({\n ...options,\n builtinAppLoader: !!process.env.BUILTIN_SWC_LOADER,\n shouldInvalidateCb: ({\n bundlePath,\n entryName,\n absolutePagePath,\n clientBrowserLoader,\n }: any) => {\n let shouldInvalidate = false\n const compiler = this.compiler!\n\n const entries = getEntries(compiler.outputPath)\n const pageKey = getEntryKey(\n COMPILER_NAMES.client,\n PAGE_TYPES.APP,\n bundlePath\n )\n\n if (!entries[pageKey]) {\n entries[pageKey] = {\n type: EntryTypes.CHILD_ENTRY,\n parentEntries: new Set([entryName]),\n absoluteEntryFilePath: absolutePagePath,\n bundlePath,\n request: clientBrowserLoader,\n dispose: false,\n lastActiveTime: Date.now(),\n }\n shouldInvalidate = true\n } else {\n const entryData = entries[pageKey]\n // New version of the client loader\n if (entryData.request !== clientBrowserLoader) {\n entryData.request = clientBrowserLoader\n shouldInvalidate = true\n }\n if (entryData.type === EntryTypes.CHILD_ENTRY) {\n entryData.parentEntries.add(entryName)\n }\n entryData.dispose = false\n entryData.lastActiveTime = Date.now()\n }\n\n return shouldInvalidate\n },\n invalidateCb: () => {\n const compiler = this.compiler!\n\n // Invalidate in development to trigger recompilation\n const invalidator = getInvalidator(compiler.outputPath)\n // Check if any of the entry injections need an invalidation\n if (invalidator) {\n invalidator.invalidate([COMPILER_NAMES.client])\n }\n },\n stateCb: (state: any) => {\n Object.assign(pluginState.serverActions, state.serverActions)\n Object.assign(pluginState.edgeServerActions, state.edgeServerActions)\n Object.assign(\n pluginState.serverActionModules,\n state.serverActionModules\n )\n Object.assign(\n pluginState.edgeServerActionModules,\n state.edgeServerActionModules\n )\n Object.assign(pluginState.ssrModules, state.ssrModules)\n Object.assign(pluginState.edgeSsrModules, state.edgeSsrModules)\n Object.assign(pluginState.rscModules, state.rscModules)\n Object.assign(pluginState.edgeRscModules, state.edgeRscModules)\n Object.assign(\n pluginState.injectedClientEntries,\n state.injectedClientEntries\n )\n },\n })\n }\n\n apply(compiler: Compiler) {\n this.compiler = compiler\n this.plugin.apply(compiler)\n }\n}\n"],"names":["RspackFlightClientEntryPlugin","pluginState","getProxiedPluginState","serverActions","edgeServerActions","serverActionModules","edgeServerActionModules","ssrModules","edgeSsrModules","rscModules","edgeRscModules","injectedClientEntries","constructor","options","FlightClientEntryPlugin","getRspackCore","plugin","builtinAppLoader","process","env","BUILTIN_SWC_LOADER","shouldInvalidateCb","bundlePath","entryName","absolutePagePath","clientBrowserLoader","shouldInvalidate","compiler","entries","getEntries","outputPath","pageKey","getEntryKey","COMPILER_NAMES","client","PAGE_TYPES","APP","type","EntryTypes","CHILD_ENTRY","parentEntries","Set","absoluteEntryFilePath","request","dispose","lastActiveTime","Date","now","entryData","add","invalidateCb","invalidator","getInvalidator","invalidate","stateCb","state","Object","assign","apply"],"mappings":";;;;+BAkEaA;;;eAAAA;;;sCA5DN;2BACwB;8BAEO;2BACX;2BACG;AA0B9B,MAAMC,cAAcC,IAAAA,mCAAqB,EAAC;IACxC,gDAAgD;IAChDC,eAAe,CAAC;IAChBC,mBAAmB,CAAC;IAEpBC,qBAAqB,CAAC;IAItBC,yBAAyB,CAAC;IAI1BC,YAAY,CAAC;IACbC,gBAAgB,CAAC;IAEjBC,YAAY,CAAC;IACbC,gBAAgB,CAAC;IAEjBC,uBAAuB,CAAC;AAC1B;AASO,MAAMX;IAIXY,YAAYC,OAAgB,CAAE;QAC5B,MAAM,EAAEC,uBAAuB,EAAE,GAAG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BAC5D,IAAIqB,aAAa;oBACfA,YAAYE,UAAU,CAAC;wBAACpB,yBAAc,CAACC,MAAM;qBAAC;gBAChD;YACF;YACAoB,SAAS,CAACC;gBACRC,OAAOC,MAAM,CAACxD,YAAYE,aAAa,EAAEoD,MAAMpD,aAAa;gBAC5DqD,OAAOC,MAAM,CAACxD,YAAYG,iBAAiB,EAAEmD,MAAMnD,iBAAiB;gBACpEoD,OAAOC,MAAM,CACXxD,YAAYI,mBAAmB,EAC/BkD,MAAMlD,mBAAmB;gBAE3BmD,OAAOC,MAAM,CACXxD,YAAYK,uBAAuB,EACnCiD,MAAMjD,uBAAuB;gBAE/BkD,OAAOC,MAAM,CAACxD,YAAYM,UAAU,EAAEgD,MAAMhD,UAAU;gBACtDiD,OAAOC,MAAM,CAACxD,YAAYO,cAAc,EAAE+C,MAAM/C,cAAc;gBAC9DgD,OAAOC,MAAM,CAACxD,YAAYQ,UAAU,EAAE8C,MAAM9C,UAAU;gBACtD+C,OAAOC,MAAM,CAACxD,YAAYS,cAAc,EAAE6C,MAAM7C,cAAc;gBAC9D8C,OAAOC,MAAM,CACXxD,YAAYU,qBAAqB,EACjC4C,MAAM5C,qBAAqB;YAE/B;QACF;IACF;IAEA+C,MAAM/B,QAAkB,EAAE;QACxB,IAAI,CAACA,QAAQ,GAAGA;QAChB,IAAI,CAACX,MAAM,CAAC0C,KAAK,CAAC/B;IACpB;AACF"}
@@ -0,0 +1,9 @@
1
+ import type { Span } from '../../../trace';
2
+ export declare const compilationSpans: WeakMap<any, Span>;
3
+ export declare class RspackProfilingPlugin {
4
+ runWebpackSpan: Span;
5
+ constructor({ runWebpackSpan }: {
6
+ runWebpackSpan: Span;
7
+ });
8
+ apply(compiler: any): void;
9
+ }
@@ -0,0 +1,62 @@
1
+ // A basic implementation to allow loaders access to loaderContext.currentTraceSpan
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ 0 && (module.exports = {
7
+ RspackProfilingPlugin: null,
8
+ compilationSpans: null
9
+ });
10
+ function _export(target, all) {
11
+ for(var name in all)Object.defineProperty(target, name, {
12
+ enumerable: true,
13
+ get: all[name]
14
+ });
15
+ }
16
+ _export(exports, {
17
+ RspackProfilingPlugin: function() {
18
+ return RspackProfilingPlugin;
19
+ },
20
+ compilationSpans: function() {
21
+ return compilationSpans;
22
+ }
23
+ });
24
+ const _getrspack = require("../../../shared/lib/get-rspack");
25
+ const pluginName = 'RspackProfilingPlugin';
26
+ const moduleSpansByCompilation = new WeakMap();
27
+ const compilationSpans = new WeakMap();
28
+ class RspackProfilingPlugin {
29
+ constructor({ runWebpackSpan }){
30
+ this.runWebpackSpan = runWebpackSpan;
31
+ }
32
+ apply(compiler) {
33
+ compiler.hooks.compilation.tap({
34
+ name: pluginName,
35
+ stage: -Infinity
36
+ }, (compilation)=>{
37
+ const rspack = (0, _getrspack.getRspackCore)();
38
+ moduleSpansByCompilation.set(compilation, new WeakMap());
39
+ compilationSpans.set(compilation, this.runWebpackSpan.traceChild('compilation-' + compilation.name));
40
+ const compilationSpan = this.runWebpackSpan.traceChild(`compilation-${compilation.name}`);
41
+ const moduleHooks = rspack.NormalModule.getCompilationHooks(compilation);
42
+ moduleHooks.loader.tap(pluginName, (loaderContext, module1)=>{
43
+ var _moduleSpansByCompilation_get;
44
+ const moduleSpan = (_moduleSpansByCompilation_get = moduleSpansByCompilation.get(compilation)) == null ? void 0 : _moduleSpansByCompilation_get.get(module1);
45
+ loaderContext.currentTraceSpan = moduleSpan;
46
+ });
47
+ compilation.hooks.buildModule.tap(pluginName, (module1)=>{
48
+ var _moduleSpansByCompilation_get;
49
+ const span = compilationSpan.traceChild('build-module');
50
+ span.setAttribute('name', module1.userRequest);
51
+ span.setAttribute('layer', module1.layer);
52
+ moduleSpansByCompilation == null ? void 0 : (_moduleSpansByCompilation_get = moduleSpansByCompilation.get(compilation)) == null ? void 0 : _moduleSpansByCompilation_get.set(module1, span);
53
+ });
54
+ compilation.hooks.succeedModule.tap(pluginName, (module1)=>{
55
+ var _moduleSpansByCompilation_get_get, _moduleSpansByCompilation_get;
56
+ moduleSpansByCompilation == null ? void 0 : (_moduleSpansByCompilation_get = moduleSpansByCompilation.get(compilation)) == null ? void 0 : (_moduleSpansByCompilation_get_get = _moduleSpansByCompilation_get.get(module1)) == null ? void 0 : _moduleSpansByCompilation_get_get.stop();
57
+ });
58
+ });
59
+ }
60
+ }
61
+
62
+ //# sourceMappingURL=rspack-profiling-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/build/webpack/plugins/rspack-profiling-plugin.ts"],"sourcesContent":["// A basic implementation to allow loaders access to loaderContext.currentTraceSpan\n\nimport type { Span } from '../../../trace'\n\nimport { getRspackCore } from '../../../shared/lib/get-rspack'\n\nconst pluginName = 'RspackProfilingPlugin'\nconst moduleSpansByCompilation = new WeakMap()\nexport const compilationSpans: WeakMap<any, Span> = new WeakMap()\n\nexport class RspackProfilingPlugin {\n runWebpackSpan: Span\n\n constructor({ runWebpackSpan }: { runWebpackSpan: Span }) {\n this.runWebpackSpan = runWebpackSpan\n }\n\n apply(compiler: any) {\n compiler.hooks.compilation.tap(\n { name: pluginName, stage: -Infinity },\n (compilation: any) => {\n const rspack = getRspackCore()\n\n moduleSpansByCompilation.set(compilation, new WeakMap())\n compilationSpans.set(\n compilation,\n this.runWebpackSpan.traceChild('compilation-' + compilation.name)\n )\n\n const compilationSpan = this.runWebpackSpan.traceChild(\n `compilation-${compilation.name}`\n )\n\n const moduleHooks = rspack.NormalModule.getCompilationHooks(compilation)\n moduleHooks.loader.tap(\n pluginName,\n (loaderContext: any, module: any) => {\n const moduleSpan = moduleSpansByCompilation\n .get(compilation)\n ?.get(module)\n loaderContext.currentTraceSpan = moduleSpan\n }\n )\n\n compilation.hooks.buildModule.tap(pluginName, (module: any) => {\n const span = compilationSpan.traceChild('build-module')\n span.setAttribute('name', module.userRequest)\n span.setAttribute('layer', module.layer)\n\n moduleSpansByCompilation?.get(compilation)?.set(module, span)\n })\n\n compilation.hooks.succeedModule.tap(pluginName, (module: any) => {\n moduleSpansByCompilation?.get(compilation)?.get(module)?.stop()\n })\n }\n )\n }\n}\n"],"names":["RspackProfilingPlugin","compilationSpans","pluginName","moduleSpansByCompilation","WeakMap","constructor","runWebpackSpan","apply","compiler","hooks","compilation","tap","name","stage","Infinity","rspack","getRspackCore","set","traceChild","compilationSpan","moduleHooks","NormalModule","getCompilationHooks","loader","loaderContext","module","moduleSpan","get","currentTraceSpan","buildModule","span","setAttribute","userRequest","layer","succeedModule","stop"],"mappings":"AAAA,mFAAmF;;;;;;;;;;;;;;;;IAUtEA,qBAAqB;eAArBA;;IAFAC,gBAAgB;eAAhBA;;;2BAJiB;AAE9B,MAAMC,aAAa;AACnB,MAAMC,2BAA2B,IAAIC;AAC9B,MAAMH,mBAAuC,IAAIG;AAEjD,MAAMJ;IAGXK,YAAY,EAAEC,cAAc,EAA4B,CAAE;QACxD,IAAI,CAACA,cAAc,GAAGA;IACxB;IAEAC,MAAMC,QAAa,EAAE;QACnBA,SAASC,KAAK,CAACC,WAAW,CAACC,GAAG,CAC5B;YAAEC,MAAMV;YAAYW,OAAO,CAACC;QAAS,GACrC,CAACJ;YACC,MAAMK,SAASC,IAAAA,wBAAa;YAE5Bb,yBAAyBc,GAAG,CAACP,aAAa,IAAIN;YAC9CH,iBAAiBgB,GAAG,CAClBP,aACA,IAAI,CAACJ,cAAc,CAACY,UAAU,CAAC,iBAAiBR,YAAYE,IAAI;YAGlE,MAAMO,kBAAkB,IAAI,CAACb,cAAc,CAACY,UAAU,CACpD,CAAC,YAAY,EAAER,YAAYE,IAAI,EAAE;YAGnC,MAAMQ,cAAcL,OAAOM,YAAY,CAACC,mBAAmB,CAACZ;YAC5DU,YAAYG,MAAM,CAACZ,GAAG,CACpBT,YACA,CAACsB,eAAoBC;oBACAtB;gBAAnB,MAAMuB,cAAavB,gCAAAA,yBAChBwB,GAAG,CAACjB,iCADYP,8BAEfwB,GAAG,CAACF;gBACRD,cAAcI,gBAAgB,GAAGF;YACnC;YAGFhB,YAAYD,KAAK,CAACoB,WAAW,CAAClB,GAAG,CAACT,YAAY,CAACuB;oBAK7CtB;gBAJA,MAAM2B,OAAOX,gBAAgBD,UAAU,CAAC;gBACxCY,KAAKC,YAAY,CAAC,QAAQN,QAAOO,WAAW;gBAC5CF,KAAKC,YAAY,CAAC,SAASN,QAAOQ,KAAK;gBAEvC9B,6CAAAA,gCAAAA,yBAA0BwB,GAAG,CAACjB,iCAA9BP,8BAA4Cc,GAAG,CAACQ,SAAQK;YAC1D;YAEApB,YAAYD,KAAK,CAACyB,aAAa,CAACvB,GAAG,CAACT,YAAY,CAACuB;oBAC/CtB,mCAAAA;gBAAAA,6CAAAA,gCAAAA,yBAA0BwB,GAAG,CAACjB,kCAA9BP,oCAAAA,8BAA4CwB,GAAG,CAACF,6BAAhDtB,kCAAyDgC,IAAI;YAC/D;QACF;IAEJ;AACF"}
@@ -10,9 +10,10 @@ Object.defineProperty(exports, "getNextAppLoaderError", {
10
10
  });
11
11
  const _path = require("path");
12
12
  const _simpleWebpackError = require("./simpleWebpackError");
13
+ const _entries = require("../../../entries");
13
14
  function getNextAppLoaderError(err, module, compiler) {
14
15
  try {
15
- if (!module.loaders[0].loader.includes('next-app-loader')) {
16
+ if (!module.loaders[0].loader.includes((0, _entries.getAppLoader)())) {
16
17
  return false;
17
18
  }
18
19
  const file = (0, _path.relative)(compiler.context, module.buildInfo.route.absolutePagePath);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { relative } from 'path'\nimport { SimpleWebpackError } from './simpleWebpackError'\n\nexport function getNextAppLoaderError(\n err: Error,\n module: any,\n compiler: webpack.Compiler\n): SimpleWebpackError | false {\n try {\n if (!module.loaders[0].loader.includes('next-app-loader')) {\n return false\n }\n\n const file = relative(\n compiler.context,\n module.buildInfo.route.absolutePagePath\n )\n\n return new SimpleWebpackError(file, err.message)\n } catch {\n return false\n }\n}\n"],"names":["getNextAppLoaderError","err","module","compiler","loaders","loader","includes","file","relative","context","buildInfo","route","absolutePagePath","SimpleWebpackError","message"],"mappings":";;;;+BAIgBA;;;eAAAA;;;sBAHS;oCACU;AAE5B,SAASA,sBACdC,GAAU,EACVC,MAAW,EACXC,QAA0B;IAE1B,IAAI;QACF,IAAI,CAACD,OAAOE,OAAO,CAAC,EAAE,CAACC,MAAM,CAACC,QAAQ,CAAC,oBAAoB;YACzD,OAAO;QACT;QAEA,MAAMC,OAAOC,IAAAA,cAAQ,EACnBL,SAASM,OAAO,EAChBP,OAAOQ,SAAS,CAACC,KAAK,CAACC,gBAAgB;QAGzC,OAAO,IAAIC,sCAAkB,CAACN,MAAMN,IAAIa,OAAO;IACjD,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
1
+ {"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { relative } from 'path'\nimport { SimpleWebpackError } from './simpleWebpackError'\nimport { getAppLoader } from '../../../entries'\n\nexport function getNextAppLoaderError(\n err: Error,\n module: any,\n compiler: webpack.Compiler\n): SimpleWebpackError | false {\n try {\n if (!module.loaders[0].loader.includes(getAppLoader())) {\n return false\n }\n\n const file = relative(\n compiler.context,\n module.buildInfo.route.absolutePagePath\n )\n\n return new SimpleWebpackError(file, err.message)\n } catch {\n return false\n }\n}\n"],"names":["getNextAppLoaderError","err","module","compiler","loaders","loader","includes","getAppLoader","file","relative","context","buildInfo","route","absolutePagePath","SimpleWebpackError","message"],"mappings":";;;;+BAKgBA;;;eAAAA;;;sBAJS;oCACU;yBACN;AAEtB,SAASA,sBACdC,GAAU,EACVC,MAAW,EACXC,QAA0B;IAE1B,IAAI;QACF,IAAI,CAACD,OAAOE,OAAO,CAAC,EAAE,CAACC,MAAM,CAACC,QAAQ,CAACC,IAAAA,qBAAY,MAAK;YACtD,OAAO;QACT;QAEA,MAAMC,OAAOC,IAAAA,cAAQ,EACnBN,SAASO,OAAO,EAChBR,OAAOS,SAAS,CAACC,KAAK,CAACC,gBAAgB;QAGzC,OAAO,IAAIC,sCAAkB,CAACN,MAAMP,IAAIc,OAAO;IACjD,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
@@ -28,6 +28,7 @@ _export(exports, {
28
28
  return traverseModules;
29
29
  }
30
30
  });
31
+ const _entries = require("../entries");
31
32
  function traverseModules(compilation, callback, filterChunkGroup) {
32
33
  compilation.chunkGroups.forEach((chunkGroup)=>{
33
34
  if (filterChunkGroup && !filterChunkGroup(chunkGroup)) {
@@ -59,12 +60,12 @@ function forEachEntryModule(compilation, callback) {
59
60
  // Ensure only next-app-loader entries are handled.
60
61
  if (!entryDependency || !entryDependency.request) continue;
61
62
  const request = entryDependency.request;
62
- if (!request.startsWith('next-edge-ssr-loader?') && !request.startsWith('next-edge-app-route-loader?') && !request.startsWith('next-app-loader?')) continue;
63
+ if (!request.startsWith('next-edge-ssr-loader?') && !request.startsWith('next-edge-app-route-loader?') && !request.startsWith(`${(0, _entries.getAppLoader)()}?`)) continue;
63
64
  let entryModule = compilation.moduleGraph.getResolvedModule(entryDependency);
64
65
  if (request.startsWith('next-edge-ssr-loader?') || request.startsWith('next-edge-app-route-loader?')) {
65
66
  entryModule.dependencies.forEach((dependency)=>{
66
67
  const modRequest = dependency.request;
67
- if (modRequest == null ? void 0 : modRequest.includes('next-app-loader')) {
68
+ if (modRequest == null ? void 0 : modRequest.includes((0, _entries.getAppLoader)())) {
68
69
  entryModule = compilation.moduleGraph.getResolvedModule(dependency);
69
70
  }
70
71
  });
@@ -79,6 +80,9 @@ function formatBarrelOptimizedResource(resource, matchResource) {
79
80
  return `${resource}@${matchResource}`;
80
81
  }
81
82
  function getModuleReferencesInOrder(module1, moduleGraph) {
83
+ if ('getOutgoingConnectionsInOrder' in moduleGraph && typeof moduleGraph.getOutgoingConnectionsInOrder === 'function') {
84
+ return moduleGraph.getOutgoingConnectionsInOrder(module1);
85
+ }
82
86
  const connections = [];
83
87
  for (const connection of moduleGraph.getOutgoingConnections(module1)){
84
88
  if (connection.dependency && connection.module) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/build/webpack/utils.ts"],"sourcesContent":["import type {\n Compilation,\n Chunk,\n ChunkGroup,\n NormalModule,\n Module,\n ModuleGraph,\n} from 'webpack'\nimport type { ModuleGraphConnection } from 'webpack'\n\nexport function traverseModules(\n compilation: Compilation,\n callback: (\n mod: any,\n chunk: Chunk,\n chunkGroup: (typeof compilation.chunkGroups)[0],\n modId: string | null\n ) => any,\n filterChunkGroup?: (chunkGroup: ChunkGroup) => boolean\n) {\n compilation.chunkGroups.forEach((chunkGroup) => {\n if (filterChunkGroup && !filterChunkGroup(chunkGroup)) {\n return\n }\n chunkGroup.chunks.forEach((chunk: Chunk) => {\n const chunkModules = compilation.chunkGraph.getChunkModulesIterable(\n chunk\n // TODO: Update type so that it doesn't have to be cast.\n ) as Iterable<NormalModule>\n for (const mod of chunkModules) {\n const modId = compilation.chunkGraph.getModuleId(mod)?.toString()\n if (modId) callback(mod, chunk, chunkGroup, modId)\n const anyModule = mod as any\n if (anyModule.modules) {\n for (const subMod of anyModule.modules)\n if (modId) callback(subMod, chunk, chunkGroup, modId)\n }\n }\n })\n })\n}\n\n// Loop over all the entry modules.\nexport function forEachEntryModule(\n compilation: any,\n callback: ({ name, entryModule }: { name: string; entryModule: any }) => void\n) {\n for (const [name, entry] of compilation.entries.entries()) {\n // Skip for entries under pages/\n if (name.startsWith('pages/')) {\n continue\n }\n\n // Check if the page entry is a server component or not.\n const entryDependency: NormalModule | undefined = entry.dependencies?.[0]\n // Ensure only next-app-loader entries are handled.\n if (!entryDependency || !entryDependency.request) continue\n\n const request = entryDependency.request\n\n if (\n !request.startsWith('next-edge-ssr-loader?') &&\n !request.startsWith('next-edge-app-route-loader?') &&\n !request.startsWith('next-app-loader?')\n )\n continue\n\n let entryModule: NormalModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)\n\n if (\n request.startsWith('next-edge-ssr-loader?') ||\n request.startsWith('next-edge-app-route-loader?')\n ) {\n entryModule.dependencies.forEach((dependency) => {\n const modRequest: string | undefined = (dependency as any).request\n if (modRequest?.includes('next-app-loader')) {\n entryModule = compilation.moduleGraph.getResolvedModule(dependency)\n }\n })\n }\n\n callback({ name, entryModule })\n }\n}\n\nexport function formatBarrelOptimizedResource(\n resource: string,\n matchResource: string\n) {\n return `${resource}@${matchResource}`\n}\n\nexport function getModuleReferencesInOrder(\n module: Module,\n moduleGraph: ModuleGraph\n): ModuleGraphConnection[] {\n const connections = []\n for (const connection of moduleGraph.getOutgoingConnections(module)) {\n if (connection.dependency && connection.module) {\n connections.push({\n connection,\n index: moduleGraph.getParentBlockIndex(connection.dependency),\n })\n }\n }\n connections.sort((a, b) => a.index - b.index)\n return connections.map((c) => c.connection)\n}\n"],"names":["forEachEntryModule","formatBarrelOptimizedResource","getModuleReferencesInOrder","traverseModules","compilation","callback","filterChunkGroup","chunkGroups","forEach","chunkGroup","chunks","chunk","chunkModules","chunkGraph","getChunkModulesIterable","mod","modId","getModuleId","toString","anyModule","modules","subMod","name","entry","entries","startsWith","entryDependency","dependencies","request","entryModule","moduleGraph","getResolvedModule","dependency","modRequest","includes","resource","matchResource","module","connections","connection","getOutgoingConnections","push","index","getParentBlockIndex","sort","a","b","map","c"],"mappings":";;;;;;;;;;;;;;;;;IA2CgBA,kBAAkB;eAAlBA;;IA2CAC,6BAA6B;eAA7BA;;IAOAC,0BAA0B;eAA1BA;;IAnFAC,eAAe;eAAfA;;;AAAT,SAASA,gBACdC,WAAwB,EACxBC,QAKQ,EACRC,gBAAsD;IAEtDF,YAAYG,WAAW,CAACC,OAAO,CAAC,CAACC;QAC/B,IAAIH,oBAAoB,CAACA,iBAAiBG,aAAa;YACrD;QACF;QACAA,WAAWC,MAAM,CAACF,OAAO,CAA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gBAC1D;YACF;QACF;QAEA3B,SAAS;YAAEiB;YAAMO;QAAY;IAC/B;AACF;AAEO,SAAS5B,8BACdkC,QAAgB,EAChBC,aAAqB;IAErB,OAAO,GAAGD,SAAS,CAAC,EAAEC,eAAe;AACvC;AAEO,SAASlC,2BACdmC,OAAc,EACdP,WAAwB;IAExB,MAAMQ,cAAc,EAAE;IACtB,KAAK,MAAMC,cAAcT,YAAYU,sBAAsB,CAACH,SAAS;QACnE,IAAIE,WAAWP,UAAU,IAAIO,WAAWF,MAAM,EAAE;YAC9CC,YAAYG,IAAI,CAAC;gBACfF;gBACAG,OAAOZ,YAAYa,mBAAmB,CAACJ,WAAWP,UAAU;YAC9D;QACF;IACF;IACAM,YAAYM,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEH,KAAK,GAAGI,EAAEJ,KAAK;IAC5C,OAAOJ,YAAYS,GAAG,CAAC,CAACC,IAAMA,EAAET,UAAU;AAC5C"}
1
+ {"version":3,"sources":["../../../src/build/webpack/utils.ts"],"sourcesContent":["import type {\n Compilation,\n Chunk,\n ChunkGroup,\n NormalModule,\n Module,\n ModuleGraph,\n} from 'webpack'\nimport type { ModuleGraphConnection } from 'webpack'\nimport { getAppLoader } from '../entries'\n\nexport function traverseModules(\n compilation: Compilation,\n callback: (\n mod: any,\n chunk: Chunk,\n chunkGroup: (typeof compilation.chunkGroups)[0],\n modId: string | null\n ) => any,\n filterChunkGroup?: (chunkGroup: ChunkGroup) => boolean\n) {\n compilation.chunkGroups.forEach((chunkGroup) => {\n if (filterChunkGroup && !filterChunkGroup(chunkGroup)) {\n return\n }\n chunkGroup.chunks.forEach((chunk: Chunk) => {\n const chunkModules = compilation.chunkGraph.getChunkModulesIterable(\n chunk\n // TODO: Update type so that it doesn't have to be cast.\n ) as Iterable<NormalModule>\n for (const mod of chunkModules) {\n const modId = compilation.chunkGraph.getModuleId(mod)?.toString()\n if (modId) callback(mod, chunk, chunkGroup, modId)\n const anyModule = mod as any\n if (anyModule.modules) {\n for (const subMod of anyModule.modules)\n if (modId) callback(subMod, chunk, chunkGroup, modId)\n }\n }\n })\n })\n}\n\n// Loop over all the entry modules.\nexport function forEachEntryModule(\n compilation: any,\n callback: ({ name, entryModule }: { name: string; entryModule: any }) => void\n) {\n for (const [name, entry] of compilation.entries.entries()) {\n // Skip for entries under pages/\n if (name.startsWith('pages/')) {\n continue\n }\n\n // Check if the page entry is a server component or not.\n const entryDependency: NormalModule | undefined = entry.dependencies?.[0]\n // Ensure only next-app-loader entries are handled.\n if (!entryDependency || !entryDependency.request) continue\n\n const request = entryDependency.request\n\n if (\n !request.startsWith('next-edge-ssr-loader?') &&\n !request.startsWith('next-edge-app-route-loader?') &&\n !request.startsWith(`${getAppLoader()}?`)\n )\n continue\n\n let entryModule: NormalModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)\n\n if (\n request.startsWith('next-edge-ssr-loader?') ||\n request.startsWith('next-edge-app-route-loader?')\n ) {\n entryModule.dependencies.forEach((dependency) => {\n const modRequest: string | undefined = (dependency as any).request\n if (modRequest?.includes(getAppLoader())) {\n entryModule = compilation.moduleGraph.getResolvedModule(dependency)\n }\n })\n }\n\n callback({ name, entryModule })\n }\n}\n\nexport function formatBarrelOptimizedResource(\n resource: string,\n matchResource: string\n) {\n return `${resource}@${matchResource}`\n}\n\nexport function getModuleReferencesInOrder(\n module: Module,\n moduleGraph: ModuleGraph\n): ModuleGraphConnection[] {\n if (\n 'getOutgoingConnectionsInOrder' in moduleGraph &&\n typeof moduleGraph.getOutgoingConnectionsInOrder === 'function'\n ) {\n return moduleGraph.getOutgoingConnectionsInOrder(module)\n }\n const connections = []\n for (const connection of moduleGraph.getOutgoingConnections(module)) {\n if (connection.dependency && connection.module) {\n connections.push({\n connection,\n index: moduleGraph.getParentBlockIndex(connection.dependency),\n })\n }\n }\n connections.sort((a, b) => a.index - b.index)\n return connections.map((c) => c.connection)\n}\n"],"names":["forEachEntryModule","formatBarrelOptimizedResource","getModuleReferencesInOrder","traverseModules","compilation","callback","filterChunkGroup","chunkGroups","forEach","chunkGroup","chunks","chunk","chunkModules","chunkGraph","getChunkModulesIterable","mod","modId","getModuleId","toString","anyModule","modules","subMod","name","entry","entries","startsWith","entryDependency","dependencies","request","getAppLoader","entryModule","moduleGraph","getResolvedModule","dependency","modRequest","includes","resource","matchResource","module","getOutgoingConnectionsInOrder","connections","connection","getOutgoingConnections","push","index","getParentBlockIndex","sort","a","b","map","c"],"mappings":";;;;;;;;;;;;;;;;;IA4CgBA,kBAAkB;eAAlBA;;IA2CAC,6BAA6B;eAA7BA;;IAOAC,0BAA0B;eAA1BA;;IAnFAC,eAAe;eAAfA;;;yBAFa;AAEtB,SAASA,gBACdC,WAAwB,EACxBC,QAKQ,EACRC,gBAAsD;IAEtDF,YAAYG,WAAW,CAACC,OAAO,CAAC,CAACC;QAC/B,IAAIH,oBAAoB,CAACA,iBAAiBG,aAAa;YACrD;QACF;QACAA,WAAWC,MAAM,CAACF,OAAO,CAAC,CAACG;YACzB,MAAMC,eAAeR,YAAYS,UAAU,CAACC,uBAAuB,CACjEH;YAGF,KAAK,MAAMI,OAAOH,aAAc;oBAChBR;gBAAd,MAAMY,SAAQZ,sCAAAA,YAAYS,UAAU,CAACI,WAAW,CAACF,yBAAnCX,oCAAyCc,QAAQ;gBAC/D,IAAIF,OAAOX,SAASU,KAAKJ,OAAOF,YAAYO;gBAC5C,MAAMG,YAAYJ;gBAClB,IAAII,UAAUC,OAAO,EAAE;oBACrB,KAAK,MAAMC,UAAUF,UAAUC,OAAO,CACpC,IAAIJ,OAAOX,SAASgB,QAAQV,OAAOF,YAAYO;gBACnD;YACF;QACF;IACF;AACF;AAGO,SAAShB,mBACdI,WAAgB,EAChBC,QAA6E;IAE7E,KAAK,MAAM,CAACiB,MAAMC,MAAM,IAAInB,YAAYoB,OAAO,CAACA,OAAO,GAAI;YAOPD;QANlD,gCAAgC;QAChC,IAAID,KAAKG,UAAU,CAAC,WAAW;YAC7B;QACF;QAEA,wDAAwD;QACx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