@remotion/bundler 3.0.0-lambda.288 → 3.0.0-lambda.295

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.
Files changed (280) hide show
  1. package/dist/bundler.d.ts.map +1 -1
  2. package/dist/bundler.js +29 -11
  3. package/dist/bundler.js.map +1 -1
  4. package/dist/dev-middleware/compatible-api.d.ts +10 -0
  5. package/dist/dev-middleware/compatible-api.d.ts.map +1 -0
  6. package/dist/dev-middleware/compatible-api.js +45 -0
  7. package/dist/dev-middleware/compatible-api.js.map +1 -0
  8. package/dist/dev-middleware/get-filename-from-url.d.ts +3 -0
  9. package/dist/dev-middleware/get-filename-from-url.d.ts.map +1 -0
  10. package/dist/dev-middleware/get-filename-from-url.js +93 -0
  11. package/dist/dev-middleware/get-filename-from-url.js.map +1 -0
  12. package/dist/dev-middleware/get-paths.d.ts +8 -0
  13. package/dist/dev-middleware/get-paths.d.ts.map +1 -0
  14. package/dist/dev-middleware/get-paths.js +20 -0
  15. package/dist/dev-middleware/get-paths.js.map +1 -0
  16. package/dist/dev-middleware/index.d.ts +3 -0
  17. package/dist/dev-middleware/index.d.ts.map +1 -0
  18. package/dist/dev-middleware/index.js +58 -0
  19. package/dist/dev-middleware/index.js.map +1 -0
  20. package/dist/dev-middleware/is-color-supported.d.ts +2 -0
  21. package/dist/dev-middleware/is-color-supported.d.ts.map +1 -0
  22. package/dist/dev-middleware/is-color-supported.js +34 -0
  23. package/dist/dev-middleware/is-color-supported.js.map +1 -0
  24. package/dist/dev-middleware/middleware.d.ts +4 -0
  25. package/dist/dev-middleware/middleware.d.ts.map +1 -0
  26. package/dist/dev-middleware/middleware.js +142 -0
  27. package/dist/dev-middleware/middleware.js.map +1 -0
  28. package/dist/dev-middleware/range-parser.d.ts +16 -0
  29. package/dist/dev-middleware/range-parser.d.ts.map +1 -0
  30. package/dist/dev-middleware/range-parser.js +97 -0
  31. package/dist/dev-middleware/range-parser.js.map +1 -0
  32. package/dist/dev-middleware/ready.d.ts +6 -0
  33. package/dist/dev-middleware/ready.d.ts.map +1 -0
  34. package/dist/dev-middleware/ready.js +14 -0
  35. package/dist/dev-middleware/ready.js.map +1 -0
  36. package/dist/dev-middleware/setup-hooks.d.ts +3 -0
  37. package/dist/dev-middleware/setup-hooks.d.ts.map +1 -0
  38. package/dist/dev-middleware/setup-hooks.js +45 -0
  39. package/dist/dev-middleware/setup-hooks.js.map +1 -0
  40. package/dist/dev-middleware/setup-output-filesystem.d.ts +3 -0
  41. package/dist/dev-middleware/setup-output-filesystem.d.ts.map +1 -0
  42. package/dist/dev-middleware/setup-output-filesystem.js +14 -0
  43. package/dist/dev-middleware/setup-output-filesystem.js.map +1 -0
  44. package/dist/dev-middleware/types.d.ts +12 -0
  45. package/dist/dev-middleware/types.d.ts.map +1 -0
  46. package/dist/dev-middleware/types.js +3 -0
  47. package/dist/dev-middleware/types.js.map +1 -0
  48. package/dist/error-overlay/entry-basic.d.ts +2 -0
  49. package/dist/error-overlay/entry-basic.d.ts.map +1 -0
  50. package/dist/error-overlay/entry-basic.js +25 -0
  51. package/dist/error-overlay/entry-basic.js.map +1 -0
  52. package/dist/error-overlay/react-overlay/effects/format-warning.d.ts +12 -0
  53. package/dist/error-overlay/react-overlay/effects/format-warning.d.ts.map +1 -0
  54. package/dist/error-overlay/react-overlay/effects/format-warning.js +42 -0
  55. package/dist/error-overlay/react-overlay/effects/format-warning.js.map +1 -0
  56. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts +8 -0
  57. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts.map +1 -0
  58. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js +36 -0
  59. package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js.map +1 -0
  60. package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts +25 -0
  61. package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts.map +1 -0
  62. package/dist/error-overlay/react-overlay/effects/proxy-console.js +65 -0
  63. package/dist/error-overlay/react-overlay/effects/proxy-console.js.map +1 -0
  64. package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts +4 -0
  65. package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts.map +1 -0
  66. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +38 -0
  67. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -0
  68. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts +4 -0
  69. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts.map +1 -0
  70. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js +44 -0
  71. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js.map +1 -0
  72. package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts +5 -0
  73. package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts.map +1 -0
  74. package/dist/error-overlay/react-overlay/effects/unhandled-error.js +46 -0
  75. package/dist/error-overlay/react-overlay/effects/unhandled-error.js.map +1 -0
  76. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts +5 -0
  77. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts.map +1 -0
  78. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js +42 -0
  79. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js.map +1 -0
  80. package/dist/error-overlay/react-overlay/index.d.ts +9 -0
  81. package/dist/error-overlay/react-overlay/index.d.ts.map +1 -0
  82. package/dist/error-overlay/react-overlay/index.js +49 -0
  83. package/dist/error-overlay/react-overlay/index.js.map +1 -0
  84. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +10 -0
  85. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -0
  86. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +73 -0
  87. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -0
  88. package/dist/error-overlay/react-overlay/utils/get-file-source.d.ts +2 -0
  89. package/dist/error-overlay/react-overlay/utils/get-file-source.d.ts.map +1 -0
  90. package/dist/error-overlay/react-overlay/utils/get-file-source.js +22 -0
  91. package/dist/error-overlay/react-overlay/utils/get-file-source.js.map +1 -0
  92. package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts +15 -0
  93. package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -0
  94. package/dist/error-overlay/react-overlay/utils/get-lines-around.js +31 -0
  95. package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -0
  96. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +50 -0
  97. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -0
  98. package/dist/error-overlay/react-overlay/utils/get-source-map.js +105 -0
  99. package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -0
  100. package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts +16 -0
  101. package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -0
  102. package/dist/error-overlay/react-overlay/utils/get-stack-frames.js +43 -0
  103. package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -0
  104. package/dist/error-overlay/react-overlay/utils/mapper.d.ts +16 -0
  105. package/dist/error-overlay/react-overlay/utils/mapper.d.ts.map +1 -0
  106. package/dist/error-overlay/react-overlay/utils/mapper.js +61 -0
  107. package/dist/error-overlay/react-overlay/utils/mapper.js.map +1 -0
  108. package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts +13 -0
  109. package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts.map +1 -0
  110. package/dist/error-overlay/react-overlay/utils/open-in-editor.js +450 -0
  111. package/dist/error-overlay/react-overlay/utils/open-in-editor.js.map +1 -0
  112. package/dist/error-overlay/react-overlay/utils/parser.d.ts +14 -0
  113. package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -0
  114. package/dist/error-overlay/react-overlay/utils/parser.js +84 -0
  115. package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -0
  116. package/dist/error-overlay/react-overlay/utils/path.d.ts +2 -0
  117. package/dist/error-overlay/react-overlay/utils/path.d.ts.map +1 -0
  118. package/dist/error-overlay/react-overlay/utils/path.js +98 -0
  119. package/dist/error-overlay/react-overlay/utils/path.js.map +1 -0
  120. package/dist/error-overlay/react-overlay/utils/settle-promise.d.ts +3 -0
  121. package/dist/error-overlay/react-overlay/utils/settle-promise.d.ts.map +1 -0
  122. package/dist/error-overlay/react-overlay/utils/settle-promise.js +20 -0
  123. package/dist/error-overlay/react-overlay/utils/settle-promise.js.map +1 -0
  124. package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +38 -0
  125. package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -0
  126. package/dist/error-overlay/react-overlay/utils/stack-frame.js +71 -0
  127. package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -0
  128. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +13 -0
  129. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -0
  130. package/dist/error-overlay/react-overlay/utils/unmapper.js +93 -0
  131. package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -0
  132. package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts +3 -0
  133. package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts.map +1 -0
  134. package/dist/error-overlay/remotion-overlay/AskOnDiscord.js +15 -0
  135. package/dist/error-overlay/remotion-overlay/AskOnDiscord.js.map +1 -0
  136. package/dist/error-overlay/remotion-overlay/Button.d.ts +6 -0
  137. package/dist/error-overlay/remotion-overlay/Button.d.ts.map +1 -0
  138. package/dist/error-overlay/remotion-overlay/Button.js +25 -0
  139. package/dist/error-overlay/remotion-overlay/Button.js.map +1 -0
  140. package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts +7 -0
  141. package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts.map +1 -0
  142. package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -0
  143. package/dist/error-overlay/remotion-overlay/CodeFrame.js.map +1 -0
  144. package/dist/error-overlay/remotion-overlay/DismissButton.d.ts +3 -0
  145. package/dist/error-overlay/remotion-overlay/DismissButton.d.ts.map +1 -0
  146. package/dist/error-overlay/remotion-overlay/DismissButton.js +24 -0
  147. package/dist/error-overlay/remotion-overlay/DismissButton.js.map +1 -0
  148. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +6 -0
  149. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -0
  150. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +80 -0
  151. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -0
  152. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +6 -0
  153. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -0
  154. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +92 -0
  155. package/dist/error-overlay/remotion-overlay/OpenInEditor.js.map +1 -0
  156. package/dist/error-overlay/remotion-overlay/Overlay.d.ts +17 -0
  157. package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -0
  158. package/dist/error-overlay/remotion-overlay/Overlay.js +35 -0
  159. package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -0
  160. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts +5 -0
  161. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts.map +1 -0
  162. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +14 -0
  163. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js.map +1 -0
  164. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +9 -0
  165. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -0
  166. package/dist/error-overlay/remotion-overlay/StackFrame.js +44 -0
  167. package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -0
  168. package/dist/error-overlay/remotion-overlay/carets.d.ts +3 -0
  169. package/dist/error-overlay/remotion-overlay/carets.d.ts.map +1 -0
  170. package/dist/error-overlay/remotion-overlay/carets.js +13 -0
  171. package/dist/error-overlay/remotion-overlay/carets.js.map +1 -0
  172. package/dist/error-overlay/remotion-overlay/format-location.d.ts +2 -0
  173. package/dist/error-overlay/remotion-overlay/format-location.d.ts.map +1 -0
  174. package/dist/error-overlay/remotion-overlay/format-location.js +11 -0
  175. package/dist/error-overlay/remotion-overlay/format-location.js.map +1 -0
  176. package/dist/error-overlay/remotion-overlay/index.d.ts +2 -0
  177. package/dist/error-overlay/remotion-overlay/index.d.ts.map +1 -0
  178. package/dist/error-overlay/remotion-overlay/index.js +14 -0
  179. package/dist/error-overlay/remotion-overlay/index.js.map +1 -0
  180. package/dist/fast-refresh/helpers.d.ts +15 -7
  181. package/dist/fast-refresh/helpers.d.ts.map +1 -1
  182. package/dist/fast-refresh/helpers.js +33 -25
  183. package/dist/fast-refresh/helpers.js.map +1 -1
  184. package/dist/fast-refresh/{fast-refresh.d.ts → index.d.ts} +4 -1
  185. package/dist/fast-refresh/index.d.ts.map +1 -0
  186. package/dist/fast-refresh/index.js +60 -0
  187. package/dist/fast-refresh/index.js.map +1 -0
  188. package/dist/fast-refresh/loader.d.ts +12 -2
  189. package/dist/fast-refresh/loader.d.ts.map +1 -1
  190. package/dist/fast-refresh/loader.js +13 -37
  191. package/dist/fast-refresh/loader.js.map +1 -1
  192. package/dist/fast-refresh/runtime.d.ts +12 -2
  193. package/dist/fast-refresh/runtime.d.ts.map +1 -1
  194. package/dist/fast-refresh/runtime.js +8 -27
  195. package/dist/fast-refresh/runtime.js.map +1 -1
  196. package/dist/hot-middleware/client.d.ts +20 -0
  197. package/dist/hot-middleware/client.d.ts.map +1 -0
  198. package/dist/hot-middleware/client.js +208 -0
  199. package/dist/hot-middleware/client.js.map +1 -0
  200. package/dist/hot-middleware/index.d.ts +14 -0
  201. package/dist/hot-middleware/index.d.ts.map +1 -0
  202. package/dist/hot-middleware/index.js +181 -0
  203. package/dist/hot-middleware/index.js.map +1 -0
  204. package/dist/hot-middleware/process-update.d.ts +13 -0
  205. package/dist/hot-middleware/process-update.d.ts.map +1 -0
  206. package/dist/hot-middleware/process-update.js +149 -0
  207. package/dist/hot-middleware/process-update.js.map +1 -0
  208. package/dist/hot-middleware/strip-ansi.d.ts +2 -0
  209. package/dist/hot-middleware/strip-ansi.d.ts.map +1 -0
  210. package/dist/hot-middleware/strip-ansi.js +22 -0
  211. package/dist/hot-middleware/strip-ansi.js.map +1 -0
  212. package/dist/hot-middleware/types.d.ts +39 -0
  213. package/dist/hot-middleware/types.d.ts.map +1 -0
  214. package/dist/hot-middleware/types.js +18 -0
  215. package/dist/hot-middleware/types.js.map +1 -0
  216. package/dist/index.d.ts +0 -1
  217. package/dist/index.d.ts.map +1 -1
  218. package/dist/renderEntry.js +2 -2
  219. package/dist/renderEntry.js.map +1 -1
  220. package/dist/setup-environment.js +1 -0
  221. package/dist/setup-environment.js.map +1 -1
  222. package/dist/start-server.d.ts +0 -1
  223. package/dist/start-server.d.ts.map +1 -1
  224. package/dist/start-server.js +58 -14
  225. package/dist/start-server.js.map +1 -1
  226. package/dist/static-preview.d.ts +1 -1
  227. package/dist/static-preview.d.ts.map +1 -1
  228. package/dist/static-preview.js +8 -2
  229. package/dist/static-preview.js.map +1 -1
  230. package/dist/test/expect-to-throw.d.ts +2 -0
  231. package/dist/test/expect-to-throw.d.ts.map +1 -0
  232. package/dist/test/expect-to-throw.js +15 -0
  233. package/dist/test/expect-to-throw.js.map +1 -0
  234. package/dist/test/parse-error-stack.test.d.ts +2 -0
  235. package/dist/test/parse-error-stack.test.d.ts.map +1 -0
  236. package/dist/test/parse-error-stack.test.js +18 -0
  237. package/dist/test/parse-error-stack.test.js.map +1 -0
  238. package/dist/test/secure-source-read.test.d.ts +2 -0
  239. package/dist/test/secure-source-read.test.d.ts.map +1 -0
  240. package/dist/test/secure-source-read.test.js +9 -0
  241. package/dist/test/secure-source-read.test.js.map +1 -0
  242. package/dist/update-available.d.ts +1 -1
  243. package/dist/update-available.d.ts.map +1 -1
  244. package/dist/webpack-cache.d.ts +0 -1
  245. package/dist/webpack-cache.d.ts.map +1 -1
  246. package/dist/webpack-cache.js +2 -3
  247. package/dist/webpack-cache.js.map +1 -1
  248. package/dist/webpack-config.d.ts +1 -2
  249. package/dist/webpack-config.d.ts.map +1 -1
  250. package/dist/webpack-config.js +14 -11
  251. package/dist/webpack-config.js.map +1 -1
  252. package/package.json +12 -8
  253. package/dist/env-variables.d.ts +0 -2
  254. package/dist/env-variables.d.ts.map +0 -1
  255. package/dist/env-variables.js +0 -5
  256. package/dist/env-variables.js.map +0 -1
  257. package/dist/fast-refresh/error-overlay/entry-basic.d.ts +0 -3
  258. package/dist/fast-refresh/error-overlay/entry-basic.d.ts.map +0 -1
  259. package/dist/fast-refresh/error-overlay/entry-basic.js +0 -27
  260. package/dist/fast-refresh/error-overlay/entry-basic.js.map +0 -1
  261. package/dist/fast-refresh/error-overlay/entry-devserver.d.ts +0 -8
  262. package/dist/fast-refresh/error-overlay/entry-devserver.d.ts.map +0 -1
  263. package/dist/fast-refresh/error-overlay/entry-devserver.js +0 -36
  264. package/dist/fast-refresh/error-overlay/entry-devserver.js.map +0 -1
  265. package/dist/fast-refresh/error-overlay/index.d.ts +0 -7
  266. package/dist/fast-refresh/error-overlay/index.d.ts.map +0 -1
  267. package/dist/fast-refresh/error-overlay/index.js +0 -92
  268. package/dist/fast-refresh/error-overlay/index.js.map +0 -1
  269. package/dist/fast-refresh/fast-refresh.d.ts.map +0 -1
  270. package/dist/fast-refresh/fast-refresh.js +0 -98
  271. package/dist/fast-refresh/fast-refresh.js.map +0 -1
  272. package/dist/hot-middleware.d.ts +0 -28
  273. package/dist/hot-middleware.d.ts.map +0 -1
  274. package/dist/hot-middleware.js +0 -119
  275. package/dist/hot-middleware.js.map +0 -1
  276. package/dist/setup-env-variables.d.ts +0 -2
  277. package/dist/setup-env-variables.d.ts.map +0 -1
  278. package/dist/setup-env-variables.js +0 -5
  279. package/dist/setup-env-variables.js.map +0 -1
  280. package/web/index.html +0 -21
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/fast-refresh/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+EAA+E;AAC/E,yBAAyB;AACzB,EAAE;AACF,8HAA8H;AAE9H,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAExD,SAAS,YAAY,CAAC,GAAG;IACxB,OAAO,CACN,GAAG,KAAK,YAAY;QACpB,GAAG,KAAK,SAAS;QACjB,GAAG,KAAK,SAAS;QACjB,qEAAqE;QACrE,GAAG,KAAK,QAAQ,CAChB,CAAC;AACH,CAAC;AAED,SAAS,8BAA8B,CAAC,aAAa,EAAE,QAAQ;IAC9D,cAAc,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;IAChE,IAAI,aAAa,IAAI,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QAC/D,yCAAyC;QACzC,+CAA+C;QAC/C,OAAO;KACP;IAED,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;QAChC,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;YACtB,SAAS;SACT;QAED,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,GAAG,CAAC;QAC9C,cAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;KAC7C;AACF,CAAC;AAED,SAAS,sBAAsB,CAAC,aAAa;IAC5C,IAAI,cAAc,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE;QACxD,OAAO,IAAI,CAAC;KACZ;IAED,IAAI,aAAa,IAAI,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QAC/D,yCAAyC;QACzC,OAAO,KAAK,CAAC;KACb;IAED,IAAI,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SAAS,CAAC;AAClB,CAAC;AAED,SAAS,cAAc;;IACtB,MAAM,OAAO,GAAG,GAAG,EAAE;QACpB,IAAI;YACH,cAAc,CAAC,mBAAmB,EAAE,CAAC;SACrC;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,IAAI,CACX,+EAA+E;gBAC9E,GAAG,CACJ,CAAC;SACF;IACF,CAAC,CAAC;IAEF,wDAAwD;IACxD,IAAI,CAAA,MAAA,MAAM,CAAC,GAAG,0CAAE,MAAM,EAAE,MAAK,MAAM,EAAE;QACpC,OAAO;KACP;IAED,MAAA,MAAM,CAAC,GAAG,0CAAE,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE;QACvC,IAAI,MAAM,KAAK,MAAM,EAAE;YACtB,OAAO,EAAE,CAAC;SACV;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe;IACd,8BAA8B;IAC9B,sBAAsB;IACtB,oCAAoC;IACpC,2BAA2B;IAC3B,cAAc;CACd,CAAC"}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
3
+ */
1
4
  /**
2
5
  * The MIT License (MIT)
3
6
  *
@@ -25,4 +28,4 @@ import webpack from 'webpack';
25
28
  export declare class ReactFreshWebpackPlugin {
26
29
  apply(compiler: webpack.Compiler): void;
27
30
  }
28
- //# sourceMappingURL=fast-refresh.d.ts.map
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fast-refresh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,OAAO,MAAM,SAAS,CAAC;AAqC9B,qBAAa,uBAAuB;IACnC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;CAoChC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ReactFreshWebpackPlugin = void 0;
7
+ const webpack_1 = require("webpack");
8
+ class ReactRefreshRuntimeModule extends webpack_1.RuntimeModule {
9
+ constructor() {
10
+ super('react refresh', 5);
11
+ }
12
+ generate() {
13
+ const { runtimeTemplate } = this.compilation;
14
+ return webpack_1.Template.asString([
15
+ `${webpack_1.RuntimeGlobals.interceptModuleExecution}.push(${runtimeTemplate.basicFunction('options', [
16
+ `const originalFactory = options.factory;`,
17
+ `options.factory = ${runtimeTemplate.basicFunction('moduleObject, moduleExports, webpackRequire', [
18
+ // Legacy CSS implementations will `eval` browser code in a Node.js
19
+ // context to extract CSS. For backwards compatibility, we need to check
20
+ // we're in a browser context before continuing.
21
+ `const hasRefresh = typeof self !== "undefined" && !!self.$RefreshInterceptModuleExecution$;`,
22
+ `const cleanup = hasRefresh ? self.$RefreshInterceptModuleExecution$(moduleObject.id) : () => {};`,
23
+ 'try {',
24
+ webpack_1.Template.indent('originalFactory.call(this, moduleObject, moduleExports, webpackRequire);'),
25
+ '} finally {',
26
+ webpack_1.Template.indent(`cleanup();`),
27
+ '}',
28
+ ])}`,
29
+ ])})`,
30
+ ]);
31
+ }
32
+ }
33
+ class ReactFreshWebpackPlugin {
34
+ apply(compiler) {
35
+ const webpackMajorVersion = parseInt(webpack_1.version !== null && webpack_1.version !== void 0 ? webpack_1.version : '', 10);
36
+ if (webpackMajorVersion < 5) {
37
+ throw new Error(`ReactFreshWebpackPlugin does not support webpack v${webpackMajorVersion}.`);
38
+ }
39
+ compiler.hooks.compilation.tap(this.constructor.name, (compilation) => {
40
+ compilation.mainTemplate.hooks.localVars.tap(this.constructor.name, (source) => webpack_1.Template.asString([
41
+ source,
42
+ '',
43
+ '// noop fns to prevent runtime errors during initialization',
44
+ 'if (typeof self !== "undefined") {',
45
+ webpack_1.Template.indent('self.$RefreshReg$ = function () {};'),
46
+ webpack_1.Template.indent('self.$RefreshSig$ = function () {'),
47
+ webpack_1.Template.indent(webpack_1.Template.indent('return function (type) {')),
48
+ webpack_1.Template.indent(webpack_1.Template.indent(webpack_1.Template.indent('return type;'))),
49
+ webpack_1.Template.indent(webpack_1.Template.indent('};')),
50
+ webpack_1.Template.indent('};'),
51
+ '}',
52
+ ]));
53
+ compilation.hooks.additionalTreeRuntimeRequirements.tap(this.constructor.name, (chunk) => {
54
+ compilation.addRuntimeModule(chunk, new ReactRefreshRuntimeModule());
55
+ });
56
+ });
57
+ }
58
+ }
59
+ exports.ReactFreshWebpackPlugin = ReactFreshWebpackPlugin;
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fast-refresh/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAgCH,qCAAyE;AAEzE,MAAM,yBAA0B,SAAQ,uBAAa;IACpD;QACC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,QAAQ;QACP,MAAM,EAAC,eAAe,EAAC,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3C,OAAO,kBAAQ,CAAC,QAAQ,CAAC;YACxB,GACC,wBAAc,CAAC,wBAChB,SAAS,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE;gBACjD,0CAA0C;gBAC1C,qBAAqB,eAAe,CAAC,aAAa,CACjD,6CAA6C,EAC7C;oBACC,mEAAmE;oBACnE,wEAAwE;oBACxE,gDAAgD;oBAChD,6FAA6F;oBAC7F,kGAAkG;oBAClG,OAAO;oBACP,kBAAQ,CAAC,MAAM,CACd,0EAA0E,CAC1E;oBACD,aAAa;oBACb,kBAAQ,CAAC,MAAM,CAAC,YAAY,CAAC;oBAC7B,GAAG;iBACH,CACD,EAAE;aACH,CAAC,GAAG;SACL,CAAC,CAAC;IACJ,CAAC;CACD;AAED,MAAa,uB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AC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AArCD,0DAqCC"}
@@ -1,3 +1,12 @@
1
+ /**
2
+ * ⚠️ Be careful when refactoring this file!
3
+ * This gets injected into every file of the browser.
4
+ * You cannot have returns, optional chains, inverse the if statement etc.
5
+ * Check the Typescript output in dist/ to see that no extra `var` statements were produced
6
+ */
7
+ /**
8
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
9
+ */
1
10
  /**
2
11
  * The MIT License (MIT)
3
12
  *
@@ -21,6 +30,7 @@
21
30
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
31
  * SOFTWARE.
23
32
  */
24
- declare function RefreshModuleRuntime(): void;
25
- declare let refreshModuleRuntime: string;
33
+ import { LoaderDefinition } from 'webpack';
34
+ declare const ReactRefreshLoader: LoaderDefinition;
35
+ export default ReactRefreshLoader;
26
36
  //# sourceMappingURL=loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/fast-refresh/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,iBAAS,oBAAoB,SA8E5B;AAED,QAAA,IAAI,oBAAoB,QAAkC,CAAC"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/fast-refresh/loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAyFzC,QAAA,MAAM,kBAAkB,EAAE,gBAEzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,64 +1,44 @@
1
1
  "use strict";
2
2
  /**
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2020 Vercel, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
3
+ * ⚠️ Be careful when refactoring this file!
4
+ * This gets injected into every file of the browser.
5
+ * You cannot have returns, optional chains, inverse the if statement etc.
6
+ * Check the Typescript output in dist/ to see that no extra `var` statements were produced
24
7
  */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
25
9
  // This file is copied from the @vercel/next.js, with removed TS annotations
26
10
  //
27
11
  // https://github.com/vercel/next.js/blob/canary/packages/react-refresh-utils/loader.ts
28
12
  // This function gets unwrapped into global scope, which is why we don't invert
29
13
  // if-blocks. Also, you cannot use `return`.
30
14
  function RefreshModuleRuntime() {
31
- var _a, _b;
32
15
  // Legacy CSS implementations will `eval` browser code in a Node.js context
33
16
  // to extract CSS. For backwards compatibility, we need to check we're in a
34
17
  // browser context before continuing.
35
18
  if (typeof self !== 'undefined' &&
36
19
  // AMP / No-JS mode does not inject these helpers:
37
20
  '$RefreshHelpers$' in self) {
38
- // @ts-expect-errors
21
+ // @ts-expect-error
39
22
  // eslint-disable-next-line no-proto
40
23
  const currentExports = module.__proto__.exports;
41
24
  let prevExports = null;
42
- if ((_b = (_a = module.hot) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.prevExports) {
25
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
26
+ if (module.hot && module.hot.data && module.hot.data.prevExports) {
43
27
  prevExports = module.hot.data.prevExports;
44
28
  }
45
29
  // This cannot happen in MainTemplate because the exports mismatch between
46
30
  // templating and execution.
47
- // @ts-expect-error
48
31
  self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
49
32
  // A module can be accepted automatically based on its exports, e.g. when
50
33
  // it is a Refresh Boundary.
51
- // @ts-expect-error
52
34
  if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
53
35
  // Save the previous exports on update so we can compare the boundary
54
36
  // signatures.
55
- // @ts-expect-errors
56
37
  module.hot.dispose((data) => {
57
38
  data.prevExports = currentExports;
58
39
  });
59
40
  // Unconditionally accept an update to this module, we'll check if it's
60
41
  // still a Refresh Boundary later.
61
- // @ts-expect-errors
62
42
  module.hot.accept();
63
43
  // This field is set when the previous version of this module was a
64
44
  // Refresh Boundary, letting us know we need to check for invalidation or
@@ -71,14 +51,11 @@ function RefreshModuleRuntime() {
71
51
  // re-execute the importing modules, and force those components to
72
52
  // re-render. Similarly, if you convert a class component to a
73
53
  // function, we want to invalidate the boundary.
74
- if (
75
- // @ts-expect-error
76
- self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
77
- // @ts-expect-errors
54
+ if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
55
+ // @ts-expect-error
78
56
  module.hot.invalidate();
79
57
  }
80
58
  else {
81
- // @ts-expect-errors
82
59
  self.$RefreshHelpers$.scheduleUpdate();
83
60
  }
84
61
  }
@@ -90,7 +67,7 @@ function RefreshModuleRuntime() {
90
67
  // because we already accepted this update (accidental side effect).
91
68
  const isNoLongerABoundary = prevExports !== null;
92
69
  if (isNoLongerABoundary) {
93
- // @ts-expect-errors
70
+ // @ts-expect-error
94
71
  module.hot.invalidate();
95
72
  }
96
73
  }
@@ -98,9 +75,8 @@ function RefreshModuleRuntime() {
98
75
  }
99
76
  let refreshModuleRuntime = RefreshModuleRuntime.toString();
100
77
  refreshModuleRuntime = refreshModuleRuntime.slice(refreshModuleRuntime.indexOf('{') + 1, refreshModuleRuntime.lastIndexOf('}'));
101
- // eslint-disable-next-line func-names
102
- module.exports = function ReactRefreshLoader(source, inputSourceMap) {
103
- // @ts-expect-error
78
+ const ReactRefreshLoader = function (source, inputSourceMap) {
104
79
  this.callback(null, `${source}\n\n;${refreshModuleRuntime}`, inputSourceMap);
105
80
  };
81
+ exports.default = ReactRefreshLoader;
106
82
  //# sourceMappingURL=loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/fast-refresh/loader.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,4EAA4E;AAC5E,EAAE;AACF,uFAAuF;AAEvF,+EAA+E;AAC/E,4CAA4C;AAC5C,SAAS,oBAAoB;;IAC5B,2EAA2E;IAC3E,2EAA2E;IAC3E,qCAAqC;IACrC,IACC,OAAO,IAAI,KAAK,WAAW;QAC3B,kDAAkD;QAClD,kBAAkB,IAAI,IAAI,EACzB;QACD,oBAAoB;QACpB,oCAAoC;QACpC,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;QAChD,IAAI,WAAW,GAAG,IAAI,CAAC;QAEvB,IAAI,MAAA,MAAA,MAAM,CAAC,GAAG,0CAAE,IAAI,0CAAE,WAAW,EAAE;YAClC,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;SAC1C;QAED,0EAA0E;QAC1E,4BAA4B;QAC5B,mBAAmB;QACnB,IAAI,CAAC,gBAAgB,CAAC,8BAA8B,C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AkB,CAAC"}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
3
+ */
1
4
  /**
2
5
  * The MIT License (MIT)
3
6
  *
@@ -21,6 +24,13 @@
21
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
25
  * SOFTWARE.
23
26
  */
24
- declare const RefreshRuntime: any;
25
- declare const RefreshHelpers: any;
27
+ declare global {
28
+ interface Window {
29
+ $RefreshReg$: (type: string, id?: string) => void;
30
+ $RefreshSig$: () => (type: string) => unknown;
31
+ $RefreshHelpers$: typeof RefreshHelpers;
32
+ $RefreshInterceptModuleExecution$: (webpackId: unknown) => () => void;
33
+ }
34
+ }
35
+ import RefreshHelpers from './helpers';
26
36
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/fast-refresh/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,QAAA,MAAM,cAAc,KAAmC,CAAC;AACxD,QAAA,MAAM,cAAc,KAAuB,CAAC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/fast-refresh/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;QAClD,YAAY,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;QAC9C,gBAAgB,EAAE,OAAO,cAAc,CAAC;QACxC,iCAAiC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;KACtE;CACD;AAGD,OAAO,cAAc,MAAM,WAAW,CAAC"}
@@ -1,39 +1,20 @@
1
1
  "use strict";
2
2
  /**
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2020 Vercel, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
3
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
24
4
  */
25
- // This file is copied from the @vercel/next.js, with removed TS annotations
26
- //
27
- // https://github.com/vercel/next.js/blob/canary/packages/react-refresh-utils/runtime.ts
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
28
9
  const RefreshRuntime = require('react-refresh/runtime');
29
- const RefreshHelpers = require('./helpers');
10
+ const helpers_1 = __importDefault(require("./helpers"));
30
11
  // Hook into ReactDOM initialization
31
12
  RefreshRuntime.injectIntoGlobalHook(self);
32
13
  // noop fns to prevent runtime errors during initialization
33
- self.$RefreshReg$ = () => { };
14
+ self.$RefreshReg$ = () => undefined;
34
15
  self.$RefreshSig$ = () => (type) => type;
35
16
  // Register global helpers
36
- self.$RefreshHelpers$ = RefreshHelpers;
17
+ self.$RefreshHelpers$ = helpers_1.default;
37
18
  // Register a helper for module execution interception
38
19
  self.$RefreshInterceptModuleExecution$ = function (webpackModuleId) {
39
20
  const prevRefreshReg = self.$RefreshReg$;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/fast-refresh/runtime.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,4EAA4E;AAC5E,EAAE;AACF,wFAAwF;AAExF,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACxD,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE5C,oCAAoC;AACpC,cAAc,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;AAE1C,2DAA2D;AAC3D,IAAI,CAAC,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAC7B,IAAI,CAAC,YAAY,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;AAEzC,0BAA0B;AAC1B,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC;AAEvC,sDAAsD;AACtD,IAAI,CAAC,iCAAiC,GAAG,UAAU,eAAe;IACjE,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC;IACzC,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC;IAEzC,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;QAChC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC;IAEF,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,m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1
+ import { HotMiddlewareMessage } from './types';
2
+ declare function eventSourceWrapper(): {
3
+ addMessageListener(fn: (msg: MessageEvent) => void): void;
4
+ };
5
+ declare global {
6
+ interface Window {
7
+ __whmEventSourceWrapper: {
8
+ [key: string]: ReturnType<typeof eventSourceWrapper>;
9
+ };
10
+ __webpack_hot_middleware_reporter__: Reporter;
11
+ }
12
+ }
13
+ declare type Reporter = ReturnType<typeof createReporter>;
14
+ declare function createReporter(): {
15
+ cleanProblemsCache(): void;
16
+ problems(type: 'errors' | 'warnings', obj: HotMiddlewareMessage): boolean;
17
+ success: () => undefined;
18
+ };
19
+ export {};
20
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/hot-middleware/client.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,oBAAoB,EAAuB,MAAM,SAAS,CAAC;AAgBnE,iBAAS,kBAAkB;iCAsCI,YAAY,KAAK,IAAI;EAInD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,uBAAuB,EAAE;YACxB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;SACrD,CAAC;QACF,mCAAmC,EAAE,QAAQ,CAAC;KAC9C;CACD;AAiDD,aAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAElD,iBAAS,cAAc;;mBA+CN,QAAQ,GAAG,UAAU,OAAO,oBAAoB;;EAShE"}
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Source code is adapted from
5
+ * https://github.com/webpack-contrib/webpack-hot-middleware#readme
6
+ * and rewritten in TypeScript. This file is MIT licensed
7
+ */
8
+ const process_update_1 = require("./process-update");
9
+ const strip_ansi_1 = require("./strip-ansi");
10
+ const types_1 = require("./types");
11
+ if (typeof window === 'undefined') {
12
+ // do nothing
13
+ }
14
+ else if (typeof window.EventSource === 'undefined') {
15
+ console.warn('Unsupported browser: You need a browser that supports EventSource ');
16
+ }
17
+ else if (types_1.hotMiddlewareOptions.autoConnect) {
18
+ connect();
19
+ }
20
+ function setOptionsAndConnect() {
21
+ connect();
22
+ }
23
+ function eventSourceWrapper() {
24
+ let source;
25
+ let lastActivity = Date.now();
26
+ const listeners = [];
27
+ init();
28
+ const timer = setInterval(() => {
29
+ if (Date.now() - lastActivity > types_1.hotMiddlewareOptions.timeout) {
30
+ handleDisconnect();
31
+ }
32
+ }, types_1.hotMiddlewareOptions.timeout / 2);
33
+ function init() {
34
+ source = new window.EventSource(types_1.hotMiddlewareOptions.path);
35
+ source.onopen = handleOnline;
36
+ source.onerror = handleDisconnect;
37
+ source.onmessage = handleMessage;
38
+ }
39
+ function handleOnline() {
40
+ console.log('[Fast Refresh] connected');
41
+ lastActivity = Date.now();
42
+ }
43
+ function handleMessage(event) {
44
+ lastActivity = Date.now();
45
+ for (let i = 0; i < listeners.length; i++) {
46
+ listeners[i](event);
47
+ }
48
+ }
49
+ function handleDisconnect() {
50
+ clearInterval(timer);
51
+ source.close();
52
+ setTimeout(init, types_1.hotMiddlewareOptions.timeout);
53
+ }
54
+ return {
55
+ addMessageListener(fn) {
56
+ listeners.push(fn);
57
+ },
58
+ };
59
+ }
60
+ function getEventSourceWrapper() {
61
+ if (!window.__whmEventSourceWrapper) {
62
+ window.__whmEventSourceWrapper = {};
63
+ }
64
+ if (!window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path]) {
65
+ // cache the wrapper for other entries loaded on
66
+ // the same page with the same hotMiddlewareOptions.path
67
+ window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path] =
68
+ eventSourceWrapper();
69
+ }
70
+ return window.__whmEventSourceWrapper[types_1.hotMiddlewareOptions.path];
71
+ }
72
+ function connect() {
73
+ getEventSourceWrapper().addMessageListener(handleMessage);
74
+ function handleMessage(event) {
75
+ if (event.data === '\uD83D\uDC93') {
76
+ return;
77
+ }
78
+ try {
79
+ processMessage(JSON.parse(event.data));
80
+ }
81
+ catch (ex) {
82
+ if (types_1.hotMiddlewareOptions.warn) {
83
+ console.warn('Invalid HMR message: ' + event.data + '\n' + ex);
84
+ }
85
+ }
86
+ }
87
+ }
88
+ // the reporter needs to be a singleton on the page
89
+ // in case the client is being used by multiple bundles
90
+ // we only want to report once.
91
+ // all the errors will go to all clients
92
+ const singletonKey = '__webpack_hot_middleware_reporter__';
93
+ let reporter;
94
+ if (typeof window !== 'undefined') {
95
+ if (!window[singletonKey]) {
96
+ window[singletonKey] = createReporter();
97
+ }
98
+ reporter = window[singletonKey];
99
+ }
100
+ function createReporter() {
101
+ const styles = {
102
+ errors: 'color: #ff0000;',
103
+ warnings: 'color: #999933;',
104
+ };
105
+ let previousProblems = null;
106
+ function log(type, obj) {
107
+ if (obj.action === 'building') {
108
+ console.log('[Fast Refresh] Building');
109
+ return;
110
+ }
111
+ const newProblems = obj[type]
112
+ .map((msg) => {
113
+ return (0, strip_ansi_1.stripAnsi)(msg);
114
+ })
115
+ .join('\n');
116
+ if (previousProblems === newProblems) {
117
+ return;
118
+ }
119
+ previousProblems = newProblems;
120
+ const style = styles[type];
121
+ const name = obj.name ? "'" + obj.name + "' " : '';
122
+ const title = '[Fast Refresh] bundle ' + name + 'has ' + obj[type].length + ' ' + type;
123
+ // NOTE: console.warn or console.error will print the stack trace
124
+ // which isn't helpful here, so using console.log to escape it.
125
+ if (console.group && console.groupEnd) {
126
+ console.group('%c' + title, style);
127
+ console.log('%c' + newProblems, style);
128
+ console.groupEnd();
129
+ }
130
+ else {
131
+ console.log('%c' + title + '\n\t%c' + newProblems.replace(/\n/g, '\n\t'), style + 'font-weight: bold;', style + 'font-weight: normal;');
132
+ }
133
+ }
134
+ return {
135
+ cleanProblemsCache() {
136
+ previousProblems = null;
137
+ },
138
+ problems(type, obj) {
139
+ if (types_1.hotMiddlewareOptions.warn) {
140
+ log(type, obj);
141
+ }
142
+ return true;
143
+ },
144
+ success: () => undefined,
145
+ };
146
+ }
147
+ let customHandler;
148
+ let subscribeAllHandler;
149
+ function processMessage(obj) {
150
+ switch (obj.action) {
151
+ case 'building':
152
+ console.log('[Fast refresh] bundle ' +
153
+ (obj.name ? "'" + obj.name + "' " : '') +
154
+ 'rebuilding');
155
+ break;
156
+ case 'built':
157
+ console.log('[Fast refresh] bundle ' +
158
+ (obj.name ? "'" + obj.name + "' " : '') +
159
+ 'rebuilt in ' +
160
+ obj.time +
161
+ 'ms');
162
+ // fall through
163
+ case 'sync': {
164
+ if (obj.name &&
165
+ types_1.hotMiddlewareOptions.name &&
166
+ obj.name !== types_1.hotMiddlewareOptions.name) {
167
+ return;
168
+ }
169
+ let applyUpdate = true;
170
+ if (obj.errors.length > 0) {
171
+ if (reporter)
172
+ reporter.problems('errors', obj);
173
+ applyUpdate = false;
174
+ }
175
+ else if (obj.warnings.length > 0) {
176
+ if (reporter) {
177
+ const overlayShown = reporter.problems('warnings', obj);
178
+ applyUpdate = overlayShown;
179
+ }
180
+ }
181
+ else if (reporter) {
182
+ reporter.cleanProblemsCache();
183
+ reporter.success();
184
+ }
185
+ if (applyUpdate) {
186
+ (0, process_update_1.processUpdate)(obj.hash, obj.modules, types_1.hotMiddlewareOptions);
187
+ }
188
+ break;
189
+ }
190
+ default:
191
+ if (customHandler) {
192
+ customHandler(obj);
193
+ }
194
+ }
195
+ if (subscribeAllHandler) {
196
+ subscribeAllHandler(obj);
197
+ }
198
+ }
199
+ module.exports = {
200
+ subscribeAll(handler) {
201
+ subscribeAllHandler = handler;
202
+ },
203
+ subscribe(handler) {
204
+ customHandler = handler;
205
+ },
206
+ setOptionsAndConnect,
207
+ };
208
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/hot-middleware/client.ts"],"names":[],"mappings":";;AAAA;;;;GAIG;AACH,qDAA+C;AAC/C,6CAAuC;AACvC,mCAAmE;AAEnE,IAAI,OAAO,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AO,CAAC;IACzB,CAAC;IACD,oBAAoB;CACpB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Source code is adapted from
3
+ * https://github.com/webpack-contrib/webpack-hot-middleware#readme
4
+ * and rewritten in TypeScript. This file is MIT licensed
5
+ */
6
+ import { Request, Response } from 'express';
7
+ import webpack from 'webpack';
8
+ import { HotMiddlewareMessage } from './types';
9
+ export declare const webpackHotMiddleware: (compiler: webpack.Compiler) => {
10
+ (req: Request, res: Response, next: () => void): void;
11
+ publish(payload: HotMiddlewareMessage): void;
12
+ close(): void;
13
+ };
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hot-middleware/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EACN,oBAAoB,EAKpB,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,oBAAoB,aAAc,QAAQ,QAAQ;UA0B5B,OAAO,OAAO,QAAQ,QAAQ,MAAM,IAAI;qBAUlC,oBAAoB;;CAe5D,CAAC"}