@wular/pnext 0.1.6 → 0.1.8
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/bin/pnext +9 -2
- package/dist/server/_chunks/aliases-pycbtjt1.js +46 -0
- package/dist/server/_chunks/analyze-4d9e00g9.js +449 -0
- package/dist/server/_chunks/boot-bhemypxz.js +38 -0
- package/dist/server/_chunks/build-c991dv65.js +86 -0
- package/dist/server/_chunks/build-kh5e3x48.js +3341 -0
- package/dist/server/_chunks/build-tier-0a96kmx3.js +2456 -0
- package/dist/server/_chunks/compile-040r79gj.js +22 -0
- package/dist/server/_chunks/config-0tvz03a6.js +24 -0
- package/dist/server/_chunks/config-27rj7830.js +36 -0
- package/dist/server/_chunks/create-9rvwshsp.js +135 -0
- package/dist/server/_chunks/dev-ex9exynt.js +220 -0
- package/dist/server/_chunks/esbuild-yyktfrtt.js +15 -0
- package/dist/server/_chunks/generate-myw9hef7.js +22 -0
- package/dist/server/_chunks/index-0r5eqfc7.js +279 -0
- package/dist/server/_chunks/index-0yjv5v47.js +105 -0
- package/dist/server/_chunks/index-11xpbfej.js +17 -0
- package/dist/server/_chunks/index-141vcwk6.js +109 -0
- package/dist/server/_chunks/index-1pzm1hdy.js +4130 -0
- package/dist/server/_chunks/index-29pq0kax.js +590 -0
- package/dist/server/_chunks/index-2vz0wzdn.js +59 -0
- package/dist/server/_chunks/index-2wfv4kvx.js +182 -0
- package/dist/server/_chunks/index-38xpdxwd.js +194 -0
- package/dist/server/_chunks/index-3e075kny.js +128 -0
- package/dist/server/_chunks/index-3ycf5ckv.js +472 -0
- package/dist/server/_chunks/index-4399bvd2.js +18 -0
- package/dist/server/_chunks/index-4da76t62.js +297 -0
- package/dist/server/_chunks/index-4t92hdxd.js +172 -0
- package/dist/server/_chunks/index-4zzebszd.js +10 -0
- package/dist/server/_chunks/index-52k54ykj.js +95 -0
- package/dist/server/_chunks/index-5hr4062s.js +70 -0
- package/dist/server/_chunks/index-68m3mwbd.js +84 -0
- package/dist/server/_chunks/index-6b009mt0.js +56 -0
- package/dist/server/_chunks/index-6gex3pfa.js +15 -0
- package/dist/server/_chunks/index-6kp9r0d9.js +11 -0
- package/dist/server/_chunks/index-6q7zvrap.js +134 -0
- package/dist/server/_chunks/index-71885zaq.js +284 -0
- package/dist/server/_chunks/index-73z4esab.js +38 -0
- package/dist/server/_chunks/index-79ngvam8.js +60 -0
- package/dist/server/_chunks/index-7wc9n8be.js +25 -0
- package/dist/server/_chunks/index-8ct7rqy3.js +198 -0
- package/dist/server/_chunks/index-8kcxdfya.js +206 -0
- package/dist/server/_chunks/index-9ch50vtq.js +18 -0
- package/dist/server/_chunks/index-9f49w76j.js +213 -0
- package/dist/server/_chunks/index-9hz3s0m8.js +851 -0
- package/dist/server/_chunks/index-akkrvjn6.js +535 -0
- package/dist/server/_chunks/index-b6wtkdp4.js +24 -0
- package/dist/server/_chunks/index-b7j671dj.js +207 -0
- package/dist/server/_chunks/index-bcws5eh2.js +35 -0
- package/dist/server/_chunks/index-bzd2ef7t.js +10 -0
- package/dist/server/_chunks/index-cjgqs13g.js +65 -0
- package/dist/server/_chunks/index-ckkdpht5.js +41 -0
- package/dist/server/_chunks/index-cn86z041.js +296 -0
- package/dist/server/_chunks/index-cvr4z22m.js +92 -0
- package/dist/server/_chunks/index-cyfednwb.js +87 -0
- package/dist/server/_chunks/index-d158y67j.js +152 -0
- package/dist/server/_chunks/index-d1jsmhhk.js +955 -0
- package/dist/server/_chunks/index-dg0f05zs.js +199 -0
- package/dist/server/_chunks/index-dgr390q7.js +9438 -0
- package/dist/server/_chunks/index-drwv61cc.js +185 -0
- package/dist/server/_chunks/index-e3a6yx84.js +18 -0
- package/dist/server/_chunks/index-e88tyv35.js +45 -0
- package/dist/server/_chunks/index-en7n9f7m.js +22 -0
- package/dist/server/_chunks/index-entm8bmz.js +28 -0
- package/dist/server/_chunks/index-evhd413j.js +57 -0
- package/dist/server/_chunks/index-ezgj0tr1.js +88 -0
- package/dist/server/_chunks/index-fjv96re1.js +5295 -0
- package/dist/server/_chunks/index-fn1chkkd.js +214 -0
- package/dist/server/_chunks/index-fp8r0sqs.js +64 -0
- package/dist/server/_chunks/index-gcmj16xy.js +92 -0
- package/dist/server/_chunks/index-gkndxkxf.js +736 -0
- package/dist/server/_chunks/index-grta8ap3.js +238 -0
- package/dist/server/_chunks/index-h2a70tg4.js +7 -0
- package/dist/server/_chunks/index-h4xy648y.js +51 -0
- package/dist/server/_chunks/index-hdbwtdv2.js +352 -0
- package/dist/server/_chunks/index-he6n2bvp.js +1270 -0
- package/dist/server/_chunks/index-j0m1jxqa.js +1253 -0
- package/dist/server/_chunks/index-j2zrcp1k.js +66 -0
- package/dist/server/_chunks/index-j681c48a.js +2530 -0
- package/dist/server/_chunks/index-jbj7ehef.js +50 -0
- package/dist/server/_chunks/index-jcsjq3d1.js +20 -0
- package/dist/server/_chunks/index-jks0x0a1.js +14 -0
- package/dist/server/_chunks/index-jn9rbhrx.js +1599 -0
- package/dist/server/_chunks/index-jt8e1pje.js +12 -0
- package/dist/server/_chunks/index-kdhxpwyq.js +483 -0
- package/dist/server/_chunks/index-knp0s912.js +7 -0
- package/dist/server/_chunks/index-kqyy1d4f.js +50 -0
- package/dist/server/_chunks/index-kresp2n8.js +445 -0
- package/dist/server/_chunks/index-m63czgq5.js +590 -0
- package/dist/server/_chunks/index-ms9v9tnx.js +31 -0
- package/dist/server/_chunks/index-n4hxpng2.js +11 -0
- package/dist/server/_chunks/index-n629dy38.js +1071 -0
- package/dist/server/_chunks/index-nf3df4jy.js +266 -0
- package/dist/server/_chunks/index-nqh3xhdc.js +57 -0
- package/dist/server/_chunks/index-pym1cezq.js +39 -0
- package/dist/server/_chunks/index-q3r9z8mq.js +213 -0
- package/dist/server/_chunks/index-q738kkhj.js +100 -0
- package/dist/server/_chunks/index-qcrvt6er.js +112 -0
- package/dist/server/_chunks/index-qjj6gddn.js +54 -0
- package/dist/server/_chunks/index-qpwsgt3a.js +158 -0
- package/dist/server/_chunks/index-r97ptz1q.js +97 -0
- package/dist/server/_chunks/index-ras0sdab.js +26 -0
- package/dist/server/_chunks/index-rcs322t1.js +19 -0
- package/dist/server/_chunks/index-rgj5mx84.js +101 -0
- package/dist/server/_chunks/index-rjegyfx4.js +1435 -0
- package/dist/server/_chunks/index-rt9qq1va.js +4 -0
- package/dist/server/_chunks/index-rthrsed5.js +356 -0
- package/dist/server/_chunks/index-sq3kvz3g.js +200 -0
- package/dist/server/_chunks/index-stbk3jhn.js +31 -0
- package/dist/server/_chunks/index-tf4j19ge.js +130 -0
- package/dist/server/_chunks/index-tgcakdxc.js +125 -0
- package/dist/server/_chunks/index-tgsfjmep.js +74 -0
- package/dist/server/_chunks/index-tq1f96v7.js +51 -0
- package/dist/server/_chunks/index-tq3b39a5.js +107 -0
- package/dist/server/_chunks/index-typcbcsv.js +819 -0
- package/dist/server/_chunks/index-v1ags1na.js +132 -0
- package/dist/server/_chunks/index-vmr35jjw.js +170 -0
- package/dist/server/_chunks/index-vvq7rqtn.js +329 -0
- package/dist/server/_chunks/index-vz0km5qk.js +33 -0
- package/dist/server/_chunks/index-w6h8m6vp.js +138 -0
- package/dist/server/_chunks/index-web361b8.js +138 -0
- package/dist/server/_chunks/index-wm36rj4v.js +311 -0
- package/dist/server/_chunks/index-x0y005nh.js +283 -0
- package/dist/server/_chunks/index-x2m17v9c.js +6166 -0
- package/dist/server/_chunks/index-x3yn4ywm.js +22 -0
- package/dist/server/_chunks/index-x9c55pzy.js +871 -0
- package/dist/server/_chunks/index-xh1nbk46.js +1299 -0
- package/dist/server/_chunks/index-xvj80c3a.js +30 -0
- package/dist/server/_chunks/index-xywjg2vc.js +100 -0
- package/dist/server/_chunks/index-y4d02znn.js +66 -0
- package/dist/server/_chunks/index-y7mzvq2q.js +110 -0
- package/dist/server/_chunks/index-ye9hmsvf.js +47 -0
- package/dist/server/_chunks/index-yhxkxghe.js +56 -0
- package/dist/server/_chunks/index-yrjkqtfj.js +86 -0
- package/dist/server/_chunks/index-z88qv16t.js +11 -0
- package/dist/server/_chunks/index-zfrwq472.js +154 -0
- package/dist/server/_chunks/index-zqpqyg8p.js +666 -0
- package/dist/server/_chunks/loader-5en7wpt5.js +80 -0
- package/dist/server/_chunks/modules-t92favpj.js +76 -0
- package/dist/server/_chunks/pipeline-4t9q43ht.js +836 -0
- package/dist/server/_chunks/production-385bw8df.js +55 -0
- package/dist/server/_chunks/proxy-config-60gprphe.js +23 -0
- package/dist/server/_chunks/proxy-gfhmktbk.js +35 -0
- package/dist/server/_chunks/router-xnrva921.js +501 -0
- package/dist/server/_chunks/routes-ht868pdc.js +66 -0
- package/dist/server/_chunks/run-d40d63ag.js +697 -0
- package/dist/server/_chunks/server-2p8fgqq2.js +1839 -0
- package/dist/server/_chunks/tsconfig-defaults-bcn34eqb.js +21 -0
- package/dist/server/_chunks/typegen-dvtcjtaw.js +37 -0
- package/dist/server/api/client-cache.js +14 -0
- package/dist/server/cli/index.js +375 -0
- package/dist/server/cli/start.js +158 -0
- package/dist/server/client/reference.js +16 -0
- package/dist/server/compat/next/cache.js +56 -0
- package/dist/server/compat/next/canonical-url.js +13 -0
- package/dist/server/compat/next/client-cache.js +57 -0
- package/dist/server/compat/next/client-navigation.js +232 -0
- package/dist/server/compat/next/client-only.js +1 -0
- package/dist/server/compat/next/client-script.js +178 -0
- package/dist/server/compat/next/client-server.js +34 -0
- package/dist/server/compat/next/config-headers.js +34 -0
- package/dist/server/compat/next/config-loader.js +25 -0
- package/dist/server/compat/next/config.js +10 -0
- package/dist/server/compat/next/constants.js +18 -0
- package/dist/server/compat/next/custom-server.js +10 -0
- package/dist/server/compat/next/dist/client/components/app-router-headers.js +48 -0
- package/dist/server/compat/next/dist/server/web/spec-extension/revalidate.js +27 -0
- package/dist/server/compat/next/dist/server/web/spec-extension/unstable-cache.js +25 -0
- package/dist/server/compat/next/dist/server/web/spec-extension/unstable-no-store.js +25 -0
- package/dist/server/compat/next/dynamic.js +21 -0
- package/dist/server/compat/next/error.js +112 -0
- package/dist/server/compat/next/font/cache.js +16 -0
- package/dist/server/compat/next/font/google.js +3 -0
- package/dist/server/compat/next/font/index.js +1 -0
- package/dist/server/compat/next/font/local.js +24 -0
- package/dist/server/compat/next/font/runtime-client.js +33 -0
- package/dist/server/compat/next/font/runtime.js +43 -0
- package/dist/server/compat/next/font/shared.js +22 -0
- package/dist/server/compat/next/form.js +129 -0
- package/dist/server/compat/next/head.js +10 -0
- package/dist/server/compat/next/headers.js +30 -0
- package/dist/server/compat/next/image/client.js +11 -0
- package/dist/server/compat/next/image/config.js +18 -0
- package/dist/server/compat/next/image/optimizer.js +25 -0
- package/dist/server/compat/next/image/patterns.js +12 -0
- package/dist/server/compat/next/image/props.js +16 -0
- package/dist/server/compat/next/image/shared.js +86 -0
- package/dist/server/compat/next/image/static-metadata.js +32 -0
- package/dist/server/compat/next/image/validate.js +8 -0
- package/dist/server/compat/next/image.js +59 -0
- package/dist/server/compat/next/index.js +1 -0
- package/dist/server/compat/next/legacy-image.js +78 -0
- package/dist/server/compat/next/legacy-request-apis.js +24 -0
- package/dist/server/compat/next/link-transform.js +15 -0
- package/dist/server/compat/next/link.js +14 -0
- package/dist/server/compat/next/navigation.js +191 -0
- package/dist/server/compat/next/offline.js +45 -0
- package/dist/server/compat/next/og.js +8 -0
- package/dist/server/compat/next/preferred-region.js +8 -0
- package/dist/server/compat/next/redirects.js +32 -0
- package/dist/server/compat/next/resource-hints.js +30 -0
- package/dist/server/compat/next/rewrites.js +43 -0
- package/dist/server/compat/next/root-params.js +121 -0
- package/dist/server/compat/next/route-state.js +23 -0
- package/dist/server/compat/next/router.js +103 -0
- package/dist/server/compat/next/script.js +37 -0
- package/dist/server/compat/next/server-only.js +1 -0
- package/dist/server/compat/next/server.js +131 -0
- package/dist/server/compat/next/svgr.js +14 -0
- package/dist/server/compat/next/telemetry.js +10 -0
- package/dist/server/compat/next/usage.js +13 -0
- package/dist/server/compat/next/user-agent.js +12 -0
- package/dist/server/compat/next/web-vitals.js +35 -0
- package/dist/server/compat/react/action-state.js +11 -0
- package/dist/server/compat/react/client-lite.js +83 -0
- package/dist/server/compat/react/client.js +131 -0
- package/dist/server/compat/react/compiler-runtime.js +42 -0
- package/dist/server/compat/react/dom-client.js +106 -0
- package/dist/server/compat/react/dom-react-server.js +37 -0
- package/dist/server/compat/react/dom-server.js +40 -0
- package/dist/server/compat/react/dom.js +52 -0
- package/dist/server/compat/react/hooks-extra.js +12 -0
- package/dist/server/compat/react/internals.js +14 -0
- package/dist/server/compat/react/parity.js +11 -0
- package/dist/server/compat/react/preact.js +113 -0
- package/dist/server/compat/react/react-server.js +133 -0
- package/dist/server/compat/react/router-shim.js +8 -0
- package/dist/server/compat/react/server-component-use.js +14 -0
- package/dist/server/compat/react/server-inserted-html.js +14 -0
- package/dist/server/compat/react/server.js +194 -0
- package/dist/server/compat/react/style-values.js +10 -0
- package/dist/server/compat/react/use.js +10 -0
- package/dist/server/compat/react/view-transition.js +12 -0
- package/dist/server/generation.json +1 -0
- package/package.json +4 -1
- package/reference/compat.md +1 -1
- package/reference/config.md +2 -2
- package/reference/dev.md +1 -1
- package/reference/getting-started.md +1 -1
- package/reference/rendering.md +4 -4
- package/src/api/dynamic.tsx +86 -4
- package/src/api/server.ts +24 -6
- package/src/cli/adapters/vercel-warm.ts +327 -62
- package/src/cli/adapters/vercel.ts +164 -1054
- package/src/cli/analyze.ts +3 -2
- package/src/cli/build/cache.ts +6 -6
- package/src/cli/build.ts +78 -45
- package/src/cli/index.ts +21 -3
- package/src/cli/serve/immutable.ts +31 -0
- package/src/cli/serve/pipeline.ts +97 -93
- package/src/cli/serve/standalone-worker.ts +8 -0
- package/src/cli/serve/standalone.ts +703 -0
- package/src/cli/start.ts +31 -8
- package/src/client/build.ts +1 -1
- package/src/client/chunk-fold.ts +19 -6
- package/src/client/react-tier.ts +3 -2
- package/src/client/reference-stub.ts +23 -36
- package/src/compat/actions/client-plugin.ts +4 -2
- package/src/compat/actions/config.ts +6 -5
- package/src/compat/actions/extensions.ts +5 -5
- package/src/compat/aliases.ts +8 -1
- package/src/compat/bundler/config.ts +88 -0
- package/src/compat/bundler/optimize-package-imports.ts +86 -26
- package/src/compat/bundler/relay-transform.ts +15 -3
- package/src/compat/bundler/require-context.ts +2 -1
- package/src/compat/bundler/webpack-loaders.ts +3 -2
- package/src/compat/bundler/worker.ts +2 -2
- package/src/compat/cache-control.ts +16 -8
- package/src/compat/css/inline-css.ts +1 -1
- package/src/compat/css/modules.ts +18 -5
- package/src/compat/export/build-complete.ts +1 -1
- package/src/compat/export/emit.ts +4 -4
- package/src/compat/export/standalone.ts +30 -65
- package/src/compat/image-optimizer/optimize.ts +1 -1
- package/src/compat/lifecycle/error-funnel.ts +1 -1
- package/src/compat/lifecycle/instrumentation-client.ts +4 -3
- package/src/compat/lifecycle/instrumentation.ts +117 -24
- package/src/compat/lifecycle/testmode.ts +3 -2
- package/src/compat/metadata-artifacts.ts +1 -1
- package/src/compat/next/config-loader.ts +140 -13
- package/src/compat/next/dynamic.tsx +10 -23
- package/src/compat/next/font/cache.ts +2 -1
- package/src/compat/next/font/runtime.ts +23 -3
- package/src/compat/next/og.ts +3 -3
- package/src/compat/next/usage.ts +3 -2
- package/src/compat/pages/api.ts +83 -14
- package/src/compat/pages/router.ts +30 -14
- package/src/compat/register/bundler.ts +3 -1
- package/src/compat/register/image.ts +1 -1
- package/src/compat/register/middleware.ts +1 -1
- package/src/compat/register/otel.ts +5 -9
- package/src/compat/register/render.ts +3 -1
- package/src/compat/register/use-cache.ts +3 -1
- package/src/compat/release.ts +46 -0
- package/src/compat/segment/serve.ts +1 -1
- package/src/compat/typecheck/check.ts +6 -4
- package/src/compat/validation/validate.ts +10 -7
- package/src/config.ts +76 -9
- package/src/css/assets.ts +213 -0
- package/src/css/build.ts +190 -247
- package/src/dev/client-chunk-store.ts +2 -1
- package/src/dev/restart/client-key.ts +2 -1
- package/src/dev/restart/global-css.ts +2 -1
- package/src/dev/restart/route-bundle-key.ts +2 -1
- package/src/dev/restart/route-facts.ts +2 -1
- package/src/dev/server.ts +34 -14
- package/src/extensions.ts +4 -0
- package/src/out-paths.ts +10 -0
- package/src/render/hooks.ts +13 -0
- package/src/render/renderer.ts +53 -33
- package/src/request/context.ts +9 -0
- package/src/resolve/dynamic.ts +7 -1
- package/src/resolve/engine.ts +2 -12
- package/src/resolve/imports.ts +12 -52
- package/src/resolve/package-json.ts +56 -0
- package/src/resolve/scan-facts.ts +250 -1
- package/src/routing/href.ts +10 -3
- package/src/routing/match.ts +287 -0
- package/src/routing/metadata-files.ts +20 -6
- package/src/routing/proxy-config.ts +137 -0
- package/src/routing/proxy.ts +35 -134
- package/src/routing/routes.ts +22 -281
- package/src/runtime/fingerprint.ts +23 -8
- package/src/runtime/load.ts +170 -0
- package/src/runtime/loader.ts +218 -44
- package/src/runtime/module-cache.ts +15 -1
- package/src/runtime/modules.ts +405 -82
- package/src/runtime/prebundle.ts +101 -0
- package/src/runtime/production.ts +456 -0
- package/src/runtime/release-graph.ts +342 -0
- package/src/runtime/vendor-build.ts +750 -17
- package/src/runtime/vendor.ts +16 -3
- package/src/types.ts +4 -3
- package/src/utils/directive.ts +40 -0
- package/src/utils/fs.ts +95 -4
- package/src/utils/resource-query.ts +12 -0
- package/src/cli/serve/entry.ts +0 -45
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
getNextConfig
|
|
4
|
+
} from "./index-m63czgq5.js";
|
|
5
|
+
import {
|
|
6
|
+
setResourceHintListener
|
|
7
|
+
} from "./index-yhxkxghe.js";
|
|
8
|
+
import {
|
|
9
|
+
getWorkUnit
|
|
10
|
+
} from "./index-grta8ap3.js";
|
|
11
|
+
import {
|
|
12
|
+
registerResponseFinalizers
|
|
13
|
+
} from "./index-zqpqyg8p.js";
|
|
14
|
+
|
|
15
|
+
// src/compat/next/resource-hints.ts
|
|
16
|
+
var RESOURCE_HINTS_KEY = Symbol.for("pnext.compat.resourceHints");
|
|
17
|
+
var DEFAULT_REACT_MAX_HEADERS_LENGTH = 6000;
|
|
18
|
+
var resourceHintHeadersEnabled = true;
|
|
19
|
+
function enableResourceHintHeaders(enabled) {
|
|
20
|
+
resourceHintHeadersEnabled = enabled;
|
|
21
|
+
}
|
|
22
|
+
function registerResourceHintFinalizer() {
|
|
23
|
+
registerResponseFinalizers(resourceHintResponseFinalizer);
|
|
24
|
+
setResourceHintListener((hint) => recordResourceHint(hint));
|
|
25
|
+
}
|
|
26
|
+
function recordResourceHint(hint) {
|
|
27
|
+
const unit = getWorkUnit();
|
|
28
|
+
if (!unit)
|
|
29
|
+
return;
|
|
30
|
+
const existing = unit.compat?.[RESOURCE_HINTS_KEY] ?? [];
|
|
31
|
+
if (!unit.compat)
|
|
32
|
+
unit.compat = {};
|
|
33
|
+
unit.compat[RESOURCE_HINTS_KEY] = dedupeResourceHints([...existing, hint]);
|
|
34
|
+
}
|
|
35
|
+
function takeResourceHintsForResponse() {
|
|
36
|
+
const unit = getWorkUnit();
|
|
37
|
+
const compat = unit?.compat;
|
|
38
|
+
if (!compat)
|
|
39
|
+
return [];
|
|
40
|
+
const hints = compat[RESOURCE_HINTS_KEY] ?? [];
|
|
41
|
+
compat[RESOURCE_HINTS_KEY] = undefined;
|
|
42
|
+
return hints;
|
|
43
|
+
}
|
|
44
|
+
var ALLOWED_ROUTE_KINDS = new Set(["html", "data"]);
|
|
45
|
+
function resourceHintResponseFinalizer(ctx) {
|
|
46
|
+
if (!shouldEmitResourceHintsHeader())
|
|
47
|
+
return;
|
|
48
|
+
if (ctx.hints?.runtime === "edge")
|
|
49
|
+
return;
|
|
50
|
+
if (!ALLOWED_ROUTE_KINDS.has(ctx.routeKind))
|
|
51
|
+
return;
|
|
52
|
+
const value = takeResourceHintHeader();
|
|
53
|
+
if (value === undefined)
|
|
54
|
+
return;
|
|
55
|
+
const existing = ctx.headers.get("link");
|
|
56
|
+
ctx.headers.set("link", existing ? `${existing}, ${value}` : value);
|
|
57
|
+
}
|
|
58
|
+
function shouldEmitResourceHintsHeader() {
|
|
59
|
+
return resourceHintHeadersEnabled;
|
|
60
|
+
}
|
|
61
|
+
function getReactMaxHeadersLength() {
|
|
62
|
+
const configValue = getNextConfig().reactMaxHeadersLength;
|
|
63
|
+
if (typeof configValue === "number" && Number.isFinite(configValue) && configValue >= 0) {
|
|
64
|
+
return Math.floor(configValue);
|
|
65
|
+
}
|
|
66
|
+
const envValue = process.env.TEST_REACT_MAX_HEADERS_LENGTH;
|
|
67
|
+
if (typeof envValue === "string" && envValue.trim() !== "") {
|
|
68
|
+
const parsed = Number.parseInt(envValue, 10);
|
|
69
|
+
if (Number.isFinite(parsed) && parsed >= 0)
|
|
70
|
+
return Math.floor(parsed);
|
|
71
|
+
}
|
|
72
|
+
return DEFAULT_REACT_MAX_HEADERS_LENGTH;
|
|
73
|
+
}
|
|
74
|
+
function takeResourceHintHeader() {
|
|
75
|
+
const hints = takeResourceHintsForResponse();
|
|
76
|
+
if (hints.length === 0)
|
|
77
|
+
return;
|
|
78
|
+
const maxLength = getReactMaxHeadersLength();
|
|
79
|
+
if (!(maxLength > 0))
|
|
80
|
+
return;
|
|
81
|
+
const entries = hints.map((hint) => formatLinkHeaderEntry(hint)).filter(Boolean);
|
|
82
|
+
if (entries.length === 0)
|
|
83
|
+
return;
|
|
84
|
+
const values = [];
|
|
85
|
+
for (const entry of entries) {
|
|
86
|
+
const candidate = values.length > 0 ? `${values.join(", ")}, ${entry}` : entry;
|
|
87
|
+
if (candidate.length > maxLength)
|
|
88
|
+
break;
|
|
89
|
+
values.push(entry);
|
|
90
|
+
}
|
|
91
|
+
return values.length === 0 ? undefined : values.join(", ");
|
|
92
|
+
}
|
|
93
|
+
function formatLinkHeaderEntry(hint) {
|
|
94
|
+
const parts = [`<${hint.url}>`, `rel=${hint.rel}`];
|
|
95
|
+
if (hint.as)
|
|
96
|
+
parts.push(`as="${hint.as}"`);
|
|
97
|
+
if (hint.crossOrigin !== undefined)
|
|
98
|
+
parts.push(`crossorigin="${hint.crossOrigin === "anonymous" ? "" : hint.crossOrigin}"`);
|
|
99
|
+
if (hint.type)
|
|
100
|
+
parts.push(`type="${hint.type}"`);
|
|
101
|
+
if (hint.media)
|
|
102
|
+
parts.push(`media="${hint.media}"`);
|
|
103
|
+
if (hint.sizes)
|
|
104
|
+
parts.push(`sizes="${hint.sizes}"`);
|
|
105
|
+
if (hint.title)
|
|
106
|
+
parts.push(`title="${hint.title}"`);
|
|
107
|
+
if (hint.hrefLang)
|
|
108
|
+
parts.push(`hreflang="${hint.hrefLang}"`);
|
|
109
|
+
if (hint.fetchPriority)
|
|
110
|
+
parts.push(`fetchpriority="${hint.fetchPriority}"`);
|
|
111
|
+
if (hint.nonce)
|
|
112
|
+
parts.push(`nonce="${hint.nonce}"`);
|
|
113
|
+
return parts.join("; ");
|
|
114
|
+
}
|
|
115
|
+
function dedupeResourceHints(hints) {
|
|
116
|
+
if (hints.length <= 1)
|
|
117
|
+
return hints;
|
|
118
|
+
const seen = new Set;
|
|
119
|
+
const next = [];
|
|
120
|
+
for (const hint of hints) {
|
|
121
|
+
const key = formatLinkHeaderEntry(hint);
|
|
122
|
+
if (seen.has(key))
|
|
123
|
+
continue;
|
|
124
|
+
seen.add(key);
|
|
125
|
+
next.push(hint);
|
|
126
|
+
}
|
|
127
|
+
return next;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { enableResourceHintHeaders, registerResourceHintFinalizer, recordResourceHint, takeResourceHintsForResponse, takeResourceHintHeader };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
use
|
|
4
|
+
} from "./index-h4xy648y.js";
|
|
5
|
+
import {
|
|
6
|
+
useActionState
|
|
7
|
+
} from "./index-68m3mwbd.js";
|
|
8
|
+
import {
|
|
9
|
+
setSuspenseParity
|
|
10
|
+
} from "./index-w6h8m6vp.js";
|
|
11
|
+
import {
|
|
12
|
+
useOptimistic,
|
|
13
|
+
useTransition
|
|
14
|
+
} from "./index-j2zrcp1k.js";
|
|
15
|
+
|
|
16
|
+
// src/compat/react/preact.ts
|
|
17
|
+
import ReactCompat from "preact/compat";
|
|
18
|
+
setSuspenseParity({
|
|
19
|
+
beforeThrowSafety: applyAsyncClientComponent,
|
|
20
|
+
afterThrowSafety: applyThenableChildren
|
|
21
|
+
});
|
|
22
|
+
function applyThenableChildren(vnode) {
|
|
23
|
+
const props = vnode.props;
|
|
24
|
+
const children = props.children;
|
|
25
|
+
const resolved = thenableChildren(children);
|
|
26
|
+
if (resolved !== children)
|
|
27
|
+
props.children = resolved;
|
|
28
|
+
}
|
|
29
|
+
function thenableChildren(value) {
|
|
30
|
+
if (value && typeof value.then === "function") {
|
|
31
|
+
return ReactCompat.createElement(ReactCompat.Suspense, { fallback: null }, ReactCompat.createElement(ThenableChild, {
|
|
32
|
+
value
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
if (!Array.isArray(value))
|
|
36
|
+
return value;
|
|
37
|
+
let changed = false;
|
|
38
|
+
const children = value.map((child) => {
|
|
39
|
+
const resolved = thenableChildren(child);
|
|
40
|
+
if (resolved !== child)
|
|
41
|
+
changed = true;
|
|
42
|
+
return resolved;
|
|
43
|
+
});
|
|
44
|
+
return changed ? children : value;
|
|
45
|
+
}
|
|
46
|
+
function ThenableChild({ value }) {
|
|
47
|
+
return use(value);
|
|
48
|
+
}
|
|
49
|
+
var asyncClientComponents = new WeakMap;
|
|
50
|
+
function applyAsyncClientComponent(vnode) {
|
|
51
|
+
if (typeof window === "undefined" || typeof vnode.type !== "function")
|
|
52
|
+
return;
|
|
53
|
+
const component = vnode.type;
|
|
54
|
+
if (component.constructor.name !== "AsyncFunction")
|
|
55
|
+
return;
|
|
56
|
+
const renderComponent = component;
|
|
57
|
+
let wrapper = asyncClientComponents.get(component);
|
|
58
|
+
if (!wrapper) {
|
|
59
|
+
wrapper = (props) => {
|
|
60
|
+
const [result] = ReactCompat.useState(() => Promise.resolve(renderComponent(props)));
|
|
61
|
+
return ReactCompat.createElement(ReactCompat.Suspense, { fallback: null }, ReactCompat.createElement(ThenableChild, { value: result }));
|
|
62
|
+
};
|
|
63
|
+
asyncClientComponents.set(component, wrapper);
|
|
64
|
+
}
|
|
65
|
+
vnode.type = wrapper;
|
|
66
|
+
}
|
|
67
|
+
var preactUseSyncExternalStore = ReactCompat.useSyncExternalStore;
|
|
68
|
+
function serverSnapshotAware(subscribe, getSnapshot, getServerSnapshot) {
|
|
69
|
+
if (typeof window === "undefined") {
|
|
70
|
+
if (!getServerSnapshot)
|
|
71
|
+
throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
|
|
72
|
+
return getServerSnapshot();
|
|
73
|
+
}
|
|
74
|
+
return preactUseSyncExternalStore(subscribe, getSnapshot);
|
|
75
|
+
}
|
|
76
|
+
var useSyncExternalStore = serverSnapshotAware;
|
|
77
|
+
var preact_default = Object.assign(ReactCompat, { use, useActionState, useOptimistic, useTransition });
|
|
78
|
+
if (true)
|
|
79
|
+
ReactCompat.useSyncExternalStore = useSyncExternalStore;
|
|
80
|
+
var Children = ReactCompat.Children;
|
|
81
|
+
var Component = ReactCompat.Component;
|
|
82
|
+
var Fragment = ReactCompat.Fragment;
|
|
83
|
+
var PureComponent = ReactCompat.PureComponent;
|
|
84
|
+
var StrictMode = ReactCompat.StrictMode;
|
|
85
|
+
var Suspense = ReactCompat.Suspense;
|
|
86
|
+
var SuspenseList = ReactCompat.SuspenseList;
|
|
87
|
+
var cloneElement = ReactCompat.cloneElement;
|
|
88
|
+
var createContext = ReactCompat.createContext;
|
|
89
|
+
var createElement = ReactCompat.createElement;
|
|
90
|
+
var createFactory = ReactCompat.createFactory;
|
|
91
|
+
var createPortal = ReactCompat.createPortal;
|
|
92
|
+
var createRef = ReactCompat.createRef;
|
|
93
|
+
var findDOMNode = ReactCompat.findDOMNode;
|
|
94
|
+
var flushSync = ReactCompat.flushSync;
|
|
95
|
+
var forwardRef = ReactCompat.forwardRef;
|
|
96
|
+
var hydrate = ReactCompat.hydrate;
|
|
97
|
+
var isFragment = ReactCompat.isFragment;
|
|
98
|
+
var isMemo = ReactCompat.isMemo;
|
|
99
|
+
var isValidElement = ReactCompat.isValidElement;
|
|
100
|
+
var lazy = (loader) => {
|
|
101
|
+
const component = ReactCompat.lazy(loader);
|
|
102
|
+
component[Symbol.for("pnext.lazy")] = true;
|
|
103
|
+
return component;
|
|
104
|
+
};
|
|
105
|
+
var memo = ReactCompat.memo;
|
|
106
|
+
var render = ReactCompat.render;
|
|
107
|
+
var startTransition = ReactCompat.startTransition;
|
|
108
|
+
var unmountComponentAtNode = ReactCompat.unmountComponentAtNode;
|
|
109
|
+
var unstable_batchedUpdates = ReactCompat.unstable_batchedUpdates;
|
|
110
|
+
var useCallback = ReactCompat.useCallback;
|
|
111
|
+
var useContext = ReactCompat.useContext;
|
|
112
|
+
var useDebugValue = ReactCompat.useDebugValue;
|
|
113
|
+
var useDeferredValue = ReactCompat.useDeferredValue;
|
|
114
|
+
var useEffect = ReactCompat.useEffect;
|
|
115
|
+
var useId = ReactCompat.useId;
|
|
116
|
+
var useImperativeHandle = ReactCompat.useImperativeHandle;
|
|
117
|
+
var useInsertionEffect = ReactCompat.useInsertionEffect;
|
|
118
|
+
var useLayoutEffect = ReactCompat.useLayoutEffect;
|
|
119
|
+
var useMemo = ReactCompat.useMemo;
|
|
120
|
+
var useReducer = ReactCompat.useReducer;
|
|
121
|
+
var useRef = ReactCompat.useRef;
|
|
122
|
+
var useState = ReactCompat.useState;
|
|
123
|
+
var version = ReactCompat.version;
|
|
124
|
+
|
|
125
|
+
export { useSyncExternalStore, preact_default, Children, Component, Fragment, PureComponent, StrictMode, Suspense, SuspenseList, cloneElement, createContext, createElement, createFactory, createPortal, createRef, findDOMNode, flushSync, forwardRef, hydrate, isFragment, isMemo, isValidElement, lazy, memo, render, startTransition, unmountComponentAtNode, unstable_batchedUpdates, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, version };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/compat/next/image/patterns.ts
|
|
3
|
+
function makePathnameRegex(pathname) {
|
|
4
|
+
let source = "";
|
|
5
|
+
const escaped = pathname.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
|
|
6
|
+
source = escaped.replace(/\/\*\*/g, "(?:/.*)?").replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*");
|
|
7
|
+
return new RegExp(`^${source}$`);
|
|
8
|
+
}
|
|
9
|
+
function hasLocalMatch(localPatterns, url) {
|
|
10
|
+
if (localPatterns === undefined)
|
|
11
|
+
return true;
|
|
12
|
+
return localPatterns.some((pattern) => {
|
|
13
|
+
if (pattern.pathname !== undefined && !makePathnameRegex(pattern.pathname).test(url.pathname)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (pattern.search !== undefined && pattern.search !== url.search)
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function hasRemoteMatch(domains, remotePatterns, url) {
|
|
22
|
+
if (domains.includes(url.hostname))
|
|
23
|
+
return true;
|
|
24
|
+
return remotePatterns.some((pattern) => {
|
|
25
|
+
if (pattern.protocol !== undefined && pattern.protocol !== url.protocol.replace(/:$/, "")) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (pattern.hostname !== undefined && !matchHostname(pattern.hostname, url.hostname)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (pattern.port !== undefined && pattern.port !== "" && pattern.port !== url.port) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (pattern.pathname !== undefined && !makePathnameRegex(pattern.pathname).test(url.pathname)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (pattern.search !== undefined && pattern.search !== "" && pattern.search !== url.search) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function matchHostname(pattern, hostname) {
|
|
44
|
+
if (pattern.startsWith("**.")) {
|
|
45
|
+
const suffix = pattern.slice(2);
|
|
46
|
+
return hostname.endsWith(suffix) && hostname.length > suffix.length;
|
|
47
|
+
}
|
|
48
|
+
if (pattern.startsWith("*.")) {
|
|
49
|
+
const suffix = pattern.slice(1);
|
|
50
|
+
if (!hostname.endsWith(suffix))
|
|
51
|
+
return false;
|
|
52
|
+
const sub = hostname.slice(0, -suffix.length);
|
|
53
|
+
return sub.length > 0 && !sub.includes(".");
|
|
54
|
+
}
|
|
55
|
+
return pattern === hostname;
|
|
56
|
+
}
|
|
57
|
+
function manifestLocalPatterns(localPatterns) {
|
|
58
|
+
const patterns = localPatterns ?? [{ pathname: undefined, search: "" }];
|
|
59
|
+
const entries = patterns.map((pattern) => ({
|
|
60
|
+
pathname: compileLocalPathname(pattern.pathname),
|
|
61
|
+
search: pattern.search ?? ""
|
|
62
|
+
}));
|
|
63
|
+
return entries;
|
|
64
|
+
}
|
|
65
|
+
function compileLocalPathname(pathname) {
|
|
66
|
+
if (pathname === undefined || pathname === "**") {
|
|
67
|
+
return "^(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?)\\/?)$";
|
|
68
|
+
}
|
|
69
|
+
const base = pathname.replace(/\/\*\*$/, "");
|
|
70
|
+
const escaped = base.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\//g, "\\/");
|
|
71
|
+
return `^(?:${escaped}(?:\\/(?!\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?)|$))$`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { hasLocalMatch, hasRemoteMatch, manifestLocalPatterns };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
traceEnabled
|
|
4
|
+
} from "./index-vz0km5qk.js";
|
|
5
|
+
|
|
6
|
+
// src/cli/boot/trace.ts
|
|
7
|
+
import { loadavg, cpus, arch, platform } from "os";
|
|
8
|
+
import { readdirSync } from "fs";
|
|
9
|
+
import path from "path";
|
|
10
|
+
var enabled = traceEnabled("boot");
|
|
11
|
+
var marks = [];
|
|
12
|
+
var cacheAtStart = enabled ? cacheState() : "cold";
|
|
13
|
+
function cacheState() {
|
|
14
|
+
return countTopLevel(path.join(".pnext", "dev", "cache")) > 0 ? "warm" : "cold";
|
|
15
|
+
}
|
|
16
|
+
var rss = () => typeof process.memoryUsage.rss === "function" ? process.memoryUsage.rss() : process.memoryUsage().rss;
|
|
17
|
+
function markBoot(name) {
|
|
18
|
+
if (enabled)
|
|
19
|
+
marks.push([name, performance.now(), rss()]);
|
|
20
|
+
}
|
|
21
|
+
function traceHeader() {
|
|
22
|
+
const load = loadavg().map((value) => value.toFixed(1)).join(" ");
|
|
23
|
+
const packages = countTopLevel("node_modules");
|
|
24
|
+
return [
|
|
25
|
+
` runtime ${typeof Bun !== "undefined" ? `bun ${Bun.version}` : `node ${process.version}`} \xB7 ${platform()} ${arch()} \xB7 ${cpus().length} cpus \xB7 load ${load}`,
|
|
26
|
+
` app ${packages} node_modules entries \xB7 .pnext/dev cache ${cacheAtStart}`
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
function countTopLevel(dir) {
|
|
30
|
+
try {
|
|
31
|
+
return readdirSync(path.resolve(dir)).length;
|
|
32
|
+
} catch {
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function printBootTrace() {
|
|
37
|
+
if (!enabled || marks.length === 0)
|
|
38
|
+
return;
|
|
39
|
+
const lines = ["boot trace (ms since process start):", ...traceHeader()];
|
|
40
|
+
let previous = 0;
|
|
41
|
+
for (const [name, at, rss2] of marks) {
|
|
42
|
+
const mb = (rss2 / 1048576).toFixed(0).padStart(5);
|
|
43
|
+
lines.push(` ${name.padEnd(16)} +${(at - previous).toFixed(1).padStart(7)} @${at.toFixed(1)} rss ${mb} MB`);
|
|
44
|
+
previous = at;
|
|
45
|
+
}
|
|
46
|
+
lines.push(` total @${performance.now().toFixed(1)}`);
|
|
47
|
+
console.log(lines.join(`
|
|
48
|
+
`));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { markBoot, printBootTrace };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
onExtensionHostReset
|
|
4
|
+
} from "./index-zqpqyg8p.js";
|
|
5
|
+
import {
|
|
6
|
+
__require
|
|
7
|
+
} from "./index-rt9qq1va.js";
|
|
8
|
+
|
|
9
|
+
// src/runtime/fetch-host.ts
|
|
10
|
+
var installed = false;
|
|
11
|
+
var upstreamAborts = new WeakMap;
|
|
12
|
+
function isHostKey(key) {
|
|
13
|
+
return typeof key === "string" && key.length === 4 && key.toLowerCase() === "host";
|
|
14
|
+
}
|
|
15
|
+
function hasHost(headers) {
|
|
16
|
+
if (headers instanceof Headers)
|
|
17
|
+
return headers.has("host");
|
|
18
|
+
if (Array.isArray(headers)) {
|
|
19
|
+
for (const entry of headers)
|
|
20
|
+
if (isHostKey(entry?.[0]))
|
|
21
|
+
return true;
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
for (const key in headers)
|
|
25
|
+
if (isHostKey(key))
|
|
26
|
+
return true;
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
function withoutHost(headers) {
|
|
30
|
+
const next = new Headers(headers);
|
|
31
|
+
next.delete("host");
|
|
32
|
+
return next;
|
|
33
|
+
}
|
|
34
|
+
function installFetchHostNormalization() {
|
|
35
|
+
if (installed)
|
|
36
|
+
return;
|
|
37
|
+
installed = true;
|
|
38
|
+
const original = globalThis.fetch.bind(globalThis);
|
|
39
|
+
globalThis.fetch = function fetch(input, init) {
|
|
40
|
+
const source = init?.headers ?? (input instanceof Request ? input.headers : undefined);
|
|
41
|
+
const normalized = source !== undefined && hasHost(source) ? { ...init, headers: withoutHost(source) } : init;
|
|
42
|
+
return trackUpstream(original, input, normalized);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function trackUpstream(original, input, init) {
|
|
46
|
+
const controller = new AbortController;
|
|
47
|
+
const caller = init?.signal ?? (input instanceof Request ? input.signal : undefined);
|
|
48
|
+
const signal = caller ? AbortSignal.any([caller, controller.signal]) : controller.signal;
|
|
49
|
+
return original(input, { ...init, signal }).then((response) => {
|
|
50
|
+
if (response.body)
|
|
51
|
+
upstreamAborts.set(response.body, controller);
|
|
52
|
+
return response;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function abortUpstreamFetchOnDisconnect(body, signal) {
|
|
56
|
+
if (!body || !signal || !upstreamAborts.has(body))
|
|
57
|
+
return;
|
|
58
|
+
const abort = () => {
|
|
59
|
+
const controller = upstreamAborts.get(body);
|
|
60
|
+
if (!controller)
|
|
61
|
+
return;
|
|
62
|
+
upstreamAborts.delete(body);
|
|
63
|
+
controller.abort();
|
|
64
|
+
};
|
|
65
|
+
if (signal.aborted)
|
|
66
|
+
abort();
|
|
67
|
+
else
|
|
68
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/compat-bootstrap.ts
|
|
72
|
+
function compatEnabled(config) {
|
|
73
|
+
const compat = config.compat;
|
|
74
|
+
return Boolean(compat?.next || compat?.react || compat?.reactCompiler);
|
|
75
|
+
}
|
|
76
|
+
var bootRegistration;
|
|
77
|
+
var registration;
|
|
78
|
+
onExtensionHostReset(() => {
|
|
79
|
+
bootRegistration = undefined;
|
|
80
|
+
registration = undefined;
|
|
81
|
+
});
|
|
82
|
+
function bootstrapCompatBoot(config) {
|
|
83
|
+
installFetchHostNormalization();
|
|
84
|
+
if (!compatEnabled(config))
|
|
85
|
+
return Promise.resolve();
|
|
86
|
+
bootRegistration ??= import("./boot-bhemypxz.js").then((module) => module.registerCompatBootExtensions(config));
|
|
87
|
+
return bootRegistration;
|
|
88
|
+
}
|
|
89
|
+
function bootstrapCompat(config, options = {}) {
|
|
90
|
+
installFetchHostNormalization();
|
|
91
|
+
if (!compatEnabled(config))
|
|
92
|
+
return Promise.resolve();
|
|
93
|
+
registration ??= bootstrapCompatBoot(config).then(() => import("./index-dgr390q7.js")).then((module) => module.registerCompatExtensions(config, options));
|
|
94
|
+
return registration;
|
|
95
|
+
}
|
|
96
|
+
async function generateCompatRouteTypes(config, routes) {
|
|
97
|
+
if (!config.compat?.next)
|
|
98
|
+
return;
|
|
99
|
+
const [{ writeTsconfigDefaults }, { generateTypedRoutes }] = await Promise.all([
|
|
100
|
+
import("./tsconfig-defaults-bcn34eqb.js"),
|
|
101
|
+
import("./generate-myw9hef7.js")
|
|
102
|
+
]);
|
|
103
|
+
await writeTsconfigDefaults(config);
|
|
104
|
+
await generateTypedRoutes(config, routes);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { abortUpstreamFetchOnDisconnect, bootstrapCompatBoot, bootstrapCompat, generateCompatRouteTypes };
|