pulse-dashboard 1.2.7 → 1.3.0
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +63 -10
- package/.next/fallback-build-manifest.json +6 -3
- package/.next/images-manifest.json +1 -0
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +25 -13
- package/.next/required-server-files.json +69 -15
- package/.next/routes-manifest.json +1 -0
- package/.next/server/app/_global-error/page/build-manifest.json +13 -8
- package/.next/server/app/_global-error/page.js +9 -9
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +8 -2
- package/.next/server/app/_global-error.html +1 -2
- package/.next/server/app/_global-error.meta +19 -5
- package/.next/server/app/_global-error.rsc +17 -11
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +21 -4
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +2 -1
- package/.next/server/app/_not-found/page/build-manifest.json +13 -8
- package/.next/server/app/_not-found/page.js +13 -12
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +9 -2
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.meta +24 -6
- package/.next/server/app/_not-found.rsc +23 -18
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +28 -4
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -2
- package/.next/server/app/api/analyze-test/route/build-manifest.json +5 -4
- package/.next/server/app/api/analyze-test/route.js +4 -3
- package/.next/server/app/api/analyze-test/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze-test/route_client-reference-manifest.js +5 -2
- package/.next/server/app/api/assets/[...slug]/route/build-manifest.json +5 -4
- package/.next/server/app/api/assets/[...slug]/route.js +4 -4
- package/.next/server/app/api/assets/[...slug]/route.js.nft.json +1 -1
- package/.next/server/app/api/assets/[...slug]/route_client-reference-manifest.js +5 -2
- package/.next/server/app/api/current-run/route/build-manifest.json +5 -4
- package/.next/server/app/api/current-run/route.js +4 -3
- package/.next/server/app/api/current-run/route.js.nft.json +1 -1
- package/.next/server/app/api/current-run/route_client-reference-manifest.js +5 -2
- package/.next/server/app/api/historical-trends/route/build-manifest.json +5 -4
- package/.next/server/app/api/historical-trends/route/server-reference-manifest.json +32 -1
- package/.next/server/app/api/historical-trends/route.js +5 -4
- package/.next/server/app/api/historical-trends/route.js.nft.json +1 -1
- package/.next/server/app/api/historical-trends/route_client-reference-manifest.js +5 -2
- package/.next/server/app/api/report-config/route/build-manifest.json +5 -4
- package/.next/server/app/api/report-config/route.js +4 -3
- package/.next/server/app/api/report-config/route.js.nft.json +1 -1
- package/.next/server/app/api/report-config/route_client-reference-manifest.js +5 -2
- package/.next/server/app/api/reports/[filename]/route/build-manifest.json +5 -4
- package/.next/server/app/api/reports/[filename]/route.js +4 -3
- package/.next/server/app/api/reports/[filename]/route.js.nft.json +1 -1
- package/.next/server/app/api/reports/[filename]/route_client-reference-manifest.js +5 -2
- package/.next/server/app/api/run-command/route/build-manifest.json +5 -4
- package/.next/server/app/api/run-command/route.js +4 -3
- package/.next/server/app/api/run-command/route.js.nft.json +1 -1
- package/.next/server/app/api/run-command/route_client-reference-manifest.js +5 -2
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.meta +19 -5
- package/.next/server/app/index.rsc +26 -15
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +31 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +3 -2
- package/.next/server/app/page/build-manifest.json +13 -8
- package/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +3 -8
- package/.next/server/app/page.js +15 -14
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +9 -2
- package/.next/server/app/test/[testId]/page/build-manifest.json +13 -8
- package/.next/server/app/test/[testId]/page/server-reference-manifest.json +3 -8
- package/.next/server/app/test/[testId]/page.js +15 -14
- package/.next/server/app/test/[testId]/page.js.nft.json +1 -1
- package/.next/server/app/test/[testId]/page_client-reference-manifest.js +9 -2
- package/.next/server/chunks/[externals]__1bks6n1-hi3u2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__08mw5-21_l0y0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ainik_9ptfd4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0d2a-3_xzfq9t._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0k8r_2i_c7804._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ku061j3k9q9v._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1iga9nxrdvdxp._.js +63 -0
- package/.next/server/chunks/[root-of-the-server]__1l48ghhplu7u9._.js +3 -0
- package/.next/server/chunks/[turbopack]_runtime.js +474 -271
- package/.next/server/chunks/_021wero7wk5g-._.js +3 -0
- package/.next/server/chunks/_0f66qkfi1bpbn._.js +4 -0
- package/.next/server/chunks/_0omvyrynvgj4q._.js +3 -0
- package/.next/server/chunks/_0rj3uq83vare4._.js +3 -0
- package/.next/server/chunks/_1bftf09jweaep._.js +3 -0
- package/.next/server/chunks/_1e44q68l7kg3i._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_analyze-test_route_actions_mjs_0uo58g5gzd0uc._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_assets_[___slug]_route_actions_mjs_04b62p5ullv5v._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_current-run_route_actions_mjs_05xzsg3gk7k2q._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_report-config_route_actions_mjs_175cyh31s_2_h._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_reports_[filename]_route_actions_mjs_1803al6ouhkyr._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_run-command_route_actions_mjs_0o7ewtw5zp6ao._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__077mujmfcjrlq._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0954o-19g2le2._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0bqmj2mimgfp2._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0dv9b4zkg5hdn._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0ivd4vt5v8vsz._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__10tkfx-ofp61y._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__19zw3uu3ckhlo._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1hsaagmb2fvap._.js +14 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1i9r59yk4i69p._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1jljxgnhlm87p._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1ycj5t-2qcq3e._.js +3 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +474 -271
- package/.next/server/chunks/ssr/_0-a_-dy7ui975._.js +5 -0
- package/.next/server/chunks/ssr/_04dqze6ixrsvs._.js +4 -0
- package/.next/server/chunks/ssr/_0x914xxedzmgf._.js +32 -0
- package/.next/server/chunks/ssr/_1-bq-mvkidpbm._.js +27 -0
- package/.next/server/chunks/ssr/_1z0ejft8z3bqp._.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_mjs_1ctekssbjfw_g._.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_mjs_1ghl5fbynabiq._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0gxlxpuufujz9._.js +33 -0
- package/.next/server/chunks/ssr/node_modules_0mtji6mpjxw71._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a5szri_._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_1dylt_x2lwntt._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_1tvl46c87-b1a._.js +8 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0bew68i643j53._.js +33 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_1vdct3pkbqi_w._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_45780354.js → node_modules_next_dist_client_components_builtin_forbidden_0symwr9mbf-fh.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892nagajq.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_not-found_1vvgosrc2w28f.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_15817684.js → node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0xky89qu.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03a44q3-aihnz.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0k6_l1jr3jsqq.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0min3q4oeyf8a.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z4y02i7.js +3 -0
- package/.next/server/chunks/ssr/src_0aglj-npucwwk._.js +23 -0
- package/.next/server/chunks/ssr/src_components_ui_toaster_tsx_0ll6bbq4_t7m_._.js +3 -0
- package/.next/server/middleware-build-manifest.js +65 -13
- package/.next/server/prefetch-hints.json +34 -0
- package/.next/server/preview-props.json +5 -0
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +27 -19
- package/.next/static/5NYK4iijm2Nff3usU87JA/_clientMiddlewareManifest.js +1 -0
- package/.next/static/chunks/06u3fo34cc4ga.js +1 -0
- package/.next/static/chunks/07ceko_qv-n_d.js +1 -0
- package/.next/static/chunks/17tig9fuzy99m.js +1 -0
- package/.next/static/chunks/1axqivg23ezfb.js +1 -0
- package/.next/static/chunks/1e2nvb4q-3vse.js +1 -0
- package/.next/static/chunks/1ltrs9eixy8gu.js +3 -0
- package/.next/static/chunks/1n-k9_9iohc4w.js +1 -0
- package/.next/static/chunks/1oyrxi90x4jw8.js +31 -0
- package/.next/static/chunks/2510hisbrlwfi.js +1 -0
- package/.next/static/chunks/2viv-yky3p-jf.js +1 -0
- package/.next/static/chunks/3-ptszisyxsi8.js +5 -0
- package/.next/static/chunks/3f-g_qcegf3q4.js +22 -0
- package/.next/static/chunks/3j6vhmh5ev771.js +1 -0
- package/.next/static/chunks/3qtedoc85mjel.js +1 -0
- package/.next/static/chunks/3vfh62-53kqxb.css +1 -0
- package/.next/static/chunks/3vukeef84f3mg.js +1 -0
- package/.next/static/chunks/3z98c46ozxe__.js +1 -0
- package/.next/static/chunks/turbopack-2lihmh2pdnr2x.js +1 -0
- package/dist/components/pulse-dashboard/DashboardOverviewCharts.jsx +16 -16
- package/dist/components/pulse-dashboard/DashboardOverviewCharts.jsx.map +1 -1
- package/dist/components/pulse-dashboard/FailureCategorizationView.jsx +5 -5
- package/dist/components/pulse-dashboard/FailureCategorizationView.jsx.map +1 -1
- package/dist/components/pulse-dashboard/FlakyTestsWidget.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/FlakyTestsWidget.jsx +44 -38
- package/dist/components/pulse-dashboard/FlakyTestsWidget.jsx.map +1 -1
- package/dist/components/pulse-dashboard/LiveTestResults.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/LiveTestResults.jsx +32 -24
- package/dist/components/pulse-dashboard/LiveTestResults.jsx.map +1 -1
- package/dist/components/pulse-dashboard/PulseCommandView.jsx +3 -3
- package/dist/components/pulse-dashboard/PulseCommandView.jsx.map +1 -1
- package/dist/components/pulse-dashboard/PulseDashboard.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/PulseDashboard.jsx +1 -2
- package/dist/components/pulse-dashboard/PulseDashboard.jsx.map +1 -1
- package/dist/components/pulse-dashboard/SettingsView.jsx +2 -2
- package/dist/components/pulse-dashboard/SettingsView.jsx.map +1 -1
- package/dist/components/pulse-dashboard/SummaryMetrics.jsx +7 -7
- package/dist/components/pulse-dashboard/SummaryMetrics.jsx.map +1 -1
- package/dist/components/pulse-dashboard/SystemInformationWidget.jsx +1 -1
- package/dist/components/pulse-dashboard/SystemInformationWidget.jsx.map +1 -1
- package/dist/components/pulse-dashboard/TestDetailsClientPage.d.ts.map +1 -1
- package/dist/components/pulse-dashboard/TestDetailsClientPage.jsx +105 -75
- package/dist/components/pulse-dashboard/TestDetailsClientPage.jsx.map +1 -1
- package/dist/components/pulse-dashboard/TestItem.jsx +8 -8
- package/dist/components/pulse-dashboard/TestItem.jsx.map +1 -1
- package/dist/components/pulse-dashboard/TestStepItemRecursive.jsx +3 -3
- package/dist/components/pulse-dashboard/TrendAnalysis.jsx +11 -11
- package/dist/components/pulse-dashboard/TrendAnalysis.jsx.map +1 -1
- package/dist/components/ui/alert.jsx +1 -1
- package/dist/components/ui/alert.jsx.map +1 -1
- package/dist/components/ui/button.jsx +3 -3
- package/dist/components/ui/card.jsx +1 -1
- package/dist/components/ui/card.jsx.map +1 -1
- package/dist/components/ui/tabs.jsx +2 -2
- package/dist/components/ui/tabs.jsx.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +12 -7
- package/.next/server/app/_global-error.segments/_full.segment.rsc +0 -12
- package/.next/server/app/_global-error.segments/_head.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_index.segment.rsc +0 -4
- package/.next/server/app/_not-found.segments/_full.segment.rsc +0 -20
- package/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
- package/.next/server/app/_not-found.segments/_index.segment.rsc +0 -7
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -4
- package/.next/server/app/index.segments/_full.segment.rsc +0 -17
- package/.next/server/app/index.segments/_head.segment.rsc +0 -6
- package/.next/server/app/index.segments/_index.segment.rsc +0 -7
- package/.next/server/chunks/[externals]__858b6c42._.js +0 -3
- package/.next/server/chunks/[externals]__f52e4eb0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__06c6346e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__42738744._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7113a113._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__71e0e3b9._.js +0 -21
- package/.next/server/chunks/[root-of-the-server]__74bb0547._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__c159e29b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__d7fdaf5c._.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_analyze-test_route_actions_e71f7d12.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_assets_[___slug]_route_actions_a10bfa98.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_current-run_route_actions_ed7eca66.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_historical-trends_route_actions_ab165c16.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_report-config_route_actions_7f74a29f.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_reports_[filename]_route_actions_54bb3323.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_run-command_route_actions_b3861930.js +0 -3
- package/.next/server/chunks/node_modules_next_dist_25e30e9d._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__15600e29._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__22ecdfea._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__4a382b8f._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__71dd9d42._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__77c90d39._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__84313e76._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__aed7e4d8._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__b3b1f5eb._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__b9356576._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__c507bbfe._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__c829c7d1._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__efd22fba._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__f682065b._.js +0 -3
- package/.next/server/chunks/ssr/_134010c8._.js +0 -3
- package/.next/server/chunks/ssr/_42495f68._.js +0 -7
- package/.next/server/chunks/ssr/_7bd96dfb._.js +0 -4
- package/.next/server/chunks/ssr/_8521b44e._.js +0 -5
- package/.next/server/chunks/ssr/_97aa43fe._.js +0 -6
- package/.next/server/chunks/ssr/_c1309523._.js +0 -4
- package/.next/server/chunks/ssr/_ed1fd268._.js +0 -5
- package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_75761787.js +0 -3
- package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_554ec2bf.js +0 -3
- package/.next/server/chunks/ssr/node_modules_entities_lib_maps_6c3ea140._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_f76a24fb._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js +0 -4
- package/.next/server/chunks/ssr/node_modules_next_dist_174ae28d._.js +0 -10
- package/.next/server/chunks/ssr/node_modules_next_dist_4b63a0e1._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_9774470f._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_65a7265e.js +0 -4
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_eedfc1fd._.js +0 -6
- package/.next/server/chunks/ssr/src_ce5be59b._.js +0 -23
- package/.next/server/chunks/ssr/src_components_ui_toaster_tsx_475f3ca1._.js +0 -3
- package/.next/static/chunks/4acc398e96387f8f.js +0 -1
- package/.next/static/chunks/4e6c102ba15cb8f3.js +0 -1
- package/.next/static/chunks/52a0548698d96d34.js +0 -1
- package/.next/static/chunks/550f12513ad3d3f5.js +0 -1
- package/.next/static/chunks/57a4e405cd49f084.js +0 -1
- package/.next/static/chunks/61cc43b3d7ad2990.js +0 -1
- package/.next/static/chunks/6b48616ac349ee78.js +0 -1
- package/.next/static/chunks/7d11f12dde2f0803.js +0 -3
- package/.next/static/chunks/a6bf5da24e4e4780.js +0 -2
- package/.next/static/chunks/aee6c7720838f8a2.js +0 -1
- package/.next/static/chunks/b2baab7e78ca16b2.js +0 -1
- package/.next/static/chunks/bbc54cf19103bcba.js +0 -5
- package/.next/static/chunks/c059c9ec2d096e23.css +0 -1
- package/.next/static/chunks/c593fbb06045d009.js +0 -1
- package/.next/static/chunks/f091501564eb2ea3.js +0 -4
- package/.next/static/chunks/f0dbf61c632d4a51.js +0 -1
- package/.next/static/chunks/f4aa6f394526ed88.js +0 -3
- package/.next/static/chunks/fa82d7dec6790f39.js +0 -1
- package/.next/static/chunks/ff1a16fafef87110.js +0 -1
- package/.next/static/chunks/turbopack-80629672101bb6b8.js +0 -4
- package/.next/static/qMIxqotvwHfyIWhQnz8JW/_clientMiddlewareManifest.json +0 -1
- /package/.next/static/{qMIxqotvwHfyIWhQnz8JW → 5NYK4iijm2Nff3usU87JA}/_buildManifest.js +0 -0
- /package/.next/static/{qMIxqotvwHfyIWhQnz8JW → 5NYK4iijm2Nff3usU87JA}/_ssgManifest.js +0 -0
- /package/.next/static/chunks/{a6dad97d9634a72d.js → 0cz1d0mv5g_q7.js} +0 -0
|
@@ -1,12 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var RUNTIME_PUBLIC_PATH = "server/chunks/ssr/[turbopack]_runtime.js";
|
|
2
|
+
var RELATIVE_ROOT_PATH = "..";
|
|
3
|
+
var ASSET_PREFIX = "/_next/";
|
|
4
|
+
// Apply forwarded globals from workerData if running in a worker thread
|
|
5
|
+
if (typeof require !== 'undefined') {
|
|
6
|
+
try {
|
|
7
|
+
var { workerData } = require('worker_threads');
|
|
8
|
+
if (workerData?.__turbopack_globals__) {
|
|
9
|
+
Object.assign(globalThis, workerData.__turbopack_globals__);
|
|
10
|
+
// Remove internal data so it's not visible to user code
|
|
11
|
+
delete workerData.__turbopack_globals__;
|
|
12
|
+
}
|
|
13
|
+
} catch (_) {
|
|
14
|
+
// Not in a worker thread context, ignore
|
|
15
|
+
}
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* This file contains runtime types and functions that are shared between all
|
|
6
19
|
* TurboPack ECMAScript runtimes.
|
|
7
20
|
*
|
|
8
21
|
* It will be prepended to the runtime code of each runtime.
|
|
9
22
|
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-types.d.ts" />
|
|
23
|
+
/// <reference path="./async-module.ts" />
|
|
24
|
+
/**
|
|
25
|
+
* Describes why a module was instantiated.
|
|
26
|
+
* Shared between browser and Node.js runtimes.
|
|
27
|
+
*/ var SourceType = /*#__PURE__*/ function(SourceType) {
|
|
28
|
+
/**
|
|
29
|
+
* The module was instantiated because it was included in an evaluated chunk's
|
|
30
|
+
* runtime.
|
|
31
|
+
* SourceData is a ChunkPath.
|
|
32
|
+
*/ SourceType[SourceType["Runtime"] = 0] = "Runtime";
|
|
33
|
+
/**
|
|
34
|
+
* The module was instantiated because a parent module imported it.
|
|
35
|
+
* SourceData is a ModuleId.
|
|
36
|
+
*/ SourceType[SourceType["Parent"] = 1] = "Parent";
|
|
37
|
+
/**
|
|
38
|
+
* The module was instantiated because it was included in a chunk's hot module
|
|
39
|
+
* update.
|
|
40
|
+
* SourceData is an array of ModuleIds or undefined.
|
|
41
|
+
*/ SourceType[SourceType["Update"] = 2] = "Update";
|
|
42
|
+
return SourceType;
|
|
43
|
+
}(SourceType || {});
|
|
44
|
+
/**
|
|
45
|
+
* Flag indicating which module object type to create when a module is merged. Set to `true`
|
|
46
|
+
* by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,
|
|
47
|
+
* nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it
|
|
48
|
+
* uses plain Module objects.
|
|
49
|
+
*/ let createModuleWithDirectionFlag = false;
|
|
50
|
+
/**
|
|
51
|
+
* Maps module IDs to the factory functions that instantiate them.
|
|
52
|
+
*/ const moduleFactories = new Map();
|
|
10
53
|
const REEXPORTED_OBJECTS = new WeakMap();
|
|
11
54
|
/**
|
|
12
55
|
* Constructs the `__turbopack_context__` object for a module.
|
|
@@ -22,18 +65,32 @@ const REEXPORTED_OBJECTS = new WeakMap();
|
|
|
22
65
|
this.e = exports;
|
|
23
66
|
}
|
|
24
67
|
const contextPrototype = Context.prototype;
|
|
68
|
+
contextPrototype.M = moduleFactories;
|
|
25
69
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
26
70
|
const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag;
|
|
27
71
|
function defineProp(obj, name, options) {
|
|
28
72
|
if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options);
|
|
29
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the cached module for `id`, or `undefined` if it has not been
|
|
76
|
+
* instantiated yet. Rethrows the error if the module's factory threw.
|
|
77
|
+
*/ function getCachedModule(moduleCache, id) {
|
|
78
|
+
const module = moduleCache.get(id);
|
|
79
|
+
if (module?.error) {
|
|
80
|
+
throw module.error;
|
|
81
|
+
}
|
|
82
|
+
return module;
|
|
83
|
+
}
|
|
30
84
|
function getOverwrittenModule(moduleCache, id) {
|
|
31
|
-
let module = moduleCache
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
85
|
+
let module = moduleCache.get(id);
|
|
86
|
+
if (module === undefined) {
|
|
87
|
+
if (createModuleWithDirectionFlag) {
|
|
88
|
+
// set in development modes for hmr support
|
|
89
|
+
module = createModuleWithDirection(id);
|
|
90
|
+
} else {
|
|
91
|
+
module = createModuleObject(id);
|
|
92
|
+
}
|
|
93
|
+
moduleCache.set(id, module);
|
|
37
94
|
}
|
|
38
95
|
return module;
|
|
39
96
|
}
|
|
@@ -47,10 +104,23 @@ function getOverwrittenModule(moduleCache, id) {
|
|
|
47
104
|
namespaceObject: undefined
|
|
48
105
|
};
|
|
49
106
|
}
|
|
107
|
+
function createModuleWithDirection(id) {
|
|
108
|
+
return {
|
|
109
|
+
exports: {},
|
|
110
|
+
error: undefined,
|
|
111
|
+
id,
|
|
112
|
+
namespaceObject: undefined,
|
|
113
|
+
parents: [],
|
|
114
|
+
children: []
|
|
115
|
+
};
|
|
116
|
+
}
|
|
50
117
|
const BindingTag_Value = 0;
|
|
118
|
+
/**
|
|
119
|
+
* Terminates a module's group of entries in an {@link EsmReexports} list.
|
|
120
|
+
*/ const REEXPORT_GROUP_END = 0;
|
|
51
121
|
/**
|
|
52
122
|
* Adds the getters to the exports object.
|
|
53
|
-
*/ function esm(exports, bindings) {
|
|
123
|
+
*/ function esm(exports, bindings, dynamic) {
|
|
54
124
|
defineProp(exports, '__esModule', {
|
|
55
125
|
value: true
|
|
56
126
|
});
|
|
@@ -88,11 +158,18 @@ const BindingTag_Value = 0;
|
|
|
88
158
|
}
|
|
89
159
|
}
|
|
90
160
|
}
|
|
91
|
-
|
|
161
|
+
// The properties defined above are already non-configurable and
|
|
162
|
+
// non-writable, so the namespace's existing exports are effectively
|
|
163
|
+
// immutable. Sealing additionally makes the object non-extensible, matching
|
|
164
|
+
// real ESM-namespace semantics. Modules with dynamic re-exports
|
|
165
|
+
// (`export *` from a CommonJS module) must stay extensible so the dynamic
|
|
166
|
+
// export proxy can surface keys discovered at runtime, so skip the seal for
|
|
167
|
+
// them.
|
|
168
|
+
if (!dynamic) Object.seal(exports);
|
|
92
169
|
}
|
|
93
170
|
/**
|
|
94
171
|
* Makes the module an ESM with exports
|
|
95
|
-
*/ function esmExport(bindings, id) {
|
|
172
|
+
*/ function esmExport(bindings, id, dynamic) {
|
|
96
173
|
let module;
|
|
97
174
|
let exports;
|
|
98
175
|
if (id != null) {
|
|
@@ -103,24 +180,182 @@ const BindingTag_Value = 0;
|
|
|
103
180
|
exports = this.e;
|
|
104
181
|
}
|
|
105
182
|
module.namespaceObject = exports;
|
|
106
|
-
esm(exports, bindings);
|
|
183
|
+
esm(exports, bindings, dynamic);
|
|
107
184
|
}
|
|
108
185
|
contextPrototype.s = esmExport;
|
|
186
|
+
/**
|
|
187
|
+
* Registers re-exports that all forward to properties of other modules.
|
|
188
|
+
*
|
|
189
|
+
* This is a compact spelling of the pattern
|
|
190
|
+
*
|
|
191
|
+
* ```js
|
|
192
|
+
* var ns = context.i(moduleId)
|
|
193
|
+
* context.s([exportName, () => ns[importedName], ...])
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* The list is a flat sequence of groups. Each group starts with the source the exports come from,
|
|
197
|
+
* followed by that group's entries, and is terminated by the `0` sentinel (or the end of the list).
|
|
198
|
+
*
|
|
199
|
+
* The group head is either a **module id**, which is instantiated here:
|
|
200
|
+
*
|
|
201
|
+
* ```js
|
|
202
|
+
* context.S([
|
|
203
|
+
* 76061, 'default', 'f', 'named', 'A', 0,
|
|
204
|
+
* 29842, 'otherModule', 'f',
|
|
205
|
+
* ])
|
|
206
|
+
* ```
|
|
207
|
+
*
|
|
208
|
+
* or the **namespace value** of a module that has already been imported, which is used directly:
|
|
209
|
+
*
|
|
210
|
+
* ```js
|
|
211
|
+
* var ns1 = context.i(76061)
|
|
212
|
+
* context.S([ns1, 'default', 'f', 'named', 'A'])
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* The producer picks the namespace form when it has generated the import anyway -- because some
|
|
216
|
+
* later import must not be reordered past it -- so nothing is instantiated twice. The two are told
|
|
217
|
+
* apart by type: a module id is always a string or number. A CommonJS function export produces a
|
|
218
|
+
* callable namespace value, so namespace heads can be functions as well as objects.
|
|
219
|
+
*
|
|
220
|
+
* Entries are `exportName, importedName` pairs, except when a group holds exactly one string. That
|
|
221
|
+
* string is then a comma-joined list of the same pairs, which saves the repeated quoting:
|
|
222
|
+
*
|
|
223
|
+
* ```js
|
|
224
|
+
* context.S([
|
|
225
|
+
* 76061, 'default,f,named,A', 0,
|
|
226
|
+
* 29842, 'otherModule,f',
|
|
227
|
+
* ])
|
|
228
|
+
* ```
|
|
229
|
+
*
|
|
230
|
+
* The producer picks that spelling independently for each group whose names contain no commas,
|
|
231
|
+
* since that group's names are recovered by splitting on them.
|
|
232
|
+
*
|
|
233
|
+
* Groups whose head is a module id are instantiated in list order, at the point where the call
|
|
234
|
+
* appears, so the producer must not merge such a group across an import of another module. The
|
|
235
|
+
* destination reuses a source data value or getter descriptor when one exists, falling back to a
|
|
236
|
+
* wrapper getter for dynamic/proxy/inherited properties.
|
|
237
|
+
*
|
|
238
|
+
* `id` names the module the exports belong to when this module was merged into a scope-hoisting
|
|
239
|
+
* group, exactly as it does for {@link EsmExport}.
|
|
240
|
+
*
|
|
241
|
+
* Only the source descriptor's payload (value or getter) is reused. {@link esm} still defines a
|
|
242
|
+
* fresh enumerable, non-configurable destination property, and no source setter is ever forwarded.
|
|
243
|
+
*/ function esmReexport(list, id) {
|
|
244
|
+
const bindings = [];
|
|
245
|
+
let i = 0;
|
|
246
|
+
while(i < list.length){
|
|
247
|
+
const head = list[i++];
|
|
248
|
+
const start = i;
|
|
249
|
+
while(i < list.length && list[i] !== REEXPORT_GROUP_END)i++;
|
|
250
|
+
const end = i;
|
|
251
|
+
// Skip the sentinel, if this group was terminated by one rather than by the end of the list.
|
|
252
|
+
i++;
|
|
253
|
+
// Module ids are always strings or numbers. Other values are already-imported namespaces;
|
|
254
|
+
// notably, interop with a CommonJS function export produces a callable namespace function.
|
|
255
|
+
// `esmImport` may return a promise for an async module, but re-exports of async modules keep
|
|
256
|
+
// going through `context.s`, so the producer never routes them here and this stays synchronous.
|
|
257
|
+
const namespace = typeof head === 'string' || typeof head === 'number' ? esmImport.call(this, head) : head;
|
|
258
|
+
if (end - start === 1) {
|
|
259
|
+
const pairs = list[start].split(',');
|
|
260
|
+
for(let j = 0; j < pairs.length; j += 2){
|
|
261
|
+
appendReexportBinding(bindings, pairs[j], namespace, pairs[j + 1]);
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
for(let j = start; j < end; j += 2){
|
|
265
|
+
appendReexportBinding(bindings, list[j], namespace, list[j + 1]);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
esmExport.call(this, bindings, id);
|
|
270
|
+
}
|
|
271
|
+
contextPrototype.S = esmReexport;
|
|
272
|
+
function appendReexportBinding(bindings, exportedName, namespace, importedName) {
|
|
273
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(namespace, importedName);
|
|
274
|
+
if (descriptor) {
|
|
275
|
+
if ('value' in descriptor) {
|
|
276
|
+
// Code generation only routes immutable imported bindings through this helper, so a data
|
|
277
|
+
// descriptor is a constant export and can be captured once.
|
|
278
|
+
bindings.push(exportedName, BindingTag_Value, descriptor.value);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (descriptor.get) {
|
|
282
|
+
// Accessors remain live by reusing the source getter. `esmReexport` is only called by
|
|
283
|
+
// generated code: every group head is either produced by
|
|
284
|
+
// `this.i` or is the namespace variable from a generated `this.i` call. Every getter on such
|
|
285
|
+
// a namespace is receiver-independent: ESM bindings are compiler-generated arrow functions,
|
|
286
|
+
// and the CommonJS/dynamic-namespace paths create arrows in `createGetter` and
|
|
287
|
+
// `getOwnPropertyDescriptor`. The destination can therefore reuse the exact function instead
|
|
288
|
+
// of allocating another wrapper getter.
|
|
289
|
+
bindings.push(exportedName, descriptor.get);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// Dynamic/proxy/inherited CommonJS edge cases may not expose a usable own descriptor.
|
|
294
|
+
bindings.push(exportedName, ()=>namespace[importedName]);
|
|
295
|
+
}
|
|
109
296
|
function ensureDynamicExports(module, exports) {
|
|
110
297
|
let reexportedObjects = REEXPORTED_OBJECTS.get(module);
|
|
111
298
|
if (!reexportedObjects) {
|
|
112
299
|
REEXPORTED_OBJECTS.set(module, reexportedObjects = []);
|
|
300
|
+
// Returns the re-exported object that provides `prop` as an own property,
|
|
301
|
+
// or `undefined` if none does. The traps share this logic so they always
|
|
302
|
+
// agree on which keys are synthesized from `reexportedObjects`. `default`
|
|
303
|
+
// is never re-exported by `export *`, so it is never synthesized.
|
|
304
|
+
const reexportOwning = (prop)=>{
|
|
305
|
+
if (prop !== 'default') {
|
|
306
|
+
for (const obj of reexportedObjects){
|
|
307
|
+
if (hasOwnProperty.call(obj, prop)) return obj;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return undefined;
|
|
311
|
+
};
|
|
312
|
+
// Modules with dynamic re-exports are not sealed by `esm()`, so the
|
|
313
|
+
// target beneath the namespace stays extensible. That is what lets the
|
|
314
|
+
// `ownKeys` and `getOwnPropertyDescriptor` traps legally report keys that
|
|
315
|
+
// exist on `reexportedObjects` but not on the target itself.
|
|
113
316
|
module.exports = module.namespaceObject = new Proxy(exports, {
|
|
114
317
|
get (target, prop) {
|
|
115
318
|
if (hasOwnProperty.call(target, prop) || prop === 'default' || prop === '__esModule') {
|
|
116
319
|
return Reflect.get(target, prop);
|
|
117
320
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (value !== undefined) return value;
|
|
121
|
-
}
|
|
122
|
-
return undefined;
|
|
321
|
+
const obj = reexportOwning(prop);
|
|
322
|
+
return obj && Reflect.get(obj, prop);
|
|
123
323
|
},
|
|
324
|
+
// The namespace is read-only, like a real esm namespace object. The
|
|
325
|
+
// re-exported modules can still mutate their own exports (exposed live
|
|
326
|
+
// via `get`), but mutating the namespace itself is rejected. Refusing
|
|
327
|
+
// here, rather than forwarding to the extensible target, also prevents an
|
|
328
|
+
// assignment/definition from shadowing a dynamic re-export. It also
|
|
329
|
+
// prevents delete from removing a static export.
|
|
330
|
+
set () {
|
|
331
|
+
return false;
|
|
332
|
+
},
|
|
333
|
+
defineProperty () {
|
|
334
|
+
return false;
|
|
335
|
+
},
|
|
336
|
+
deleteProperty () {
|
|
337
|
+
return false;
|
|
338
|
+
},
|
|
339
|
+
// The `has` trap ensures that `'exportName' in starImports` will reflect
|
|
340
|
+
// the truth of whether a key is exported.
|
|
341
|
+
has (target, prop) {
|
|
342
|
+
if (Reflect.has(target, prop)) return true;
|
|
343
|
+
if (prop === 'default' || prop === '__esModule') return false;
|
|
344
|
+
return reexportOwning(prop) !== undefined;
|
|
345
|
+
},
|
|
346
|
+
// ownKeys and getOwnPropertyDescriptor together make the keys enumerable.
|
|
347
|
+
// If a value is returned from `ownKeys` but its property descriptor is
|
|
348
|
+
// not enumerable, it will not be visible to iterator methods.
|
|
349
|
+
// Collectively, they allow code like the following:
|
|
350
|
+
//
|
|
351
|
+
// ```
|
|
352
|
+
// // module.js re-exports dynamic CJS exports
|
|
353
|
+
// export * from './legacyModule.cjs'
|
|
354
|
+
//
|
|
355
|
+
// // from another JS file, reference the re-exported dynamic values
|
|
356
|
+
// import * as Namespace from './module.js'
|
|
357
|
+
// Object.keys(Namespace)
|
|
358
|
+
// ```
|
|
124
359
|
ownKeys (target) {
|
|
125
360
|
const keys = Reflect.ownKeys(target);
|
|
126
361
|
for (const obj of reexportedObjects){
|
|
@@ -129,6 +364,22 @@ function ensureDynamicExports(module, exports) {
|
|
|
129
364
|
}
|
|
130
365
|
}
|
|
131
366
|
return keys;
|
|
367
|
+
},
|
|
368
|
+
getOwnPropertyDescriptor (target, prop) {
|
|
369
|
+
const own = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
370
|
+
if (own || prop === 'default' || prop === '__esModule') return own;
|
|
371
|
+
const obj = reexportOwning(prop);
|
|
372
|
+
if (obj) {
|
|
373
|
+
// Synthetic keys don't exist on the target, so they MUST be
|
|
374
|
+
// reported as configurable. However the set/delete traps above will
|
|
375
|
+
// prevent them from actually being changed
|
|
376
|
+
return {
|
|
377
|
+
enumerable: true,
|
|
378
|
+
configurable: true,
|
|
379
|
+
get: ()=>Reflect.get(obj, prop)
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
return undefined;
|
|
132
383
|
}
|
|
133
384
|
});
|
|
134
385
|
}
|
|
@@ -234,7 +485,7 @@ function esmImport(id) {
|
|
|
234
485
|
}
|
|
235
486
|
contextPrototype.i = esmImport;
|
|
236
487
|
function asyncLoader(moduleId) {
|
|
237
|
-
const loader = this.
|
|
488
|
+
const loader = getOrInstantiateModuleFromParent(moduleId, this.m).exports;
|
|
238
489
|
return loader(esmImport.bind(this));
|
|
239
490
|
}
|
|
240
491
|
contextPrototype.A = asyncLoader;
|
|
@@ -270,7 +521,39 @@ contextPrototype.r = commonJsRequire;
|
|
|
270
521
|
}
|
|
271
522
|
/**
|
|
272
523
|
* `require.context` and require/import expression runtime.
|
|
273
|
-
*/ function
|
|
524
|
+
*/ function moduleContextFactory(ids, mode = 0) {
|
|
525
|
+
const context = this;
|
|
526
|
+
const parentModule = this.m;
|
|
527
|
+
const map = {};
|
|
528
|
+
for(let i = 0; i < ids.length; i += 2){
|
|
529
|
+
const entry = ids[i + 1];
|
|
530
|
+
let id;
|
|
531
|
+
let module;
|
|
532
|
+
if (typeof entry === 'function') {
|
|
533
|
+
// A function is given for a module without an id to load it by: mostly a
|
|
534
|
+
// request that throws an error (e.g. one that can't be resolved), and also an
|
|
535
|
+
// external. As there is no id, `resolve` calls the function too, so that it
|
|
536
|
+
// throws the same error.
|
|
537
|
+
id = module = entry;
|
|
538
|
+
} else {
|
|
539
|
+
id = ()=>entry;
|
|
540
|
+
if (mode === 0) {
|
|
541
|
+
// inlined require implementation, which gives an ignored module empty exports
|
|
542
|
+
module = ()=>entry === undefined ? {} : getOrInstantiateModuleFromParent(entry, parentModule).exports;
|
|
543
|
+
} else if (entry === undefined) {
|
|
544
|
+
module = ()=>Promise.resolve({});
|
|
545
|
+
} else if (mode === 1) {
|
|
546
|
+
// Like `import()`, the module is evaluated asynchronously.
|
|
547
|
+
module = ()=>Promise.resolve().then(()=>esmImport.call(context, entry));
|
|
548
|
+
} else {
|
|
549
|
+
module = ()=>asyncLoader.call(context, entry);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
map[ids[i]] = {
|
|
553
|
+
id,
|
|
554
|
+
module
|
|
555
|
+
};
|
|
556
|
+
}
|
|
274
557
|
function moduleContext(id) {
|
|
275
558
|
id = parseRequest(id);
|
|
276
559
|
if (hasOwnProperty.call(map, id)) {
|
|
@@ -297,41 +580,23 @@ contextPrototype.r = commonJsRequire;
|
|
|
297
580
|
};
|
|
298
581
|
return moduleContext;
|
|
299
582
|
}
|
|
300
|
-
contextPrototype.f =
|
|
583
|
+
contextPrototype.f = moduleContextFactory;
|
|
301
584
|
/**
|
|
302
585
|
* Returns the path of a chunk defined by its data.
|
|
303
586
|
*/ function getChunkPath(chunkData) {
|
|
304
587
|
return typeof chunkData === 'string' ? chunkData : chunkData.path;
|
|
305
588
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
function
|
|
310
|
-
return turbopackQueues in obj;
|
|
311
|
-
}
|
|
312
|
-
function createPromise() {
|
|
313
|
-
let resolve;
|
|
314
|
-
let reject;
|
|
315
|
-
const promise = new Promise((res, rej)=>{
|
|
316
|
-
reject = rej;
|
|
317
|
-
resolve = res;
|
|
318
|
-
});
|
|
319
|
-
return {
|
|
320
|
-
promise,
|
|
321
|
-
resolve: resolve,
|
|
322
|
-
reject: reject
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.
|
|
326
|
-
// The CompressedModuleFactories format is
|
|
327
|
-
// - 1 or more module ids
|
|
328
|
-
// - a module factory function
|
|
329
|
-
// So walking this is a little complex but the flat structure is also fast to
|
|
330
|
-
// traverse, we can use `typeof` operators to distinguish the two cases.
|
|
331
|
-
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
|
|
589
|
+
// Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
|
|
590
|
+
// The flat format alternates one or more module IDs with their factory function.
|
|
591
|
+
// Strict factories can be prepended as a nested array.
|
|
592
|
+
function installCompressedModuleFactories(chunkModules, offset, newModuleId) {
|
|
332
593
|
let i = offset;
|
|
594
|
+
const strictFactories = chunkModules[i];
|
|
595
|
+
if (Array.isArray(strictFactories)) {
|
|
596
|
+
installCompressedModuleFactories(strictFactories, 0, newModuleId);
|
|
597
|
+
i++;
|
|
598
|
+
}
|
|
333
599
|
while(i < chunkModules.length){
|
|
334
|
-
let moduleId = chunkModules[i];
|
|
335
600
|
let end = i + 1;
|
|
336
601
|
// Find our factory function
|
|
337
602
|
while(end < chunkModules.length && typeof chunkModules[end] !== 'function'){
|
|
@@ -340,124 +605,38 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories,
|
|
|
340
605
|
if (end === chunkModules.length) {
|
|
341
606
|
throw new Error('malformed chunk format, expected a factory function');
|
|
342
607
|
}
|
|
343
|
-
//
|
|
344
|
-
//
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
// everything below is adapted from webpack
|
|
358
|
-
// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13
|
|
359
|
-
const turbopackQueues = Symbol('turbopack queues');
|
|
360
|
-
const turbopackExports = Symbol('turbopack exports');
|
|
361
|
-
const turbopackError = Symbol('turbopack error');
|
|
362
|
-
function resolveQueue(queue) {
|
|
363
|
-
if (queue && queue.status !== 1) {
|
|
364
|
-
queue.status = 1;
|
|
365
|
-
queue.forEach((fn)=>fn.queueCount--);
|
|
366
|
-
queue.forEach((fn)=>fn.queueCount-- ? fn.queueCount++ : fn());
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
function wrapDeps(deps) {
|
|
370
|
-
return deps.map((dep)=>{
|
|
371
|
-
if (dep !== null && typeof dep === 'object') {
|
|
372
|
-
if (isAsyncModuleExt(dep)) return dep;
|
|
373
|
-
if (isPromise(dep)) {
|
|
374
|
-
const queue = Object.assign([], {
|
|
375
|
-
status: 0
|
|
376
|
-
});
|
|
377
|
-
const obj = {
|
|
378
|
-
[turbopackExports]: {},
|
|
379
|
-
[turbopackQueues]: (fn)=>fn(queue)
|
|
380
|
-
};
|
|
381
|
-
dep.then((res)=>{
|
|
382
|
-
obj[turbopackExports] = res;
|
|
383
|
-
resolveQueue(queue);
|
|
384
|
-
}, (err)=>{
|
|
385
|
-
obj[turbopackError] = err;
|
|
386
|
-
resolveQueue(queue);
|
|
387
|
-
});
|
|
388
|
-
return obj;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
return {
|
|
392
|
-
[turbopackExports]: dep,
|
|
393
|
-
[turbopackQueues]: ()=>{}
|
|
394
|
-
};
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
function asyncModule(body, hasAwait) {
|
|
398
|
-
const module = this.m;
|
|
399
|
-
const queue = hasAwait ? Object.assign([], {
|
|
400
|
-
status: -1
|
|
401
|
-
}) : undefined;
|
|
402
|
-
const depQueues = new Set();
|
|
403
|
-
const { resolve, reject, promise: rawPromise } = createPromise();
|
|
404
|
-
const promise = Object.assign(rawPromise, {
|
|
405
|
-
[turbopackExports]: module.exports,
|
|
406
|
-
[turbopackQueues]: (fn)=>{
|
|
407
|
-
queue && fn(queue);
|
|
408
|
-
depQueues.forEach(fn);
|
|
409
|
-
promise['catch'](()=>{});
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
const attributes = {
|
|
413
|
-
get () {
|
|
414
|
-
return promise;
|
|
415
|
-
},
|
|
416
|
-
set (v) {
|
|
417
|
-
// Calling `esmExport` leads to this.
|
|
418
|
-
if (v !== promise) {
|
|
419
|
-
promise[turbopackExports] = v;
|
|
608
|
+
// Install the factory for each module ID that doesn't already have one.
|
|
609
|
+
// When some IDs in this group already have a factory, reuse that existing
|
|
610
|
+
// group factory for the missing IDs to keep all IDs in the group consistent.
|
|
611
|
+
// Otherwise, install the factory from this chunk.
|
|
612
|
+
const moduleFactoryFn = chunkModules[end];
|
|
613
|
+
let existingGroupFactory = undefined;
|
|
614
|
+
for(let j = i; j < end; j++){
|
|
615
|
+
const id = chunkModules[j];
|
|
616
|
+
const existingFactory = moduleFactories.get(id);
|
|
617
|
+
if (existingFactory) {
|
|
618
|
+
existingGroupFactory = existingFactory;
|
|
619
|
+
break;
|
|
420
620
|
}
|
|
421
621
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
const fn = Object.assign(()=>resolve(getResult), {
|
|
433
|
-
queueCount: 0
|
|
434
|
-
});
|
|
435
|
-
function fnQueue(q) {
|
|
436
|
-
if (q !== queue && !depQueues.has(q)) {
|
|
437
|
-
depQueues.add(q);
|
|
438
|
-
if (q && q.status === 0) {
|
|
439
|
-
fn.queueCount++;
|
|
440
|
-
q.push(fn);
|
|
622
|
+
const factoryToInstall = existingGroupFactory ?? moduleFactoryFn;
|
|
623
|
+
let didInstallFactory = false;
|
|
624
|
+
for(let j = i; j < end; j++){
|
|
625
|
+
const id = chunkModules[j];
|
|
626
|
+
if (!moduleFactories.has(id)) {
|
|
627
|
+
if (!didInstallFactory) {
|
|
628
|
+
if (factoryToInstall === moduleFactoryFn) {
|
|
629
|
+
applyModuleFactoryName(moduleFactoryFn);
|
|
630
|
+
}
|
|
631
|
+
didInstallFactory = true;
|
|
441
632
|
}
|
|
633
|
+
moduleFactories.set(id, factoryToInstall);
|
|
634
|
+
newModuleId?.(id);
|
|
442
635
|
}
|
|
443
636
|
}
|
|
444
|
-
|
|
445
|
-
return fn.queueCount ? promise : getResult();
|
|
446
|
-
}
|
|
447
|
-
function asyncResult(err) {
|
|
448
|
-
if (err) {
|
|
449
|
-
reject(promise[turbopackError] = err);
|
|
450
|
-
} else {
|
|
451
|
-
resolve(promise[turbopackExports]);
|
|
452
|
-
}
|
|
453
|
-
resolveQueue(queue);
|
|
454
|
-
}
|
|
455
|
-
body(handleAsyncDependencies, asyncResult);
|
|
456
|
-
if (queue && queue.status === -1) {
|
|
457
|
-
queue.status = 0;
|
|
637
|
+
i = end + 1;
|
|
458
638
|
}
|
|
459
639
|
}
|
|
460
|
-
contextPrototype.a = asyncModule;
|
|
461
640
|
/**
|
|
462
641
|
* A pseudo "fake" URL object to resolve to its relative path.
|
|
463
642
|
*
|
|
@@ -488,6 +667,33 @@ contextPrototype.U = relativeURL;
|
|
|
488
667
|
*/ function invariant(never, computeMessage) {
|
|
489
668
|
throw new Error(`Invariant: ${computeMessage(never)}`);
|
|
490
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Constructs an error message for when a module factory is not available.
|
|
672
|
+
*/ function factoryNotAvailableMessage(moduleId, sourceType, sourceData) {
|
|
673
|
+
let instantiationReason;
|
|
674
|
+
switch(sourceType){
|
|
675
|
+
case 0:
|
|
676
|
+
instantiationReason = `as a runtime entry of chunk ${sourceData}`;
|
|
677
|
+
break;
|
|
678
|
+
case 1:
|
|
679
|
+
instantiationReason = `because it was required from module ${sourceData}`;
|
|
680
|
+
break;
|
|
681
|
+
case 2:
|
|
682
|
+
instantiationReason = 'because of an HMR update';
|
|
683
|
+
break;
|
|
684
|
+
default:
|
|
685
|
+
invariant(sourceType, (sourceType)=>`Unknown source type: ${sourceType}`);
|
|
686
|
+
}
|
|
687
|
+
return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Returns a `file://` URL under a synthetic directory named after `root`
|
|
691
|
+
* (`ROOT` for the project root), for when the real filesystem path is unknown.
|
|
692
|
+
* The root name and path segments are percent-encoded so the result is always
|
|
693
|
+
* a valid file URI.
|
|
694
|
+
*/ function placeholderFileUrl(modulePath, root) {
|
|
695
|
+
return `file:///${encodeURIComponent(root ?? 'ROOT')}/${modulePath.split('/').map(encodeURIComponent).join('/')}`;
|
|
696
|
+
}
|
|
491
697
|
/**
|
|
492
698
|
* A stub function to make `require` available but non-functional in ESM.
|
|
493
699
|
*/ function requireStub(_moduleId) {
|
|
@@ -502,7 +708,7 @@ function applyModuleFactoryName(factory) {
|
|
|
502
708
|
value: 'module evaluation'
|
|
503
709
|
});
|
|
504
710
|
}
|
|
505
|
-
/// <reference path="../shared/runtime-utils.ts" />
|
|
711
|
+
/// <reference path="../shared/runtime/runtime-utils.ts" />
|
|
506
712
|
/// A 'base' utilities to support runtime can have externals.
|
|
507
713
|
/// Currently this is for node.js / edge runtime both.
|
|
508
714
|
/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.
|
|
@@ -564,54 +770,36 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
|
|
|
564
770
|
return ABSOLUTE_ROOT;
|
|
565
771
|
}
|
|
566
772
|
Context.prototype.P = resolveAbsolutePath;
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
var SourceType = /*#__PURE__*/ function(SourceType) {
|
|
593
|
-
/**
|
|
594
|
-
* The module was instantiated because it was included in an evaluated chunk's
|
|
595
|
-
* runtime.
|
|
596
|
-
* SourceData is a ChunkPath.
|
|
597
|
-
*/ SourceType[SourceType["Runtime"] = 0] = "Runtime";
|
|
598
|
-
/**
|
|
599
|
-
* The module was instantiated because a parent module imported it.
|
|
600
|
-
* SourceData is a ModuleId.
|
|
601
|
-
*/ SourceType[SourceType["Parent"] = 1] = "Parent";
|
|
602
|
-
return SourceType;
|
|
603
|
-
}(SourceType || {});
|
|
604
|
-
process.env.TURBOPACK = '1';
|
|
605
|
-
const nodeContextPrototype = Context.prototype;
|
|
773
|
+
/**
|
|
774
|
+
* Returns an absolute `file://` URL for the given module path, which is
|
|
775
|
+
* relative to the project root or the named `root`.
|
|
776
|
+
*
|
|
777
|
+
* Uses `url.pathToFileURL` so that the resulting URL is a valid file URI on
|
|
778
|
+
* all platforms (forward slashes on Windows, drive letters handled
|
|
779
|
+
* correctly, path segments URL-encoded).
|
|
780
|
+
*
|
|
781
|
+
* The location of a named `root` isn't known at runtime (the output may have
|
|
782
|
+
* been moved away from the sources), so this returns a placeholder URL for it.
|
|
783
|
+
*/ function resolveFileUrl(modulePath, root) {
|
|
784
|
+
if (root !== undefined) {
|
|
785
|
+
return placeholderFileUrl(modulePath, root);
|
|
786
|
+
}
|
|
787
|
+
return require('url').pathToFileURL(resolveAbsolutePath(modulePath)).href;
|
|
788
|
+
}
|
|
789
|
+
Context.prototype.F = resolveFileUrl;
|
|
790
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../shared/runtime/runtime-utils.ts" />
|
|
791
|
+
/// <reference path="../../shared-node/base-externals-utils.ts" />
|
|
792
|
+
/// <reference path="../../shared-node/node-externals-utils.ts" />
|
|
793
|
+
/// <reference path="./nodejs-globals.d.ts" />
|
|
794
|
+
/**
|
|
795
|
+
* Base Node.js runtime shared between production and development.
|
|
796
|
+
* Contains chunk loading, module caching, and other non-HMR functionality.
|
|
797
|
+
*/ process.env.TURBOPACK = '1';
|
|
606
798
|
const url = require('url');
|
|
607
|
-
const moduleFactories = new Map();
|
|
608
|
-
nodeContextPrototype.M = moduleFactories;
|
|
609
|
-
const moduleCache = Object.create(null);
|
|
610
|
-
nodeContextPrototype.c = moduleCache;
|
|
611
799
|
/**
|
|
612
800
|
* Returns an absolute path to the given module's id.
|
|
613
801
|
*/ function resolvePathFromModule(moduleId) {
|
|
614
|
-
const exported = this.
|
|
802
|
+
const exported = getOrInstantiateModuleFromParent(moduleId, this.m).exports;
|
|
615
803
|
const exportedPath = exported?.default ?? exported;
|
|
616
804
|
if (typeof exportedPath !== 'string') {
|
|
617
805
|
return exported;
|
|
@@ -620,7 +808,11 @@ nodeContextPrototype.c = moduleCache;
|
|
|
620
808
|
const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix);
|
|
621
809
|
return url.pathToFileURL(resolved).href;
|
|
622
810
|
}
|
|
623
|
-
|
|
811
|
+
/**
|
|
812
|
+
* Exports a URL value. No suffix is added in Node.js runtime.
|
|
813
|
+
*/ function exportUrl(urlValue, id) {
|
|
814
|
+
exportValue.call(this, urlValue, id);
|
|
815
|
+
}
|
|
624
816
|
function loadRuntimeChunk(sourcePath, chunkData) {
|
|
625
817
|
if (typeof chunkData === 'string') {
|
|
626
818
|
loadRuntimeChunkPath(sourcePath, chunkData);
|
|
@@ -634,6 +826,7 @@ const loadedChunk = Promise.resolve(undefined);
|
|
|
634
826
|
const chunkCache = new Map();
|
|
635
827
|
function clearChunkCache() {
|
|
636
828
|
chunkCache.clear();
|
|
829
|
+
loadedChunks.clear();
|
|
637
830
|
}
|
|
638
831
|
function loadRuntimeChunkPath(sourcePath, chunkPath) {
|
|
639
832
|
if (!isJs(chunkPath)) {
|
|
@@ -647,7 +840,7 @@ function loadRuntimeChunkPath(sourcePath, chunkPath) {
|
|
|
647
840
|
try {
|
|
648
841
|
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
|
|
649
842
|
const chunkModules = require(resolved);
|
|
650
|
-
installCompressedModuleFactories(chunkModules, 0
|
|
843
|
+
installCompressedModuleFactories(chunkModules, 0);
|
|
651
844
|
loadedChunks.add(chunkPath);
|
|
652
845
|
} catch (cause) {
|
|
653
846
|
let errorMessage = `Failed to load chunk ${chunkPath}`;
|
|
@@ -670,70 +863,99 @@ function loadChunkAsync(chunkData) {
|
|
|
670
863
|
}
|
|
671
864
|
let entry = chunkCache.get(chunkPath);
|
|
672
865
|
if (entry === undefined) {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
866
|
+
const sourceModuleId = this.m.id;
|
|
867
|
+
// `ensureChunk` is conditionally installed to support lazy dynamic imports during SSR
|
|
868
|
+
// It can be used to call back into turbopack to compile the chunk we are about to reference.
|
|
869
|
+
const ensureChunk = globalThis.__turbopack_ensure_chunk__;
|
|
870
|
+
let ensuring = undefined;
|
|
871
|
+
if (ensureChunk !== undefined) {
|
|
872
|
+
try {
|
|
873
|
+
// Returns `undefined` when the chunk can be required right away.
|
|
874
|
+
ensuring = ensureChunk(chunkPath);
|
|
875
|
+
} catch (error) {
|
|
876
|
+
// Don't cache a failure to compile the chunk, so that the next load
|
|
877
|
+
// retries it.
|
|
878
|
+
return Promise.reject(error);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
if (ensuring === undefined) {
|
|
882
|
+
entry = requireChunk(chunkPath, sourceModuleId);
|
|
883
|
+
} else {
|
|
884
|
+
// The chunk is being compiled on demand before it can be required.
|
|
885
|
+
// Cache the combined promise right away so that every caller (including
|
|
886
|
+
// concurrent ones) gets the same promise for this chunk.
|
|
887
|
+
const ensured = Promise.resolve(ensuring).then(()=>requireChunk(chunkPath, sourceModuleId), (error)=>{
|
|
888
|
+
// Don't cache a failure to compile the chunk, so that the next load
|
|
889
|
+
// retries it.
|
|
890
|
+
if (chunkCache.get(chunkPath) === ensured) {
|
|
891
|
+
chunkCache.delete(chunkPath);
|
|
892
|
+
}
|
|
893
|
+
throw error;
|
|
685
894
|
});
|
|
686
|
-
|
|
687
|
-
// Cache the failure promise, future requests will also get this same rejection
|
|
688
|
-
entry = Promise.reject(error);
|
|
895
|
+
entry = ensured;
|
|
689
896
|
}
|
|
690
897
|
chunkCache.set(chunkPath, entry);
|
|
691
898
|
}
|
|
692
899
|
// TODO: Return an instrumented Promise that React can use instead of relying on referential equality.
|
|
693
900
|
return entry;
|
|
694
901
|
}
|
|
902
|
+
function requireChunk(chunkPath, sourceModuleId) {
|
|
903
|
+
try {
|
|
904
|
+
// resolve to an absolute path to simplify `require` handling
|
|
905
|
+
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
|
|
906
|
+
// TODO: consider switching to `import()` to enable concurrent chunk loading and async file io
|
|
907
|
+
// However this is incompatible with hot reloading (since `import` doesn't use the require cache)
|
|
908
|
+
const chunkModules = require(resolved);
|
|
909
|
+
installCompressedModuleFactories(chunkModules, 0);
|
|
910
|
+
return loadedChunk;
|
|
911
|
+
} catch (cause) {
|
|
912
|
+
const errorMessage = `Failed to load chunk ${chunkPath} from module ${sourceModuleId}`;
|
|
913
|
+
const error = new Error(errorMessage, {
|
|
914
|
+
cause
|
|
915
|
+
});
|
|
916
|
+
error.name = 'ChunkLoadError';
|
|
917
|
+
// Cache the failure promise, future requests will also get this same rejection
|
|
918
|
+
return Promise.reject(error);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
695
921
|
contextPrototype.l = loadChunkAsync;
|
|
696
922
|
function loadChunkAsyncByUrl(chunkUrl) {
|
|
697
923
|
const path1 = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT));
|
|
698
924
|
return loadChunkAsync.call(this, path1);
|
|
699
925
|
}
|
|
700
926
|
contextPrototype.L = loadChunkAsyncByUrl;
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
return
|
|
709
|
-
}
|
|
710
|
-
contextPrototype.u = loadWebAssemblyModule;
|
|
711
|
-
function getWorkerBlobURL(_chunks) {
|
|
712
|
-
throw new Error('Worker blobs are not implemented yet for Node.js');
|
|
927
|
+
// Shared runtime primitive: the root that on-disk chunk paths are resolved
|
|
928
|
+
// against. Used by the bundled wasm helper (exposed as `__turbopack_runtime_root__`).
|
|
929
|
+
contextPrototype.w = RUNTIME_ROOT;
|
|
930
|
+
const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/;
|
|
931
|
+
/**
|
|
932
|
+
* Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.
|
|
933
|
+
*/ function isJs(chunkUrlOrPath) {
|
|
934
|
+
return regexJsUrl.test(chunkUrlOrPath);
|
|
713
935
|
}
|
|
714
|
-
|
|
936
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-base.ts" />
|
|
937
|
+
/**
|
|
938
|
+
* Production Node.js runtime.
|
|
939
|
+
* Uses ModuleWithDirection and simple module instantiation without HMR support.
|
|
940
|
+
*/ // this is read in runtime-utils.ts so it creates a module with direction for hmr
|
|
941
|
+
createModuleWithDirectionFlag = true;
|
|
942
|
+
const moduleCache = new Map();
|
|
943
|
+
const nodeContextPrototype = Context.prototype;
|
|
944
|
+
nodeContextPrototype.q = exportUrl;
|
|
945
|
+
nodeContextPrototype.c = moduleCache;
|
|
946
|
+
nodeContextPrototype.R = resolvePathFromModule;
|
|
947
|
+
nodeContextPrototype.C = clearChunkCache;
|
|
715
948
|
function instantiateModule(id, sourceType, sourceData) {
|
|
716
949
|
const moduleFactory = moduleFactories.get(id);
|
|
717
950
|
if (typeof moduleFactory !== 'function') {
|
|
718
951
|
// This can happen if modules incorrectly handle HMR disposes/updates,
|
|
719
952
|
// e.g. when they keep a `setTimeout` around which still executes old code
|
|
720
953
|
// and contains e.g. a `require("something")` call.
|
|
721
|
-
|
|
722
|
-
switch(sourceType){
|
|
723
|
-
case 0:
|
|
724
|
-
instantiationReason = `as a runtime entry of chunk ${sourceData}`;
|
|
725
|
-
break;
|
|
726
|
-
case 1:
|
|
727
|
-
instantiationReason = `because it was required from module ${sourceData}`;
|
|
728
|
-
break;
|
|
729
|
-
default:
|
|
730
|
-
invariant(sourceType, (sourceType)=>`Unknown source type: ${sourceType}`);
|
|
731
|
-
}
|
|
732
|
-
throw new Error(`Module ${id} was instantiated ${instantiationReason}, but the module factory is not available.`);
|
|
954
|
+
throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData));
|
|
733
955
|
}
|
|
734
|
-
const module1 =
|
|
956
|
+
const module1 = createModuleWithDirection(id);
|
|
735
957
|
const exports = module1.exports;
|
|
736
|
-
moduleCache
|
|
958
|
+
moduleCache.set(id, module1);
|
|
737
959
|
const context = new Context(module1, exports);
|
|
738
960
|
// NOTE(alexkirsz) This can fail when the module encounters a runtime error.
|
|
739
961
|
try {
|
|
@@ -742,6 +964,7 @@ function instantiateModule(id, sourceType, sourceData) {
|
|
|
742
964
|
module1.error = error;
|
|
743
965
|
throw error;
|
|
744
966
|
}
|
|
967
|
+
;
|
|
745
968
|
module1.loaded = true;
|
|
746
969
|
if (module1.namespaceObject && module1.exports !== module1.namespaceObject) {
|
|
747
970
|
// in case of a circular dependency: cjs1 -> esm2 -> cjs1
|
|
@@ -753,38 +976,18 @@ function instantiateModule(id, sourceType, sourceData) {
|
|
|
753
976
|
* Retrieves a module from the cache, or instantiate it if it is not cached.
|
|
754
977
|
*/ // @ts-ignore
|
|
755
978
|
function getOrInstantiateModuleFromParent(id, sourceModule) {
|
|
756
|
-
|
|
757
|
-
if (module1) {
|
|
758
|
-
if (module1.error) {
|
|
759
|
-
throw module1.error;
|
|
760
|
-
}
|
|
761
|
-
return module1;
|
|
762
|
-
}
|
|
763
|
-
return instantiateModule(id, 1, sourceModule.id);
|
|
979
|
+
return getCachedModule(moduleCache, id) ?? instantiateModule(id, SourceType.Parent, sourceModule.id);
|
|
764
980
|
}
|
|
765
981
|
/**
|
|
766
982
|
* Instantiates a runtime module.
|
|
767
983
|
*/ function instantiateRuntimeModule(chunkPath, moduleId) {
|
|
768
|
-
return instantiateModule(moduleId,
|
|
984
|
+
return instantiateModule(moduleId, SourceType.Runtime, chunkPath);
|
|
769
985
|
}
|
|
770
986
|
/**
|
|
771
987
|
* Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.
|
|
772
988
|
*/ // @ts-ignore TypeScript doesn't separate this module space from the browser runtime
|
|
773
989
|
function getOrInstantiateRuntimeModule(chunkPath, moduleId) {
|
|
774
|
-
|
|
775
|
-
if (module1) {
|
|
776
|
-
if (module1.error) {
|
|
777
|
-
throw module1.error;
|
|
778
|
-
}
|
|
779
|
-
return module1;
|
|
780
|
-
}
|
|
781
|
-
return instantiateRuntimeModule(chunkPath, moduleId);
|
|
782
|
-
}
|
|
783
|
-
const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/;
|
|
784
|
-
/**
|
|
785
|
-
* Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.
|
|
786
|
-
*/ function isJs(chunkUrlOrPath) {
|
|
787
|
-
return regexJsUrl.test(chunkUrlOrPath);
|
|
990
|
+
return getCachedModule(moduleCache, moduleId) ?? instantiateRuntimeModule(chunkPath, moduleId);
|
|
788
991
|
}
|
|
789
992
|
module.exports = (sourcePath)=>({
|
|
790
993
|
m: (id)=>getOrInstantiateRuntimeModule(sourcePath, id),
|