@absolutejs/absolute 0.20.0-beta.130 → 0.20.0-beta.131
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/CHANGELOG.md +21 -0
- package/changelog.json +41 -0
- package/dist/angular/browser.js +406 -396
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -3
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -4
- package/dist/angular/index.js +560 -701
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +197 -338
- package/dist/angular/server.js.map +5 -5
- package/dist/build/buildWorker.js +27 -35
- package/dist/build.js +3833 -5876
- package/dist/build.js.map +4 -4
- package/dist/cli/{add-9sa7e3vd.js → add-hvqeg5sz.js} +23 -25
- package/dist/cli/{analyze-c1sep5y9.js → analyze-c2x2aym5.js} +6 -7
- package/dist/cli/androidEmulatorController-j73a1br6.js +22 -0
- package/dist/cli/{androidNativeWatcher-dnp95nk2.js → androidNativeWatcher-ctbnsr1v.js} +11 -14
- package/dist/cli/{api-2hd8cahp.js → api-rk13rfd9.js} +11 -13
- package/dist/cli/{build-857rc1ds.js → build-20y4b6rj.js} +8 -9
- package/dist/cli/{buildDepVendor-8akhr8n8.js → buildDepVendor-axqvbbm6.js} +5 -170
- package/dist/cli/{compile-9by2vxy5.js → compile-qygwqezx.js} +43 -48
- package/dist/cli/config/client.js +8 -8
- package/dist/cli/config/server.js +5615 -5595
- package/dist/cli/config-3te1fbry.js +7 -0
- package/dist/cli/{db-8wweexdp.js → db-p8pc325y.js} +5 -13
- package/dist/cli/{dev-qg7fr16s.js → dev-6f0gry3y.js} +75 -77
- package/dist/cli/{devCert-avr89zf3.js → devCert-n33ep8pg.js} +0 -3
- package/dist/cli/{doctor-mbh9bk05.js → doctor-8rm8p4dm.js} +13 -14
- package/dist/cli/emulatorDoctor-cwa70kgt.js +17 -0
- package/dist/cli/emulatorInstaller-dx3fmm2m.js +14 -0
- package/dist/cli/env-2107nff1.js +11 -0
- package/dist/cli/eslint-zz0t0kfp.js +17 -0
- package/dist/cli/eslintChunked-wg10jj9m.js +12 -0
- package/dist/cli/expoDevController-s70fj7vf.js +16 -0
- package/dist/cli/{expoNativeWatcher-rmc95bak.js → expoNativeWatcher-aakp7xvj.js} +1 -5
- package/dist/cli/expoProject-zy02tbfg.js +10 -0
- package/dist/cli/{generate-069p0dk3.js → generate-nz4w03yz.js} +19 -21
- package/dist/cli/{heapDiff-87v24x7p.js → heapDiff-2etr2r26.js} +5 -6
- package/dist/cli/{htmx-5wh1jh75.js → htmx-0xcaqrny.js} +12 -14
- package/dist/cli/{index-sjvydg2r.js → index-1ff9q1vx.js} +7 -7
- package/dist/cli/{index-rqbk0b30.js → index-1qewxkgy.js} +26 -26
- package/dist/cli/{index-prwyfnn3.js → index-1x1vah31.js} +2 -2
- package/dist/cli/{index-ddakkws4.js → index-31j3beht.js} +13 -13
- package/dist/cli/{index-j2nw3edf.js → index-3gtnqd57.js} +5 -5
- package/dist/cli/{index-54q7pxcx.js → index-434b7j4a.js} +2 -32
- package/dist/cli/{index-w5vswatm.js → index-43a1vvb7.js} +6 -10
- package/dist/cli/{index-nxcwg9ma.js → index-5sjk7daj.js} +31 -31
- package/dist/cli/{index-6j1xaheg.js → index-73sk1ney.js} +5 -5
- package/dist/cli/{index-3x5wpx5d.js → index-8kdmmgvc.js} +2 -2
- package/dist/cli/{index-1ys3dnrs.js → index-8w2wazrk.js} +34 -34
- package/dist/cli/{index-wtfnv3n2.js → index-92hmw204.js} +3 -3
- package/dist/cli/{index-vdbn8brx.js → index-9ehbfmeq.js} +38 -41
- package/dist/cli/{index-mywsk201.js → index-fde3c297.js} +1 -1
- package/dist/cli/{index-255xs63d.js → index-j57pgg5m.js} +10 -10
- package/dist/cli/{index-5cgsrv62.js → index-jcjwsdqt.js} +13 -182
- package/dist/cli/{index-00wfffav.js → index-k4t9k1xk.js} +5 -5
- package/dist/cli/{index-yxgaf8j0.js → index-m1vntzf1.js} +7 -5
- package/dist/cli/{index-9r7n9dqp.js → index-ma1dw7x2.js} +1 -1
- package/dist/cli/index-pch0v1z6.js +60 -0
- package/dist/cli/{index-8nym68py.js → index-ppxed116.js} +1 -1
- package/dist/cli/{index-9kwmb3c0.js → index-qyxd5n9a.js} +3 -3
- package/dist/cli/{index-tn4crd40.js → index-r62705dc.js} +12 -12
- package/dist/cli/{index-wctgx65x.js → index-r6k4xmdb.js} +21 -21
- package/dist/cli/{index-hty8111z.js → index-r915cvqp.js} +17 -17
- package/dist/cli/{index-exdd5k1g.js → index-rrxeqrbn.js} +2 -2
- package/dist/cli/{index-keg69zm1.js → index-snbzdwb9.js} +5 -5
- package/dist/cli/{index-v26ze17p.js → index-thqwfzy8.js} +3 -3
- package/dist/cli/{index-0hr7c4qe.js → index-vdnmqkt8.js} +14 -18
- package/dist/cli/{index-vkkqe08e.js → index-vj2v38sq.js} +29 -29
- package/dist/cli/{index-erngp7a9.js → index-wy0yh4jj.js} +16 -16
- package/dist/cli/{index-1cypb2zn.js → index-xcr3r6a1.js} +8 -8
- package/dist/cli/index.js +44 -48
- package/dist/cli/{info-d74dr585.js → info-kx5510rq.js} +7 -7
- package/dist/cli/{inspect-23chj4nc.js → inspect-5dj06x0m.js} +18 -20
- package/dist/cli/{iosNativeWatcher-kggp7j9a.js → iosNativeWatcher-zx49pzej.js} +12 -16
- package/dist/cli/iosSimulatorController-haa1cc3p.js +23 -0
- package/dist/cli/{islands-wpqgmwh0.js → islands-z4adh55n.js} +8 -9
- package/dist/cli/{lintProof-wx3b6dzy.js → lintProof-qcwdvzcz.js} +12 -17
- package/dist/cli/{logs-bx2n5ey6.js → logs-3p2vrq5h.js} +8 -10
- package/dist/cli/{ls-kvmcmd2j.js → ls-nkspq73y.js} +13 -14
- package/dist/cli/{mem-apbk7bx4.js → mem-h3f497cr.js} +10 -14
- package/dist/cli/{migrate-p4rp5r6b.js → migrate-52bqqp08.js} +7 -8
- package/dist/cli/{mobile-43q3zmjf.js → mobile-w295dx0t.js} +572 -575
- package/dist/cli/nativeAuth-ysv0x5dy.js +27 -0
- package/dist/cli/patchedBun-m7vj5sks.js +9 -0
- package/dist/cli/prerender-mfnwsvyt.js +7 -0
- package/dist/cli/{prettier-vtk5yaw4.js → prettier-c1624g36.js} +2 -6
- package/dist/cli/{ps-8y28kzmb.js → ps-0jedm91n.js} +12 -16
- package/dist/cli/{psTui-8e96mwgz.js → psTui-tpr5nbmc.js} +28 -30
- package/dist/cli/remoteMacProtocol-v3ax0y0f.js +41 -0
- package/dist/cli/{remove-3fd1z2hx.js → remove-z0brj5nd.js} +16 -18
- package/dist/cli/{rewriteImports-d1gmaa68.js → rewriteImports-k6rjjmg1.js} +2 -100
- package/dist/cli/{routes-0xpanj8z.js → routes-ey0sw1eq.js} +7 -9
- package/dist/cli/start-36w63t6h.js +20 -0
- package/dist/cli/telemetry-3wnc06wa.js +9 -0
- package/dist/cli/{tunnelRelay-5at2v8w6.js → tunnelRelay-19ay0fxn.js} +3 -4
- package/dist/cli/{typecheck-yj9s13eb.js → typecheck-nmf6e7k7.js} +147 -149
- package/dist/cli/{workspace-m56sgfkc.js → workspace-yetzedke.js} +32 -36
- package/dist/client/chunks/{index-dk743xs6.js → index-8m2qq61n.js} +12 -8
- package/dist/client/chunks/{index-dk743xs6.js.map → index-8m2qq61n.js.map} +4 -3
- package/dist/client/chunks/{index-m35nbkdp.js → islands-rc28k5sx.js} +104 -42
- package/dist/client/chunks/islands-rc28k5sx.js.map +15 -0
- package/dist/client/chunks/{react-yq4ss9y4.js → react-dcvkaba2.js} +5 -7
- package/dist/client/chunks/{react-yq4ss9y4.js.map → react-dcvkaba2.js.map} +2 -2
- package/dist/client/chunks/{svelte-s0c964kb.js → svelte-4yfa5bxa.js} +2 -4
- package/dist/client/chunks/{svelte-s0c964kb.js.map → svelte-4yfa5bxa.js.map} +2 -2
- package/dist/client/chunks/{vue-rdskrnyg.js → vue-a84fzp3v.js} +2 -4
- package/dist/client/chunks/{vue-rdskrnyg.js.map → vue-a84fzp3v.js.map} +2 -2
- package/dist/client/index.js +42 -15
- package/dist/client/index.js.map +2 -2
- package/dist/client/prefetch.js +1 -3
- package/dist/client/prefetch.js.map +2 -2
- package/dist/core/streamingSlotRegistrar.js +1 -64
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +1 -64
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/dev/serverBootstrap.js +1802 -2018
- package/dist/index.js +5247 -8794
- package/dist/index.js.map +9 -20
- package/dist/islands/browser.js +13 -3
- package/dist/islands/browser.js.map +2 -2
- package/dist/islands/index.js +26 -142
- package/dist/islands/index.js.map +2 -2
- package/dist/mobile/browser.js +13 -3
- package/dist/mobile/browser.js.map +2 -2
- package/dist/mobile/index.js +1067 -2182
- package/dist/mobile/index.js.map +2 -2
- package/dist/mobile/remoteMacAgentEntry.js +156 -156
- package/dist/mobile/shellAuth.js +0 -16
- package/dist/mobile/shellBootstrap.js +734 -724
- package/dist/mobile/shellExpoAuth.js +4 -18
- package/dist/mobile/shellExpoDevices.js +0 -16
- package/dist/mobile/shellExpoSync.js +0 -16
- package/dist/mobile/shellSync.js +3 -19
- package/dist/mobile/shellUpdate.js +5 -21
- package/dist/mobile/uiPrimitives.js +0 -16
- package/dist/react/browser.js +15 -5
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/index.js +68 -58
- package/dist/react/components/index.js.map +4 -4
- package/dist/react/hooks/index.js +1 -63
- package/dist/react/hooks/index.js.map +2 -2
- package/dist/react/index.js +56 -195
- package/dist/react/index.js.map +5 -5
- package/dist/react/jsxDevRuntimeCompat.js +1 -64
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/jsxRuntimeCompat.js +1 -64
- package/dist/react/jsxRuntimeCompat.js.map +2 -2
- package/dist/react/router/browser.js +1 -64
- package/dist/react/router/browser.js.map +2 -2
- package/dist/react/router/index.js +1 -64
- package/dist/react/router/index.js.map +2 -2
- package/dist/react/server.js +38 -51
- package/dist/react/server.js.map +5 -5
- package/dist/src/cli/config/server.d.ts +7 -129
- package/dist/src/cli/patchedBun.d.ts +14 -14
- package/dist/src/core/prepare.d.ts +149 -1805
- package/dist/src/core/requestContext.d.ts +1 -1
- package/dist/src/dev/requestInspector.d.ts +1 -1
- package/dist/src/mobile/associationFiles.d.ts +2 -2
- package/dist/src/mobile/compatibilityDispatcher.d.ts +1 -1
- package/dist/src/mobile/mobilePreview.d.ts +8 -130
- package/dist/src/mobile/updateServer.d.ts +2 -2
- package/dist/src/plugins/devtoolsJson.d.ts +2 -2
- package/dist/src/plugins/hmr.d.ts +2 -2
- package/dist/src/plugins/imageOptimizer.d.ts +2 -151
- package/dist/src/plugins/telemetryPlugin.d.ts +1 -19
- package/dist/svelte/browser.js +13 -3
- package/dist/svelte/browser.js.map +2 -2
- package/dist/svelte/index.js +66 -210
- package/dist/svelte/index.js.map +5 -5
- package/dist/svelte/server.js +51 -99
- package/dist/svelte/server.js.map +5 -5
- package/dist/types/globals.d.ts +0 -6
- package/dist/vue/browser.js +13 -3
- package/dist/vue/browser.js.map +2 -2
- package/dist/vue/components/Image.js +13 -3
- package/dist/vue/components/Image.js.map +2 -2
- package/dist/vue/components/index.js +62 -50
- package/dist/vue/components/index.js.map +4 -4
- package/dist/vue/index.js +1115 -1258
- package/dist/vue/index.js.map +10 -10
- package/dist/vue/server.js +42 -59
- package/dist/vue/server.js.map +5 -5
- package/package.json +9 -9
- package/dist/cli/androidEmulatorController-sj141e1c.js +0 -30
- package/dist/cli/config-rjeexvza.js +0 -8
- package/dist/cli/emulatorDoctor-gzarrsex.js +0 -18
- package/dist/cli/emulatorInstaller-pjw4ex6q.js +0 -15
- package/dist/cli/env-4f6f6z69.js +0 -14
- package/dist/cli/eslint-qfkxe89p.js +0 -20
- package/dist/cli/eslintChunked-7ef700pn.js +0 -21
- package/dist/cli/expoDevController-weywa74d.js +0 -26
- package/dist/cli/expoProject-w2pzjwnx.js +0 -11
- package/dist/cli/index-1rabqyq0.js +0 -7
- package/dist/cli/index-ar4gz15x.js +0 -60
- package/dist/cli/iosSimulatorController-xcxxfkzx.js +0 -34
- package/dist/cli/nativeAuth-zx4tsb1f.js +0 -38
- package/dist/cli/patchedBun-zjtrn2s4.js +0 -38
- package/dist/cli/prerender-yex2zwj3.js +0 -18
- package/dist/cli/remoteMacProtocol-r38jhg44.js +0 -69
- package/dist/cli/start-gzhrkhxe.js +0 -23
- package/dist/cli/telemetry-94rka1w2.js +0 -14
- package/dist/client/chunks/angularPatch-arh4sr68.js +0 -157
- package/dist/client/chunks/angularPatch-arh4sr68.js.map +0 -10
- package/dist/client/chunks/index-jrcwp722.js +0 -12
- package/dist/client/chunks/index-jrcwp722.js.map +0 -10
- package/dist/client/chunks/index-m35nbkdp.js.map +0 -12
- package/dist/client/chunks/index-qxjc7kc5.js +0 -12
- package/dist/client/chunks/index-qxjc7kc5.js.map +0 -9
- package/dist/client/chunks/islands-50dg63j9.js +0 -284
- package/dist/client/chunks/islands-50dg63j9.js.map +0 -14
- /package/dist/cli/{index-me8nczrw.js → index-039rh39e.js} +0 -0
- /package/dist/cli/{index-bw4ktfnz.js → index-1y5mmnwg.js} +0 -0
- /package/dist/cli/{index-5xfxd7xa.js → index-3wm8p7rg.js} +0 -0
- /package/dist/cli/{index-4rme31py.js → index-420h9hq7.js} +0 -0
- /package/dist/cli/{index-4rhxthsy.js → index-65kqn88a.js} +0 -0
- /package/dist/cli/{index-r8x3839e.js → index-71gchbzt.js} +0 -0
- /package/dist/cli/{index-s2tazax7.js → index-92g14j47.js} +0 -0
- /package/dist/cli/{index-j66p8hn5.js → index-bwsa6ax4.js} +0 -0
- /package/dist/cli/{index-bzs19w3r.js → index-e6ysp900.js} +0 -0
- /package/dist/cli/{index-06cmrcdq.js → index-h7qhz02e.js} +0 -0
- /package/dist/cli/{index-6h54jqdq.js → index-hg54jyts.js} +0 -0
- /package/dist/cli/{index-czwrxgdj.js → index-hxqprc80.js} +0 -0
- /package/dist/cli/{index-zh6hhrwy.js → index-jjfbjv1z.js} +0 -0
- /package/dist/cli/{index-fc9vxw56.js → index-prs14ys9.js} +0 -0
- /package/dist/cli/{index-v1k46q3x.js → index-tx0kx9zx.js} +0 -0
- /package/dist/cli/{index-fhaf3tdk.js → index-x8x0f3ha.js} +0 -0
- /package/dist/cli/{index-18q9qc7f.js → index-ypcqx24p.js} +0 -0
package/dist/vue/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
return cached;
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
22
|
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
23
|
for (let key of __getOwnPropNames(mod))
|
|
24
24
|
if (!__hasOwnProp.call(to, key))
|
|
@@ -59,29 +59,19 @@ var __legacyMetadataTS = (k, v) => {
|
|
|
59
59
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
60
60
|
return Reflect.metadata(k, v);
|
|
61
61
|
};
|
|
62
|
-
var __esm = (fn, res) => () =>
|
|
62
|
+
var __esm = (fn, res, err) => () => {
|
|
63
|
+
if (fn)
|
|
64
|
+
try {
|
|
65
|
+
res = fn(fn = 0);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
err = [e];
|
|
68
|
+
}
|
|
69
|
+
if (err)
|
|
70
|
+
throw err[0];
|
|
71
|
+
return res;
|
|
72
|
+
};
|
|
63
73
|
var __require = import.meta.require;
|
|
64
74
|
|
|
65
|
-
// src/constants.ts
|
|
66
|
-
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
67
|
-
var init_constants = __esm(() => {
|
|
68
|
-
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
69
|
-
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
70
|
-
640,
|
|
71
|
-
750,
|
|
72
|
-
828,
|
|
73
|
-
1080,
|
|
74
|
-
1200,
|
|
75
|
-
1920,
|
|
76
|
-
2048,
|
|
77
|
-
3840
|
|
78
|
-
];
|
|
79
|
-
IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
80
|
-
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
81
|
-
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
82
|
-
TWO_THIRDS = 2 / 3;
|
|
83
|
-
});
|
|
84
|
-
|
|
85
75
|
// src/utils/inlinePageCss.ts
|
|
86
76
|
var siblingCssCache, clearSiblingCssCache = () => {
|
|
87
77
|
siblingCssCache.clear();
|
|
@@ -286,14 +276,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
286
276
|
});
|
|
287
277
|
return { body, styles };
|
|
288
278
|
}, renderVueError = async (conventionPath, errorProps) => {
|
|
289
|
-
const { createSSRApp, h
|
|
279
|
+
const { createSSRApp, h } = await import("vue");
|
|
290
280
|
const { renderToString } = await import("vue/server-renderer");
|
|
291
281
|
const mod = await import(conventionPath);
|
|
292
282
|
const ErrorComponent = mod.default;
|
|
293
283
|
if (!ErrorComponent)
|
|
294
284
|
return null;
|
|
295
285
|
const app = createSSRApp({
|
|
296
|
-
render: () =>
|
|
286
|
+
render: () => h(ErrorComponent, errorProps)
|
|
297
287
|
});
|
|
298
288
|
const rawBody = await renderToString(app);
|
|
299
289
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
@@ -386,14 +376,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
386
376
|
status: 404
|
|
387
377
|
});
|
|
388
378
|
}, renderVueNotFound = async (conventionPath) => {
|
|
389
|
-
const { createSSRApp, h
|
|
379
|
+
const { createSSRApp, h } = await import("vue");
|
|
390
380
|
const { renderToString } = await import("vue/server-renderer");
|
|
391
381
|
const mod = await import(conventionPath);
|
|
392
382
|
const NotFoundComponent = mod.default;
|
|
393
383
|
if (!NotFoundComponent)
|
|
394
384
|
return null;
|
|
395
385
|
const app = createSSRApp({
|
|
396
|
-
render: () =>
|
|
386
|
+
render: () => h(NotFoundComponent)
|
|
397
387
|
});
|
|
398
388
|
const rawBody = await renderToString(app);
|
|
399
389
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
@@ -747,13 +737,6 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
|
|
|
747
737
|
};
|
|
748
738
|
|
|
749
739
|
// src/core/devRouteRegistrationCallsite.ts
|
|
750
|
-
var exports_devRouteRegistrationCallsite = {};
|
|
751
|
-
__export(exports_devRouteRegistrationCallsite, {
|
|
752
|
-
getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite,
|
|
753
|
-
getOriginalPageHandlerSource: () => getOriginalPageHandlerSource,
|
|
754
|
-
isPageHandler: () => isPageHandler,
|
|
755
|
-
patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites
|
|
756
|
-
});
|
|
757
740
|
import { AsyncLocalStorage } from "async_hooks";
|
|
758
741
|
import { Elysia } from "elysia";
|
|
759
742
|
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, NODE_ENV_KEY = "NODE_ENV", ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, isPageHandlerFunction = (value) => typeof value === "function", handlerSourceMentionsPageHelper = (handler) => {
|
|
@@ -770,12 +753,12 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, NODE_ENV_KEY = "NODE
|
|
|
770
753
|
if (pageHandlerWrappers.has(handler))
|
|
771
754
|
return true;
|
|
772
755
|
return handlerSourceMentionsPageHelper(handler);
|
|
773
|
-
},
|
|
756
|
+
}, isObjectRecord = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage = (value) => isObjectRecord(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
|
|
774
757
|
const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
|
|
775
758
|
if (value === null || typeof value === "undefined") {
|
|
776
759
|
return;
|
|
777
760
|
}
|
|
778
|
-
return
|
|
761
|
+
return isAsyncLocalStorage(value) ? value : undefined;
|
|
779
762
|
}, ensureRouteCallsiteStorage = () => {
|
|
780
763
|
const existing = getRouteCallsiteStorage();
|
|
781
764
|
if (existing) {
|
|
@@ -856,11 +839,6 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
856
839
|
});
|
|
857
840
|
|
|
858
841
|
// src/utils/ssrErrorPage.ts
|
|
859
|
-
var exports_ssrErrorPage = {};
|
|
860
|
-
__export(exports_ssrErrorPage, {
|
|
861
|
-
buildErrorPage: () => buildErrorPage,
|
|
862
|
-
ssrErrorPage: () => ssrErrorPage
|
|
863
|
-
});
|
|
864
842
|
var errorPageHtml = ({
|
|
865
843
|
framework,
|
|
866
844
|
hint,
|
|
@@ -932,19 +910,6 @@ ${error ?? "The dev-server terminal has the build output."}`,
|
|
|
932
910
|
});
|
|
933
911
|
|
|
934
912
|
// src/core/requestContext.ts
|
|
935
|
-
var exports_requestContext = {};
|
|
936
|
-
__export(exports_requestContext, {
|
|
937
|
-
absoluteRequestContext: () => absoluteRequestContext,
|
|
938
|
-
devBuildErrorResponse: () => devBuildErrorResponse,
|
|
939
|
-
getCurrentAbsoluteRequest: () => getCurrentAbsoluteRequest,
|
|
940
|
-
getDevPageWarmer: () => getDevPageWarmer,
|
|
941
|
-
getMissingAssets: () => getMissingAssets,
|
|
942
|
-
recordMissingAsset: () => recordMissingAsset,
|
|
943
|
-
resolveDeferredPageAssets: () => resolveDeferredPageAssets,
|
|
944
|
-
runWithAbsoluteRequest: () => runWithAbsoluteRequest,
|
|
945
|
-
setDevPageWarmer: () => setDevPageWarmer,
|
|
946
|
-
withDeferredStylesheets: () => withDeferredStylesheets
|
|
947
|
-
});
|
|
948
913
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
949
914
|
import { Elysia as Elysia2 } from "elysia";
|
|
950
915
|
var REQUEST_STORAGE_KEY, PAGE_WARMER_KEY, isAbsoluteRequestStorage = (value) => typeof value === "object" && value !== null && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", getRequestStorage = () => {
|
|
@@ -1423,26 +1388,26 @@ var streamSwapRuntime = () => {
|
|
|
1423
1388
|
absoluteWindow.__ABS_SLOT_PENDING__ = absoluteWindow.__ABS_SLOT_PENDING__ ?? {};
|
|
1424
1389
|
const consumers = absoluteWindow.__ABS_SLOT_CONSUMERS__;
|
|
1425
1390
|
const pending = absoluteWindow.__ABS_SLOT_PENDING__;
|
|
1426
|
-
const
|
|
1391
|
+
const isObjectRecord = (value) => Boolean(value) && typeof value === "object";
|
|
1427
1392
|
const isPatchedPendingEntry = (value) => {
|
|
1428
|
-
if (!
|
|
1393
|
+
if (!isObjectRecord(value))
|
|
1429
1394
|
return false;
|
|
1430
1395
|
return value.domPatched === true && "payload" in value;
|
|
1431
1396
|
};
|
|
1432
1397
|
const unwrapPendingPayload = (value) => isPatchedPendingEntry(value) ? value.payload : value;
|
|
1433
1398
|
const canApplyImmediately = () => absoluteWindow.__ABS_SLOT_HYDRATION_PENDING__ !== true;
|
|
1434
1399
|
const isAngularDeferPayload = (payload) => {
|
|
1435
|
-
if (!
|
|
1400
|
+
if (!isObjectRecord(payload))
|
|
1436
1401
|
return false;
|
|
1437
1402
|
return payload.kind === "angular-defer";
|
|
1438
1403
|
};
|
|
1439
|
-
const
|
|
1440
|
-
if (!
|
|
1404
|
+
const isVueSuspensePayload = (payload) => {
|
|
1405
|
+
if (!isObjectRecord(payload))
|
|
1441
1406
|
return false;
|
|
1442
1407
|
return payload.kind === "vue-suspense";
|
|
1443
1408
|
};
|
|
1444
1409
|
const resolveHtml = (payload) => {
|
|
1445
|
-
if (!
|
|
1410
|
+
if (!isObjectRecord(payload)) {
|
|
1446
1411
|
return typeof payload === "string" ? payload : "";
|
|
1447
1412
|
}
|
|
1448
1413
|
if (typeof payload.html === "string") {
|
|
@@ -1479,7 +1444,7 @@ var streamSwapRuntime = () => {
|
|
|
1479
1444
|
return;
|
|
1480
1445
|
}
|
|
1481
1446
|
const html = resolveHtml(payload);
|
|
1482
|
-
if (
|
|
1447
|
+
if (isVueSuspensePayload(payload) && isPatchedPendingEntry(pendingEntry)) {
|
|
1483
1448
|
return;
|
|
1484
1449
|
}
|
|
1485
1450
|
node.innerHTML = html;
|
|
@@ -1487,7 +1452,7 @@ var streamSwapRuntime = () => {
|
|
|
1487
1452
|
window.dispatchEvent(new CustomEvent(SLOT_PATCH_EVENT, {
|
|
1488
1453
|
detail: { html, id, payload }
|
|
1489
1454
|
}));
|
|
1490
|
-
if (
|
|
1455
|
+
if (isVueSuspensePayload(payload)) {
|
|
1491
1456
|
pending[id] = { domPatched: true, payload };
|
|
1492
1457
|
return;
|
|
1493
1458
|
}
|
|
@@ -1521,6 +1486,26 @@ var streamSwapRuntime = () => {
|
|
|
1521
1486
|
return value.slice(start + 1, end);
|
|
1522
1487
|
}, getStreamSwapRuntimeScript = () => `(function(){${stripFunctionWrapper(streamSwapRuntime.toString())}})();`;
|
|
1523
1488
|
|
|
1489
|
+
// src/constants.ts
|
|
1490
|
+
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, DEFAULT_WEBSOCKET_IDLE_TIMEOUT_SECONDS = 240, DEFAULT_HTTP_IDLE_TIMEOUT_SECONDS = 240, MAX_HTTP_IDLE_TIMEOUT_SECONDS = 255, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
1491
|
+
var init_constants = __esm(() => {
|
|
1492
|
+
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
1493
|
+
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
1494
|
+
640,
|
|
1495
|
+
750,
|
|
1496
|
+
828,
|
|
1497
|
+
1080,
|
|
1498
|
+
1200,
|
|
1499
|
+
1920,
|
|
1500
|
+
2048,
|
|
1501
|
+
3840
|
|
1502
|
+
];
|
|
1503
|
+
IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
1504
|
+
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
1505
|
+
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
1506
|
+
TWO_THIRDS = 2 / 3;
|
|
1507
|
+
});
|
|
1508
|
+
|
|
1524
1509
|
// src/utils/escapeScriptContent.ts
|
|
1525
1510
|
var ESCAPE_LOOKUP, ESCAPE_REGEX, escapeScriptContent = (content) => content.replace(ESCAPE_REGEX, (char) => {
|
|
1526
1511
|
const escaped = ESCAPE_LOOKUP[char];
|
|
@@ -2400,10 +2385,6 @@ var init_telemetryEvent = __esm(() => {
|
|
|
2400
2385
|
});
|
|
2401
2386
|
|
|
2402
2387
|
// src/dev/buildHMRClient.ts
|
|
2403
|
-
var exports_buildHMRClient = {};
|
|
2404
|
-
__export(exports_buildHMRClient, {
|
|
2405
|
-
buildHMRClient: () => buildHMRClient
|
|
2406
|
-
});
|
|
2407
2388
|
import { existsSync as existsSync3 } from "fs";
|
|
2408
2389
|
import { resolve as resolve2 } from "path";
|
|
2409
2390
|
var {build: bunBuild } = globalThis.Bun;
|
|
@@ -2429,7 +2410,7 @@ var resolveHmrClientPath = () => {
|
|
|
2429
2410
|
console.error("Failed to build HMR client:", result.logs);
|
|
2430
2411
|
sendTelemetryEvent("hmr:client-build-failed", {
|
|
2431
2412
|
logCount: result.logs.length,
|
|
2432
|
-
message: result.logs.map((
|
|
2413
|
+
message: result.logs.map((log) => log.message).join("; ")
|
|
2433
2414
|
});
|
|
2434
2415
|
return "// HMR client build failed";
|
|
2435
2416
|
}
|
|
@@ -2459,8 +2440,8 @@ var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + fram
|
|
|
2459
2440
|
return found ? entries : undefined;
|
|
2460
2441
|
}, getIslandManifestEntries = (manifest) => {
|
|
2461
2442
|
const islands = {};
|
|
2462
|
-
const
|
|
2463
|
-
for (const framework of
|
|
2443
|
+
const frameworks = ["react", "svelte", "vue", "angular"];
|
|
2444
|
+
for (const framework of frameworks) {
|
|
2464
2445
|
const prefix = `Island${toIslandFrameworkSegment(framework)}`;
|
|
2465
2446
|
const entries = collectFrameworkIslands(manifest, prefix);
|
|
2466
2447
|
if (entries)
|
|
@@ -2563,10 +2544,6 @@ var init_resolveAngularPackage = () => {};
|
|
|
2563
2544
|
var ENV_VAR = "NODE_ENV", isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
|
|
2564
2545
|
|
|
2565
2546
|
// src/angular/angularPatch.ts
|
|
2566
|
-
var exports_angularPatch = {};
|
|
2567
|
-
__export(exports_angularPatch, {
|
|
2568
|
-
applyPatches: () => applyPatches
|
|
2569
|
-
});
|
|
2570
2547
|
var ensureHead = (doc) => {
|
|
2571
2548
|
if (!doc || doc.head || !doc.documentElement) {
|
|
2572
2549
|
return;
|
|
@@ -2722,8 +2699,8 @@ var initDominoAdapter = (platformServer) => {
|
|
|
2722
2699
|
if (!isProductionRuntime()) {
|
|
2723
2700
|
await import("@angular/compiler");
|
|
2724
2701
|
}
|
|
2725
|
-
|
|
2726
|
-
await
|
|
2702
|
+
await Promise.resolve().then(() => init_angularPatch());
|
|
2703
|
+
await applyPatches();
|
|
2727
2704
|
const useBareSpecifiers = !isProductionRuntime();
|
|
2728
2705
|
const [platformBrowser, platformServer, common, core] = await Promise.all([
|
|
2729
2706
|
useBareSpecifiers ? import("@angular/platform-browser") : import(resolveAngularRuntimePath("@angular/platform-browser")),
|
|
@@ -2939,49 +2916,7 @@ var init_ssrRender = __esm(() => {
|
|
|
2939
2916
|
});
|
|
2940
2917
|
|
|
2941
2918
|
// src/angular/islands.ts
|
|
2942
|
-
var
|
|
2943
|
-
__export(exports_islands, {
|
|
2944
|
-
getAngularIslandSelector: () => getAngularIslandSelector,
|
|
2945
|
-
isAngularComponent: () => isAngularComponent,
|
|
2946
|
-
mountAngularIsland: () => mountAngularIsland,
|
|
2947
|
-
renderAngularIslandToHtml: () => renderAngularIslandToHtml
|
|
2948
|
-
});
|
|
2949
|
-
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, isAngularComponent = (value) => typeof value === "function", getSelectorFromRenderedIsland = (rootElement) => {
|
|
2950
|
-
const firstChild = rootElement.firstElementChild;
|
|
2951
|
-
if (!(firstChild instanceof HTMLElement)) {
|
|
2952
|
-
return null;
|
|
2953
|
-
}
|
|
2954
|
-
const selector = firstChild.tagName.toLowerCase();
|
|
2955
|
-
return selector.length > 0 ? selector : null;
|
|
2956
|
-
}, getClientAngularComponentSelector = (component) => {
|
|
2957
|
-
const maybeDef = Reflect.get(component, "\u0275cmp");
|
|
2958
|
-
if (typeof maybeDef !== "object" || maybeDef === null) {
|
|
2959
|
-
return null;
|
|
2960
|
-
}
|
|
2961
|
-
const maybeSelectors = Reflect.get(maybeDef, "selectors");
|
|
2962
|
-
if (!Array.isArray(maybeSelectors)) {
|
|
2963
|
-
return null;
|
|
2964
|
-
}
|
|
2965
|
-
const [firstSelectorGroup] = maybeSelectors;
|
|
2966
|
-
if (!Array.isArray(firstSelectorGroup)) {
|
|
2967
|
-
return null;
|
|
2968
|
-
}
|
|
2969
|
-
const [selector] = firstSelectorGroup;
|
|
2970
|
-
return typeof selector === "string" && selector.length > 0 ? selector : null;
|
|
2971
|
-
}, createAngularIslandApp = async () => {
|
|
2972
|
-
const { EnvironmentInjector, provideZonelessChangeDetection } = await import("@angular/core");
|
|
2973
|
-
const { createApplication } = await import("@angular/platform-browser");
|
|
2974
|
-
const app = await createApplication({
|
|
2975
|
-
providers: [provideZonelessChangeDetection()]
|
|
2976
|
-
});
|
|
2977
|
-
const environmentInjector = app.injector.get(EnvironmentInjector);
|
|
2978
|
-
return { app, environmentInjector };
|
|
2979
|
-
}, angularIslandAppPromise = null, getAngularIslandApp = async () => {
|
|
2980
|
-
if (!angularIslandAppPromise) {
|
|
2981
|
-
angularIslandAppPromise = createAngularIslandApp();
|
|
2982
|
-
}
|
|
2983
|
-
return angularIslandAppPromise;
|
|
2984
|
-
}, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
|
|
2919
|
+
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
|
|
2985
2920
|
const requestId = getSsrContextId();
|
|
2986
2921
|
if (!requestId) {
|
|
2987
2922
|
return null;
|
|
@@ -3043,36 +2978,6 @@ var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_i
|
|
|
3043
2978
|
throw new Error(`Could not close Angular island root "${selector}".`);
|
|
3044
2979
|
}
|
|
3045
2980
|
return html.slice(start, end + endTag.length);
|
|
3046
|
-
}, mountAngularIsland = async (component, element, props, islandId) => {
|
|
3047
|
-
await import("@angular/compiler");
|
|
3048
|
-
const { createComponent, inputBinding } = await import("@angular/core");
|
|
3049
|
-
const selector = getAngularIslandSelector(islandId);
|
|
3050
|
-
const { app, environmentInjector } = await getAngularIslandApp();
|
|
3051
|
-
let rootElement = element.querySelector(selector);
|
|
3052
|
-
if (!(rootElement instanceof HTMLElement)) {
|
|
3053
|
-
element.innerHTML = `<${selector}></${selector}>`;
|
|
3054
|
-
rootElement = element.querySelector(selector);
|
|
3055
|
-
}
|
|
3056
|
-
if (!(rootElement instanceof HTMLElement))
|
|
3057
|
-
return app;
|
|
3058
|
-
const componentSelector = getClientAngularComponentSelector(component) ?? getSelectorFromRenderedIsland(rootElement);
|
|
3059
|
-
if (!componentSelector)
|
|
3060
|
-
return app;
|
|
3061
|
-
rootElement.innerHTML = `<${componentSelector}></${componentSelector}>`;
|
|
3062
|
-
const hostElement = rootElement.querySelector(componentSelector);
|
|
3063
|
-
if (!(hostElement instanceof HTMLElement))
|
|
3064
|
-
return app;
|
|
3065
|
-
const bindings = Object.entries(props).map(([key, value]) => inputBinding(key, () => value));
|
|
3066
|
-
const componentRef = createComponent(component, {
|
|
3067
|
-
bindings,
|
|
3068
|
-
environmentInjector,
|
|
3069
|
-
hostElement
|
|
3070
|
-
});
|
|
3071
|
-
app.attachView(componentRef.hostView);
|
|
3072
|
-
componentRef.changeDetectorRef.detectChanges();
|
|
3073
|
-
window.__ABS_ANGULAR_ISLAND_APPS__ ??= [];
|
|
3074
|
-
window.__ABS_ANGULAR_ISLAND_APPS__.push(app);
|
|
3075
|
-
return app;
|
|
3076
2981
|
}, renderAngularIslandToHtml = async (component, props, islandId) => {
|
|
3077
2982
|
const requestCache = getRequestRenderCache();
|
|
3078
2983
|
const renderCacheKey = getIslandRenderCacheKey(component, props);
|
|
@@ -3107,8 +3012,8 @@ var init_islands2 = __esm(() => {
|
|
|
3107
3012
|
|
|
3108
3013
|
// src/core/islandSsr.ts
|
|
3109
3014
|
var renderAngularIslandToHtmlInternal = async (component, props, islandId) => {
|
|
3110
|
-
|
|
3111
|
-
return
|
|
3015
|
+
await Promise.resolve().then(() => init_islands2());
|
|
3016
|
+
return renderAngularIslandToHtml(component, props, islandId);
|
|
3112
3017
|
}, renderAngularIslandToHtml2, LEADING_HOISTED_RESOURCE_RE, stripLeadingHoistedResources = (html) => {
|
|
3113
3018
|
let result = html;
|
|
3114
3019
|
let match = LEADING_HOISTED_RESOURCE_RE.exec(result);
|
|
@@ -3447,25 +3352,9 @@ var init_specifierRewriter = __esm(() => {
|
|
|
3447
3352
|
});
|
|
3448
3353
|
|
|
3449
3354
|
// src/build/rewriteImportsPlugin.ts
|
|
3450
|
-
var exports_rewriteImportsPlugin = {};
|
|
3451
|
-
__export(exports_rewriteImportsPlugin, {
|
|
3452
|
-
buildWithImportRewrite: () => buildWithImportRewrite,
|
|
3453
|
-
fixMissingReExportNamespacesInContent: () => fixMissingReExportNamespacesInContent,
|
|
3454
|
-
jsRewriteImports: () => jsRewriteImports,
|
|
3455
|
-
rewriteBuildOutputs: () => rewriteBuildOutputs,
|
|
3456
|
-
rewriteBuildOutputsWith: () => rewriteBuildOutputsWith,
|
|
3457
|
-
rewriteImportsInContent: () => rewriteImportsInContent,
|
|
3458
|
-
rewriteVendorDirectories: () => rewriteVendorDirectories
|
|
3459
|
-
});
|
|
3460
3355
|
import { readdir as readdir2 } from "fs/promises";
|
|
3461
3356
|
import { join as join4 } from "path";
|
|
3462
|
-
var REEXPORT_PATTERN, IMPORT_PATH_PATTERN, isMissingFile = (error) => error instanceof Error && ("code" in error) && error.code === "ENOENT",
|
|
3463
|
-
const result = await pendingBuild;
|
|
3464
|
-
if (result.outputs.length > 0) {
|
|
3465
|
-
await rewriteBuildOutputs(result.outputs, vendorPaths);
|
|
3466
|
-
}
|
|
3467
|
-
return result;
|
|
3468
|
-
}, fixMissingReExportNamespacesInContent = (content) => {
|
|
3357
|
+
var REEXPORT_PATTERN, IMPORT_PATH_PATTERN, isMissingFile = (error) => error instanceof Error && ("code" in error) && error.code === "ENOENT", fixMissingReExportNamespacesInContent = (content) => {
|
|
3469
3358
|
const missing = collectMissingNamespaceImports(content);
|
|
3470
3359
|
if (missing.length === 0)
|
|
3471
3360
|
return content;
|
|
@@ -3508,10 +3397,6 @@ ${content}`;
|
|
|
3508
3397
|
missing.push({ ident, path: sourcePath });
|
|
3509
3398
|
}
|
|
3510
3399
|
return missing;
|
|
3511
|
-
}, jsRewriteImports = (content, replacements) => rewriteSpecifiers(content, compileSpecifierRewriter(Object.fromEntries(replacements)), { sweep: false }), rewriteBuildOutputs = async (outputs, vendorPaths) => {
|
|
3512
|
-
if (Object.keys(vendorPaths).length === 0)
|
|
3513
|
-
return;
|
|
3514
|
-
await Promise.all(outputs.filter(isReadableArtifact).map((artifact) => rewriteArtifact(artifact, vendorPaths)));
|
|
3515
3400
|
}, isReadableArtifact = (artifact) => artifact.path.endsWith(".js"), readArtifactText = async (artifact) => {
|
|
3516
3401
|
try {
|
|
3517
3402
|
return await artifact.text();
|
|
@@ -3586,12 +3471,12 @@ var serverCacheRoot, compiledModuleCache, ANGULAR_SPECIFIER_RE, getCachedModuleP
|
|
|
3586
3471
|
const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
3587
3472
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
3588
3473
|
return join5(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
3589
|
-
}, collectVendorPaths = (
|
|
3474
|
+
}, collectVendorPaths = (code) => {
|
|
3590
3475
|
const vendorPaths = {};
|
|
3591
3476
|
if (!isProductionRuntime()) {
|
|
3592
3477
|
return vendorPaths;
|
|
3593
3478
|
}
|
|
3594
|
-
const specifiers = new Set([...
|
|
3479
|
+
const specifiers = new Set([...code.matchAll(ANGULAR_SPECIFIER_RE)].map((match) => match[1]));
|
|
3595
3480
|
specifiers.forEach((specifier) => {
|
|
3596
3481
|
if (!specifier)
|
|
3597
3482
|
return;
|
|
@@ -3611,13 +3496,13 @@ var serverCacheRoot, compiledModuleCache, ANGULAR_SPECIFIER_RE, getCachedModuleP
|
|
|
3611
3496
|
});
|
|
3612
3497
|
const entry = result.outputs.find((output) => output.kind === "entry-point");
|
|
3613
3498
|
if (!result.success || !entry) {
|
|
3614
|
-
const message = result.logs.map((
|
|
3499
|
+
const message = result.logs.map((log) => String(log)).join(`
|
|
3615
3500
|
`);
|
|
3616
3501
|
throw new Error(`Failed to compile Angular island server module for "${sourcePath}":
|
|
3617
3502
|
${message}`);
|
|
3618
3503
|
}
|
|
3619
|
-
const
|
|
3620
|
-
const rewritten = rewriteImportsInContent(
|
|
3504
|
+
const code = await entry.text();
|
|
3505
|
+
const rewritten = rewriteImportsInContent(code, collectVendorPaths(code));
|
|
3621
3506
|
const modulePath = getCachedModulePath(sourcePath);
|
|
3622
3507
|
await mkdir(dirname4(modulePath), { recursive: true });
|
|
3623
3508
|
await Bun.write(modulePath, rewritten);
|
|
@@ -3819,26 +3704,6 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
3819
3704
|
});
|
|
3820
3705
|
|
|
3821
3706
|
// src/build/stylePreprocessor.ts
|
|
3822
|
-
var exports_stylePreprocessor = {};
|
|
3823
|
-
__export(exports_stylePreprocessor, {
|
|
3824
|
-
addStyleImporter: () => addStyleImporter,
|
|
3825
|
-
compileStyleFileIfNeeded: () => compileStyleFileIfNeeded,
|
|
3826
|
-
compileStyleFileIfNeededSync: () => compileStyleFileIfNeededSync,
|
|
3827
|
-
compileStyleSource: () => compileStyleSource,
|
|
3828
|
-
createStylePreprocessorPlugin: () => createStylePreprocessorPlugin,
|
|
3829
|
-
createStyleTransformConfig: () => createStyleTransformConfig,
|
|
3830
|
-
createSvelteStylePreprocessor: () => createSvelteStylePreprocessor,
|
|
3831
|
-
findStyleEntriesImporting: () => findStyleEntriesImporting,
|
|
3832
|
-
forgetStyleEntry: () => forgetStyleEntry,
|
|
3833
|
-
getCssOutputExtension: () => getCssOutputExtension,
|
|
3834
|
-
getStyleBaseName: () => getStyleBaseName,
|
|
3835
|
-
isPreprocessableStylePath: () => isPreprocessableStylePath,
|
|
3836
|
-
isStyleModulePath: () => isStyleModulePath,
|
|
3837
|
-
isStylePath: () => isStylePath,
|
|
3838
|
-
recordStyleOutput: () => recordStyleOutput,
|
|
3839
|
-
stylePreprocessorPlugin: () => stylePreprocessorPlugin
|
|
3840
|
-
});
|
|
3841
|
-
import { createHash as createHash2 } from "crypto";
|
|
3842
3707
|
import { existsSync as existsSync6, readFileSync as readFileSync5 } from "fs";
|
|
3843
3708
|
import { readFile as readFile2 } from "fs/promises";
|
|
3844
3709
|
import { createRequire } from "module";
|
|
@@ -4021,8 +3886,8 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
4021
3886
|
return mod.default ?? mod;
|
|
4022
3887
|
}
|
|
4023
3888
|
return mod;
|
|
4024
|
-
}, loadPostcssConfigFile = async (
|
|
4025
|
-
const resolved = resolve5(process.cwd(),
|
|
3889
|
+
}, loadPostcssConfigFile = async (configPath) => {
|
|
3890
|
+
const resolved = resolve5(process.cwd(), configPath);
|
|
4026
3891
|
const loaded = resolved.endsWith(".cjs") || resolved.endsWith(".cts") ? requireOptionalPeerSync(resolved) : await importOptionalPeer(`${new URL(`file://${resolved}`).href}?t=${Date.now()}`);
|
|
4027
3892
|
const config = normalizePostcssModule(loaded);
|
|
4028
3893
|
const value = typeof config === "function" ? await config({
|
|
@@ -4169,16 +4034,6 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
4169
4034
|
importers.push(entry);
|
|
4170
4035
|
}
|
|
4171
4036
|
return importers;
|
|
4172
|
-
}, recordStyleOutput = (entry, css) => {
|
|
4173
|
-
const key = resolve5(entry);
|
|
4174
|
-
const hash = createHash2("sha1").update(css).digest("hex");
|
|
4175
|
-
const previous = styleOutputHashes.get(key);
|
|
4176
|
-
styleOutputHashes.set(key, hash);
|
|
4177
|
-
return previous !== hash;
|
|
4178
|
-
}, forgetStyleEntry = (entry) => {
|
|
4179
|
-
const key = resolve5(entry);
|
|
4180
|
-
styleDependencyGraph.delete(key);
|
|
4181
|
-
styleOutputHashes.delete(key);
|
|
4182
4037
|
}, compileStyleSource = async (filePath, source, languageHint, config) => {
|
|
4183
4038
|
const language = getStyleLanguage(languageHint ?? filePath);
|
|
4184
4039
|
const rawContents = source ?? await readFile2(filePath, "utf-8");
|
|
@@ -4409,7 +4264,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
4409
4264
|
throw new Error(`Unable to compile ${filePath}: Stylus styleUrl preprocessing is async-only. Import the Stylus file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
|
|
4410
4265
|
}
|
|
4411
4266
|
return resolveCssImportsSync(rawContents, dirname5(filePath), new Set([filePath]));
|
|
4412
|
-
}
|
|
4267
|
+
};
|
|
4413
4268
|
var init_stylePreprocessor = __esm(() => {
|
|
4414
4269
|
CSS_EXTENSION_PATTERN = /\.css$/i;
|
|
4415
4270
|
STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less|styl(?:us)?)$/i;
|
|
@@ -4646,8 +4501,8 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
|
|
|
4646
4501
|
return;
|
|
4647
4502
|
}
|
|
4648
4503
|
await Bun.write(path, content);
|
|
4649
|
-
}, stripExports = (
|
|
4650
|
-
const lines =
|
|
4504
|
+
}, stripExports = (code) => code.replace(/export\s+default/, "const script ="), mergeVueImports = (code) => {
|
|
4505
|
+
const lines = code.split(`
|
|
4651
4506
|
`);
|
|
4652
4507
|
const specifierSet = new Set;
|
|
4653
4508
|
const vueImportRegex = /^import\s+{([^}]+)}\s+from\s+['"]vue['"];?$/;
|
|
@@ -4880,6 +4735,19 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
4880
4735
|
resolvedServerBuildComponentCache = new Map;
|
|
4881
4736
|
});
|
|
4882
4737
|
|
|
4738
|
+
// src/vue/pageHandler.ts
|
|
4739
|
+
init_inlinePageCss();
|
|
4740
|
+
init_spaRouteCss();
|
|
4741
|
+
init_spaRouteManifest();
|
|
4742
|
+
init_devRouteRegistrationCallsite();
|
|
4743
|
+
init_requestContext();
|
|
4744
|
+
init_pageProtocol();
|
|
4745
|
+
init_pageResponseCache();
|
|
4746
|
+
|
|
4747
|
+
// src/core/responseEnhancers.ts
|
|
4748
|
+
init_streamingSlots();
|
|
4749
|
+
init_pageResponseCache();
|
|
4750
|
+
|
|
4883
4751
|
// src/core/streamingSlotRegistrar.ts
|
|
4884
4752
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
4885
4753
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
@@ -4891,9 +4759,9 @@ var getRegisteredStreamingSlotRegistrar = () => {
|
|
|
4891
4759
|
}
|
|
4892
4760
|
return;
|
|
4893
4761
|
};
|
|
4894
|
-
var
|
|
4895
|
-
var isStreamingSlotWarningController = (value) =>
|
|
4896
|
-
var isStreamingSlotCollectionController = (value) =>
|
|
4762
|
+
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
4763
|
+
var isStreamingSlotWarningController = (value) => isObjectRecord2(value) && ("maybeWarn" in value) && typeof value.maybeWarn === "function";
|
|
4764
|
+
var isStreamingSlotCollectionController = (value) => isObjectRecord2(value) && ("isCollecting" in value) && typeof value.isCollecting === "function";
|
|
4897
4765
|
var getWarningController = () => {
|
|
4898
4766
|
const value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);
|
|
4899
4767
|
if (value === null || typeof value === "undefined")
|
|
@@ -4929,14 +4797,14 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
4929
4797
|
|
|
4930
4798
|
// src/core/streamingSlotRegistry.ts
|
|
4931
4799
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
4932
|
-
var
|
|
4933
|
-
var
|
|
4800
|
+
var isObjectRecord3 = (value) => Boolean(value) && typeof value === "object";
|
|
4801
|
+
var isAsyncLocalStorage2 = (value) => isObjectRecord3(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
4934
4802
|
var getStorageGlobal = () => {
|
|
4935
4803
|
const value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);
|
|
4936
4804
|
if (value === null || typeof value === "undefined") {
|
|
4937
4805
|
return value;
|
|
4938
4806
|
}
|
|
4939
|
-
return
|
|
4807
|
+
return isAsyncLocalStorage2(value) ? value : undefined;
|
|
4940
4808
|
};
|
|
4941
4809
|
var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
4942
4810
|
var ensureAsyncLocalStorage = async () => {
|
|
@@ -4988,936 +4856,508 @@ var runWithStreamingSlotRegistry = async (task) => {
|
|
|
4988
4856
|
});
|
|
4989
4857
|
};
|
|
4990
4858
|
|
|
4991
|
-
// src/
|
|
4992
|
-
|
|
4859
|
+
// src/core/responseEnhancers.ts
|
|
4860
|
+
var toResponse = async (responseLike) => responseLike;
|
|
4861
|
+
var cloneHeaders = (response) => {
|
|
4862
|
+
const headers = new Headers(response.headers);
|
|
4863
|
+
return headers;
|
|
4864
|
+
};
|
|
4865
|
+
var enhanceHtmlResponseWithStreamingSlots = (response, {
|
|
4866
|
+
nonce,
|
|
4867
|
+
onError,
|
|
4868
|
+
runtimePlacement,
|
|
4869
|
+
runtimePreludeScript,
|
|
4870
|
+
streamingSlots = [],
|
|
4871
|
+
policy
|
|
4872
|
+
} = {}) => {
|
|
4873
|
+
if (!response.body || streamingSlots.length === 0) {
|
|
4874
|
+
return response;
|
|
4875
|
+
}
|
|
4876
|
+
const body = appendStreamingSlotPatchesToStream(response.body, streamingSlots, {
|
|
4877
|
+
nonce,
|
|
4878
|
+
onError,
|
|
4879
|
+
policy,
|
|
4880
|
+
runtimePlacement,
|
|
4881
|
+
runtimePreludeScript
|
|
4882
|
+
});
|
|
4883
|
+
const headers = cloneHeaders(response);
|
|
4884
|
+
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
4885
|
+
return new Response(body, {
|
|
4886
|
+
headers,
|
|
4887
|
+
status: response.status,
|
|
4888
|
+
statusText: response.statusText
|
|
4889
|
+
});
|
|
4890
|
+
};
|
|
4891
|
+
var withStreamingSlots = async (responseLike, options = {}) => enhanceHtmlResponseWithStreamingSlots(await toResponse(responseLike), options);
|
|
4892
|
+
var mergeStreamingSlots = (registered, explicit) => {
|
|
4893
|
+
const merged = new Map;
|
|
4894
|
+
for (const slot of registered)
|
|
4895
|
+
merged.set(slot.id, slot);
|
|
4896
|
+
for (const slot of explicit)
|
|
4897
|
+
merged.set(slot.id, slot);
|
|
4898
|
+
return [...merged.values()];
|
|
4899
|
+
};
|
|
4900
|
+
var withRegisteredStreamingSlots = async (renderResponse, options = {}) => {
|
|
4901
|
+
const { result, slots } = await runWithStreamingSlotRegistry(renderResponse);
|
|
4902
|
+
const explicit = options.streamingSlots ?? [];
|
|
4903
|
+
return withStreamingSlots(result, {
|
|
4904
|
+
...options,
|
|
4905
|
+
streamingSlots: mergeStreamingSlots(slots, explicit)
|
|
4906
|
+
});
|
|
4907
|
+
};
|
|
4993
4908
|
|
|
4994
|
-
// src/
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
var
|
|
4998
|
-
var
|
|
4999
|
-
var
|
|
5000
|
-
var
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
4909
|
+
// src/core/streamingSlotWarningScope.ts
|
|
4910
|
+
init_logger();
|
|
4911
|
+
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
4912
|
+
var STREAMING_SLOT_WARNING_STORAGE_KEY2 = Symbol.for("absolutejs.streamingSlotWarningAsyncLocalStorage");
|
|
4913
|
+
var isObjectRecord4 = (value) => Boolean(value) && typeof value === "object";
|
|
4914
|
+
var isAsyncLocalStorage3 = (value) => isObjectRecord4(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
4915
|
+
var getWarningStorage = () => {
|
|
4916
|
+
const value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY2);
|
|
4917
|
+
if (value === null || typeof value === "undefined") {
|
|
4918
|
+
return;
|
|
4919
|
+
}
|
|
4920
|
+
return isAsyncLocalStorage3(value) ? value : undefined;
|
|
5005
4921
|
};
|
|
5006
|
-
var
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
4922
|
+
var ensureWarningStorage = () => {
|
|
4923
|
+
const existing = getWarningStorage();
|
|
4924
|
+
if (existing) {
|
|
4925
|
+
return existing;
|
|
5010
4926
|
}
|
|
5011
|
-
|
|
4927
|
+
const storage = new AsyncLocalStorage3;
|
|
4928
|
+
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY2, storage);
|
|
4929
|
+
return storage;
|
|
5012
4930
|
};
|
|
5013
|
-
var
|
|
5014
|
-
|
|
5015
|
-
const
|
|
5016
|
-
|
|
4931
|
+
var normalizeCallsitePath2 = (value) => value.replace(`${process.cwd()}/`, "").replace(process.cwd(), "").replace(/^\.\/+/, "");
|
|
4932
|
+
var formatWarningCallsite = (callsite) => {
|
|
4933
|
+
const match = callsite.match(/^(.*?)(:\d+:\d+)$/);
|
|
4934
|
+
if (!match) {
|
|
4935
|
+
return `\x1B[36m${callsite}\x1B[0m`;
|
|
4936
|
+
}
|
|
4937
|
+
return `\x1B[36m${match[1]}\x1B[33m${match[2]}\x1B[0m`;
|
|
5017
4938
|
};
|
|
5018
|
-
var
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
4939
|
+
var shouldIgnoreWarningFrame = (frame) => frame.includes("/node_modules/") || frame.includes("/dist/") || frame.includes("/src/react/pageHandler.") || frame.includes("/src/vue/pageHandler.") || frame.includes("/src/svelte/pageHandler.") || frame.includes("/src/angular/pageHandler.") || frame.includes("/src/core/streamingSlotWarningScope.");
|
|
4940
|
+
var getWarningLocation = (frame) => frame.match(/\((\/[^)]+:\d+:\d+)\)$/)?.[1] ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/)?.[1];
|
|
4941
|
+
var extractCallsiteFromStack = (stack) => {
|
|
4942
|
+
const location = stack.split(`
|
|
4943
|
+
`).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
|
|
4944
|
+
return location ? normalizeCallsitePath2(location) : undefined;
|
|
4945
|
+
};
|
|
4946
|
+
var buildMissingCollectorWarning = (primitiveName, handlerCallsite) => `${primitiveName} rendered during SSR without streaming slot collection enabled. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
|
|
4947
|
+
setStreamingSlotWarningController({
|
|
4948
|
+
maybeWarn: (primitiveName) => {
|
|
4949
|
+
const store = getWarningStorage()?.getStore();
|
|
4950
|
+
if (!store || store.hasWarned) {
|
|
4951
|
+
return;
|
|
4952
|
+
}
|
|
4953
|
+
store.hasWarned = true;
|
|
4954
|
+
logWarn(buildMissingCollectorWarning(primitiveName, store.handlerCallsite));
|
|
5023
4955
|
}
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
4956
|
+
});
|
|
4957
|
+
var captureStreamingSlotWarningCallsite = () => {
|
|
4958
|
+
if (false) {}
|
|
4959
|
+
const { stack } = new Error;
|
|
4960
|
+
if (!stack) {
|
|
4961
|
+
return;
|
|
5029
4962
|
}
|
|
5030
|
-
|
|
5031
|
-
return devSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`).join(", ");
|
|
4963
|
+
return extractCallsiteFromStack(stack);
|
|
5032
4964
|
};
|
|
4965
|
+
var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({ handlerCallsite: metadata?.handlerCallsite, hasWarned: false }, task);
|
|
5033
4966
|
|
|
5034
|
-
// src/vue/
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
4967
|
+
// src/vue/pageHandler.ts
|
|
4968
|
+
init_resolveConvention();
|
|
4969
|
+
init_routeAssets();
|
|
4970
|
+
|
|
4971
|
+
// src/vue/resolveGeneratedVueModulePath.ts
|
|
4972
|
+
init_constants();
|
|
4973
|
+
import { access, readdir, stat } from "fs/promises";
|
|
4974
|
+
import { basename as basename3, dirname as dirname2 } from "path";
|
|
4975
|
+
var canAccess = async (path) => {
|
|
4976
|
+
try {
|
|
4977
|
+
await access(path);
|
|
4978
|
+
return true;
|
|
4979
|
+
} catch {
|
|
4980
|
+
return false;
|
|
4981
|
+
}
|
|
5041
4982
|
};
|
|
5042
|
-
var
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
fill: { default: false, type: Boolean },
|
|
5051
|
-
height: { default: undefined, type: Number },
|
|
5052
|
-
loader: { default: undefined, type: Function },
|
|
5053
|
-
loading: { default: "lazy", type: String },
|
|
5054
|
-
onError: { default: undefined, type: Function },
|
|
5055
|
-
onLoad: { default: undefined, type: Function },
|
|
5056
|
-
overrideSrc: { default: undefined, type: String },
|
|
5057
|
-
placeholder: { default: undefined, type: String },
|
|
5058
|
-
priority: { default: false, type: Boolean },
|
|
5059
|
-
quality: { default: DEFAULT_QUALITY, type: Number },
|
|
5060
|
-
referrerPolicy: { default: undefined, type: String },
|
|
5061
|
-
sizes: { default: undefined, type: String },
|
|
5062
|
-
src: { required: true, type: String },
|
|
5063
|
-
style: { default: undefined, type: Object },
|
|
5064
|
-
unoptimized: { default: false, type: Boolean },
|
|
5065
|
-
width: { default: undefined, type: Number }
|
|
5066
|
-
},
|
|
5067
|
-
setup(props) {
|
|
5068
|
-
const blurRemoved = ref(false);
|
|
5069
|
-
const resolvedSrc = computed(() => {
|
|
5070
|
-
if (props.overrideSrc)
|
|
5071
|
-
return props.overrideSrc;
|
|
5072
|
-
if (props.unoptimized)
|
|
5073
|
-
return props.src;
|
|
5074
|
-
if (props.loader) {
|
|
5075
|
-
return props.loader({
|
|
5076
|
-
quality: props.quality ?? DEFAULT_QUALITY,
|
|
5077
|
-
src: props.src,
|
|
5078
|
-
width: props.width ?? 0
|
|
5079
|
-
});
|
|
5080
|
-
}
|
|
5081
|
-
if (!props.width) {
|
|
5082
|
-
return buildOptimizedUrl(props.src, 0, props.quality ?? DEFAULT_QUALITY);
|
|
5083
|
-
}
|
|
5084
|
-
return buildOptimizedUrl(props.src, props.width, props.quality ?? DEFAULT_QUALITY);
|
|
5085
|
-
});
|
|
5086
|
-
const srcSet = computed(() => props.unoptimized ? undefined : generateSrcSet(props.src, props.width, props.sizes));
|
|
5087
|
-
const resolvedSizes = computed(() => props.sizes ?? (props.fill ? "100vw" : undefined));
|
|
5088
|
-
const resolvedLoading = computed(() => props.priority ? "eager" : props.loading ?? "lazy");
|
|
5089
|
-
const resolvedFetchPriority = computed(() => props.priority ? "high" : props.fetchPriority);
|
|
5090
|
-
const hasBlur = computed(() => props.placeholder === "blur" || typeof props.placeholder === "string" && props.placeholder !== "empty" && props.placeholder.startsWith("data:"));
|
|
5091
|
-
const blurBackground = computed(() => {
|
|
5092
|
-
if (!hasBlur.value || blurRemoved.value)
|
|
5093
|
-
return;
|
|
5094
|
-
if (typeof props.placeholder === "string" && props.placeholder !== "blur" && props.placeholder.startsWith("data:")) {
|
|
5095
|
-
return generateBlurSvg(props.placeholder);
|
|
5096
|
-
}
|
|
5097
|
-
if (props.blurDataURL)
|
|
5098
|
-
return generateBlurSvg(props.blurDataURL);
|
|
5099
|
-
return;
|
|
5100
|
-
});
|
|
5101
|
-
const imgStyle = computed(() => {
|
|
5102
|
-
const base = {
|
|
5103
|
-
...props.style ?? {},
|
|
5104
|
-
color: "transparent"
|
|
5105
|
-
};
|
|
5106
|
-
if (blurBackground.value) {
|
|
5107
|
-
base.backgroundImage = blurBackground.value;
|
|
5108
|
-
base.backgroundPosition = "center";
|
|
5109
|
-
base.backgroundRepeat = "no-repeat";
|
|
5110
|
-
base.backgroundSize = "cover";
|
|
5111
|
-
}
|
|
5112
|
-
if (props.fill) {
|
|
5113
|
-
base.height = "100%";
|
|
5114
|
-
base.inset = "0";
|
|
5115
|
-
base.objectFit = "cover";
|
|
5116
|
-
base.position = "absolute";
|
|
5117
|
-
base.width = "100%";
|
|
5118
|
-
}
|
|
5119
|
-
return base;
|
|
5120
|
-
});
|
|
5121
|
-
const handleLoad = (event) => {
|
|
5122
|
-
blurRemoved.value = true;
|
|
5123
|
-
props.onLoad?.(event);
|
|
5124
|
-
};
|
|
5125
|
-
const handleError = (event) => {
|
|
5126
|
-
props.onError?.(event);
|
|
5127
|
-
};
|
|
5128
|
-
return () => {
|
|
5129
|
-
const imgNode = h("img", {
|
|
5130
|
-
alt: props.alt,
|
|
5131
|
-
class: props.className,
|
|
5132
|
-
crossorigin: props.crossOrigin,
|
|
5133
|
-
decoding: "async",
|
|
5134
|
-
fetchpriority: resolvedFetchPriority.value,
|
|
5135
|
-
height: props.fill ? undefined : props.height,
|
|
5136
|
-
loading: resolvedLoading.value,
|
|
5137
|
-
onError: handleError,
|
|
5138
|
-
onLoad: handleLoad,
|
|
5139
|
-
referrerpolicy: props.referrerPolicy,
|
|
5140
|
-
sizes: resolvedSizes.value,
|
|
5141
|
-
src: resolvedSrc.value,
|
|
5142
|
-
srcset: srcSet.value,
|
|
5143
|
-
style: imgStyle.value,
|
|
5144
|
-
width: props.fill ? undefined : props.width
|
|
5145
|
-
});
|
|
5146
|
-
return props.fill ? h("span", { style: fillWrapperStyle }, [imgNode]) : imgNode;
|
|
5147
|
-
};
|
|
5148
|
-
}
|
|
5149
|
-
});
|
|
5150
|
-
// src/vue/components/SuspenseSlot.ts
|
|
5151
|
-
import {
|
|
5152
|
-
cloneVNode,
|
|
5153
|
-
defineComponent as defineComponent2,
|
|
5154
|
-
h as h2,
|
|
5155
|
-
isVNode,
|
|
5156
|
-
onMounted,
|
|
5157
|
-
onBeforeUnmount,
|
|
5158
|
-
ref as ref2,
|
|
5159
|
-
useSSRContext
|
|
5160
|
-
} from "vue";
|
|
5161
|
-
var renderVueNodesToHtml = async (nodes) => {
|
|
5162
|
-
const { createSSRApp, h: createVNode } = await import("vue");
|
|
5163
|
-
const { renderToString } = await import("vue/server-renderer");
|
|
5164
|
-
const app = createSSRApp({
|
|
5165
|
-
render: () => createVNode("div", undefined, nodes ?? undefined)
|
|
5166
|
-
});
|
|
5167
|
-
const html = await renderToString(app);
|
|
5168
|
-
return html.replace(/^<div>|<\/div>$/g, "");
|
|
5169
|
-
};
|
|
5170
|
-
var hasFrameworkSlots = (defaultSlot, fallbackSlot, errorSlot, promise) => defaultSlot !== undefined || fallbackSlot !== undefined || errorSlot !== undefined || promise !== undefined;
|
|
5171
|
-
var allowMismatchOnSlotNodes = (nodes) => {
|
|
5172
|
-
if (Array.isArray(nodes)) {
|
|
5173
|
-
return nodes.map((node) => allowMismatchOnSlotNodes(node));
|
|
5174
|
-
}
|
|
5175
|
-
if (isVNode(nodes)) {
|
|
5176
|
-
return cloneVNode(nodes, {
|
|
5177
|
-
"data-allow-mismatch": ""
|
|
4983
|
+
var resolveGeneratedVueModulePath = async (pagePath) => {
|
|
4984
|
+
if (await canAccess(pagePath))
|
|
4985
|
+
return pagePath;
|
|
4986
|
+
const pageDirectory = dirname2(pagePath);
|
|
4987
|
+
const expectedPrefix = `${basename3(pagePath, ".js").split(".")[0]}.`;
|
|
4988
|
+
try {
|
|
4989
|
+
const pageEntries = await readdir(pageDirectory, {
|
|
4990
|
+
withFileTypes: true
|
|
5178
4991
|
});
|
|
4992
|
+
const matchingEntries = pageEntries.filter((entry) => entry.isFile() && entry.name.endsWith(".js") && (entry.name === `${expectedPrefix.slice(0, EXCLUDE_LAST_OFFSET)}.js` || entry.name.startsWith(expectedPrefix)));
|
|
4993
|
+
const candidates = await Promise.all(matchingEntries.map(async (entry) => {
|
|
4994
|
+
const path = `${pageDirectory}/${entry.name}`;
|
|
4995
|
+
const metadata = await stat(path);
|
|
4996
|
+
return { modifiedAt: metadata.mtimeMs, path };
|
|
4997
|
+
}));
|
|
4998
|
+
candidates.sort((left, right) => right.modifiedAt - left.modifiedAt || left.path.localeCompare(right.path));
|
|
4999
|
+
return candidates[0]?.path ?? pagePath;
|
|
5000
|
+
} catch {
|
|
5001
|
+
return pagePath;
|
|
5179
5002
|
}
|
|
5180
|
-
return nodes;
|
|
5181
|
-
};
|
|
5182
|
-
var resolveSuspenseValue = async (resolve, promise) => {
|
|
5183
|
-
if (resolve !== undefined) {
|
|
5184
|
-
return resolve();
|
|
5185
|
-
}
|
|
5186
|
-
if (promise !== undefined) {
|
|
5187
|
-
return promise;
|
|
5188
|
-
}
|
|
5189
|
-
return;
|
|
5190
|
-
};
|
|
5191
|
-
var isObjectRecord3 = (value) => Boolean(value) && typeof value === "object";
|
|
5192
|
-
var isVueSuspensePayload = (payload) => {
|
|
5193
|
-
if (!isObjectRecord3(payload)) {
|
|
5194
|
-
return false;
|
|
5195
|
-
}
|
|
5196
|
-
return payload.kind === "vue-suspense";
|
|
5197
5003
|
};
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5004
|
+
|
|
5005
|
+
// src/vue/teleports.ts
|
|
5006
|
+
var ABSOLUTE_TELEPORT_TARGET_ID = "absolute-teleports";
|
|
5007
|
+
var ABSOLUTE_TELEPORT_TARGET = `#${ABSOLUTE_TELEPORT_TARGET_ID}`;
|
|
5008
|
+
|
|
5009
|
+
// src/vue/pageHandler.ts
|
|
5010
|
+
init_browserTranslation();
|
|
5011
|
+
var isRecord3 = (value) => typeof value === "object" && value !== null;
|
|
5012
|
+
var isGenericVueComponent = (value) => typeof value === "function" || isRecord3(value);
|
|
5013
|
+
var readHasIslands = (value) => {
|
|
5014
|
+
if (!isRecord3(value))
|
|
5204
5015
|
return false;
|
|
5205
|
-
|
|
5206
|
-
return
|
|
5016
|
+
const hasIslands = value["__ABSOLUTE_PAGE_HAS_ISLANDS__"];
|
|
5017
|
+
return typeof hasIslands === "boolean" ? hasIslands : false;
|
|
5207
5018
|
};
|
|
5208
|
-
var
|
|
5209
|
-
|
|
5019
|
+
var isVueSetupApp = (value) => typeof value === "function";
|
|
5020
|
+
var readSetupAppHook = (value) => {
|
|
5021
|
+
if (!isRecord3(value))
|
|
5210
5022
|
return null;
|
|
5211
|
-
}
|
|
5212
|
-
return
|
|
5213
|
-
errorHtml: props.errorHtml,
|
|
5214
|
-
fallbackHtml: props.fallbackHtml,
|
|
5215
|
-
id: props.id,
|
|
5216
|
-
timeoutMs: props.timeoutMs,
|
|
5217
|
-
resolve: async () => {
|
|
5218
|
-
const resolved = await props.resolve?.();
|
|
5219
|
-
return typeof resolved === "string" ? resolved : "";
|
|
5220
|
-
}
|
|
5221
|
-
};
|
|
5222
|
-
};
|
|
5223
|
-
var registerLegacySuspenseSlot = (props) => {
|
|
5224
|
-
registerStreamingSlot({
|
|
5225
|
-
errorHtml: props.errorHtml,
|
|
5226
|
-
fallbackHtml: props.fallbackHtml,
|
|
5227
|
-
id: props.id,
|
|
5228
|
-
resolve: props.resolve,
|
|
5229
|
-
timeoutMs: props.timeoutMs
|
|
5230
|
-
});
|
|
5023
|
+
const { setupApp } = value;
|
|
5024
|
+
return isVueSetupApp(setupApp) ? setupApp : null;
|
|
5231
5025
|
};
|
|
5232
|
-
var
|
|
5026
|
+
var readHasSpaRoutes = (value) => isRecord3(value) && Array.isArray(value["routes"]);
|
|
5027
|
+
var readDefaultExport = (value) => isRecord3(value) ? value.default : undefined;
|
|
5028
|
+
var resolveRequestRenderUrl = (request) => {
|
|
5029
|
+
if (!request)
|
|
5030
|
+
return "/";
|
|
5233
5031
|
try {
|
|
5234
|
-
const
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
return
|
|
5238
|
-
html,
|
|
5239
|
-
kind: "vue-suspense",
|
|
5240
|
-
value
|
|
5241
|
-
};
|
|
5242
|
-
} catch (error) {
|
|
5243
|
-
const errorNodes = slots.error?.({ error });
|
|
5244
|
-
if (errorNodes !== undefined)
|
|
5245
|
-
return renderVueNodesToHtml(allowMismatchOnSlotNodes(errorNodes));
|
|
5246
|
-
if (typeof props.errorHtml === "string")
|
|
5247
|
-
return props.errorHtml;
|
|
5248
|
-
throw error;
|
|
5032
|
+
const parsed = new URL(request.url);
|
|
5033
|
+
return `${parsed.pathname}${parsed.search}`;
|
|
5034
|
+
} catch {
|
|
5035
|
+
return "/";
|
|
5249
5036
|
}
|
|
5250
5037
|
};
|
|
5251
|
-
var
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
}
|
|
5255
|
-
const legacyRegistration = toLegacySuspenseSlotRegistration(props);
|
|
5256
|
-
if (!usesFrameworkSlots && legacyRegistration) {
|
|
5257
|
-
registerLegacySuspenseSlot(legacyRegistration);
|
|
5258
|
-
return;
|
|
5259
|
-
}
|
|
5260
|
-
registerStreamingSlot({
|
|
5261
|
-
id: props.id,
|
|
5262
|
-
timeoutMs: props.timeoutMs,
|
|
5263
|
-
resolve: () => resolveStreamingSuspenseSlot(props, slots)
|
|
5264
|
-
});
|
|
5038
|
+
var primeVueStream = async (stream) => {
|
|
5039
|
+
const reader = stream.getReader();
|
|
5040
|
+
const firstChunk = await reader.read();
|
|
5041
|
+
return { firstChunk, reader };
|
|
5265
5042
|
};
|
|
5266
|
-
var
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5043
|
+
var cachedSsrOnlyHmrShim = null;
|
|
5044
|
+
var buildSsrOnlyHmrShim = async () => {
|
|
5045
|
+
await Promise.resolve().then(() => init_buildHMRClient());
|
|
5046
|
+
const bundle = await buildHMRClient();
|
|
5047
|
+
return `<script>window.__HMR_FRAMEWORK__="vue";</script><script data-hmr-client>${bundle}</script>`;
|
|
5270
5048
|
};
|
|
5271
|
-
var
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5049
|
+
var getSsrOnlyHmrShim = () => {
|
|
5050
|
+
if (cachedSsrOnlyHmrShim)
|
|
5051
|
+
return cachedSsrOnlyHmrShim;
|
|
5052
|
+
cachedSsrOnlyHmrShim = buildSsrOnlyHmrShim();
|
|
5053
|
+
return cachedSsrOnlyHmrShim;
|
|
5054
|
+
};
|
|
5055
|
+
var handleVuePageRequest = async (input) => {
|
|
5056
|
+
const passedPageComponent = input.Page;
|
|
5057
|
+
const request = input.request ?? getCurrentAbsoluteRequest();
|
|
5058
|
+
const clientMode = input.client ?? "auto";
|
|
5059
|
+
const deferredAssets = input.pagePath === "" || clientMode === "auto" && input.indexPath === "" ? await resolveDeferredPageAssets() : null;
|
|
5060
|
+
const buildFailure = devBuildErrorResponse("vue", deferredAssets);
|
|
5061
|
+
if (buildFailure)
|
|
5062
|
+
return buildFailure;
|
|
5063
|
+
const resolvedPagePath = deferredAssets && input.pagePath === "" ? deferredAssets.lookup(deferredAssets.name) : input.pagePath;
|
|
5064
|
+
const resolvedIndexPath = deferredAssets && input.indexPath === "" ? deferredAssets.lookup(`${deferredAssets.name}Index`) : input.indexPath;
|
|
5065
|
+
const resolvedOptions = input;
|
|
5066
|
+
const pageName = deferredAssets?.name ?? derivePageName(resolvedPagePath);
|
|
5067
|
+
const pageId = input.__absoluteMobile?.pageId ?? pageName;
|
|
5068
|
+
const currentContract = input.__absoluteMobile?.contract ?? `vue:${pageId}:${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}`;
|
|
5069
|
+
const mobileResponse = finalizeAbsoluteMobilePage({
|
|
5070
|
+
compatibility: {
|
|
5071
|
+
framework: "vue",
|
|
5072
|
+
pageId,
|
|
5073
|
+
representations: [
|
|
5074
|
+
{ contract: currentContract, mapProps: (props) => props }
|
|
5075
|
+
],
|
|
5076
|
+
runtimes: [String(ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION)]
|
|
5285
5077
|
},
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
const resolvedValue = ref2(undefined);
|
|
5299
|
-
const hasError = ref2(false);
|
|
5300
|
-
const hasPatchedDom = ref2(readPatchedDomState());
|
|
5301
|
-
const usesFrameworkSlots = hasFrameworkSlots(slots.default, slots.fallback, slots.error, props.promise);
|
|
5302
|
-
const isSsrRender = useSSRContext() !== undefined;
|
|
5303
|
-
if (isSsrRender) {
|
|
5304
|
-
registerSuspenseSlotForSsr(props, slots, usesFrameworkSlots);
|
|
5078
|
+
props: input.props ?? Object.create(null),
|
|
5079
|
+
request,
|
|
5080
|
+
route: () => {
|
|
5081
|
+
const head = withDeferredStylesheets(input.headTag ?? "", deferredAssets);
|
|
5082
|
+
const title = readHeadTitle(head);
|
|
5083
|
+
return {
|
|
5084
|
+
assets: {
|
|
5085
|
+
css: readHeadStylesheets(head),
|
|
5086
|
+
...clientMode === "auto" && resolvedIndexPath ? { index: resolvedIndexPath } : {}
|
|
5087
|
+
},
|
|
5088
|
+
...title ? { head: { title } } : {}
|
|
5089
|
+
};
|
|
5305
5090
|
}
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5091
|
+
});
|
|
5092
|
+
if (mobileResponse)
|
|
5093
|
+
return mobileResponse;
|
|
5094
|
+
const userHeadTag = withDeferredStylesheets(input.headTag ?? "<head></head>", deferredAssets);
|
|
5095
|
+
const [siblingCss, spaChildCss] = await Promise.all([
|
|
5096
|
+
readSiblingCss(resolvedPagePath),
|
|
5097
|
+
resolveSpaChildCss(resolvedPagePath, request?.url)
|
|
5098
|
+
]);
|
|
5099
|
+
const resolvedHeadTag = injectInlineCss(injectInlineCss(userHeadTag, siblingCss), spaChildCss);
|
|
5100
|
+
const maybeProps = input.props;
|
|
5101
|
+
if (resolvedPagePath === "") {
|
|
5102
|
+
throw new Error(`Asset "${pageName || "Page"}" not found in manifest.`);
|
|
5103
|
+
}
|
|
5104
|
+
if (clientMode === "auto" && resolvedIndexPath === "") {
|
|
5105
|
+
throw new Error(`Asset "${pageName || "Page"}Index" not found in manifest.`);
|
|
5106
|
+
}
|
|
5107
|
+
if (clientMode === "auto" && !resolvedIndexPath) {
|
|
5108
|
+
throw new Error('handleVuePageRequest: `indexPath` is required when `client` is `"auto"` (the default). Pass `client: "none"` to ship a SSR-only page with no client bundle.');
|
|
5109
|
+
}
|
|
5110
|
+
try {
|
|
5111
|
+
const spaNotFound = await renderSpaNotFound("vue", pageName, request);
|
|
5112
|
+
if (spaNotFound)
|
|
5113
|
+
return withPageCacheHeaders(spaNotFound, request);
|
|
5114
|
+
const handlerCallsite = resolvedOptions?.collectStreamingSlots === true ? undefined : getCurrentRouteRegistrationCallsite() ?? captureStreamingSlotWarningCallsite();
|
|
5115
|
+
const renderPageResponse = async () => {
|
|
5116
|
+
const resolvePageComponent = async () => {
|
|
5117
|
+
if (isGenericVueComponent(passedPageComponent)) {
|
|
5118
|
+
const setupApp = null;
|
|
5119
|
+
return {
|
|
5120
|
+
component: passedPageComponent,
|
|
5121
|
+
hasIslands: readHasIslands(passedPageComponent),
|
|
5122
|
+
hasSpaRoutes: false,
|
|
5123
|
+
setupApp
|
|
5124
|
+
};
|
|
5314
5125
|
}
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
return true;
|
|
5321
|
-
};
|
|
5322
|
-
const handlePatchedDom = (event) => {
|
|
5323
|
-
if (hasEventDetailId(event, props.id)) {
|
|
5324
|
-
hasPatchedDom.value = true;
|
|
5126
|
+
const generatedPagePath = await resolveGeneratedVueModulePath(resolvedPagePath);
|
|
5127
|
+
const importedPageModule = await import(generatedPagePath);
|
|
5128
|
+
const importedPageComponent = readDefaultExport(importedPageModule) ?? importedPageModule;
|
|
5129
|
+
if (!isGenericVueComponent(importedPageComponent)) {
|
|
5130
|
+
throw new Error(`Invalid Vue page module: ${generatedPagePath}`);
|
|
5325
5131
|
}
|
|
5132
|
+
return {
|
|
5133
|
+
component: importedPageComponent,
|
|
5134
|
+
hasIslands: readHasIslands(importedPageModule),
|
|
5135
|
+
hasSpaRoutes: readHasSpaRoutes(importedPageModule),
|
|
5136
|
+
setupApp: readSetupAppHook(importedPageModule)
|
|
5137
|
+
};
|
|
5326
5138
|
};
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5139
|
+
const resolvedPage = await resolvePageComponent();
|
|
5140
|
+
const { createSSRApp } = await import("vue");
|
|
5141
|
+
const { renderToString, renderToWebStream } = await import("vue/server-renderer");
|
|
5142
|
+
const app = createSSRApp(resolvedPage.component, maybeProps ?? null);
|
|
5143
|
+
let pendingRedirect = null;
|
|
5144
|
+
let pendingNotFound = false;
|
|
5145
|
+
if (resolvedPage.setupApp) {
|
|
5146
|
+
const url = resolveRequestRenderUrl(request);
|
|
5147
|
+
await resolvedPage.setupApp(app, {
|
|
5148
|
+
isServer: true,
|
|
5149
|
+
router: null,
|
|
5150
|
+
url,
|
|
5151
|
+
setNotFound: () => {
|
|
5152
|
+
pendingNotFound = true;
|
|
5153
|
+
},
|
|
5154
|
+
setRedirect: (location, status) => {
|
|
5155
|
+
pendingRedirect = {
|
|
5156
|
+
location,
|
|
5157
|
+
status: status ?? 302
|
|
5158
|
+
};
|
|
5159
|
+
}
|
|
5160
|
+
});
|
|
5341
5161
|
}
|
|
5342
|
-
if (
|
|
5343
|
-
|
|
5162
|
+
if (pendingRedirect !== null) {
|
|
5163
|
+
const redirect = pendingRedirect;
|
|
5164
|
+
return new Response(null, {
|
|
5165
|
+
headers: { Location: redirect.location },
|
|
5166
|
+
status: redirect.status
|
|
5167
|
+
});
|
|
5344
5168
|
}
|
|
5345
|
-
if (
|
|
5346
|
-
return
|
|
5169
|
+
if (pendingNotFound) {
|
|
5170
|
+
return await renderFirstNotFound() ?? new Response("Not found", {
|
|
5171
|
+
headers: { "Content-Type": "text/plain" },
|
|
5172
|
+
status: 404
|
|
5173
|
+
});
|
|
5347
5174
|
}
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5175
|
+
const ssrContext = {};
|
|
5176
|
+
const head = `<!DOCTYPE html><html>${resolvedHeadTag}<body><div id="root">`;
|
|
5177
|
+
const ssrOnlyHmrShim = clientMode === "none" ? await getSsrOnlyHmrShim() : "";
|
|
5178
|
+
const buildTail = () => {
|
|
5179
|
+
const teleports = ssrContext.teleports?.[ABSOLUTE_TELEPORT_TARGET] ?? "";
|
|
5180
|
+
const teleportHost = `<div id="${ABSOLUTE_TELEPORT_TARGET_ID}">${teleports}</div>`;
|
|
5181
|
+
return clientMode === "none" ? `</div>${teleportHost}${ssrOnlyHmrShim}</body></html>` : `</div>${teleportHost}<script>${BROWSER_TRANSLATION_BASELINE_SCRIPT}window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script><script type="module" src="${resolvedIndexPath}"></script></body></html>`;
|
|
5182
|
+
};
|
|
5183
|
+
if (resolvedPage.hasSpaRoutes && clientMode === "auto") {
|
|
5184
|
+
return new Response(`${head}${buildTail()}`, {
|
|
5185
|
+
headers: { "Content-Type": "text/html" }
|
|
5357
5186
|
});
|
|
5358
5187
|
}
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
}
|
|
5188
|
+
if (resolvedOptions?.collectStreamingSlots !== true) {
|
|
5189
|
+
const body = await renderToString(app, ssrContext);
|
|
5190
|
+
return new Response(`${head}${body}${buildTail()}`, {
|
|
5191
|
+
headers: streamingPageHeaders()
|
|
5192
|
+
});
|
|
5193
|
+
}
|
|
5194
|
+
const bodyStream = renderToWebStream(app, ssrContext);
|
|
5195
|
+
const { firstChunk, reader } = await primeVueStream(bodyStream);
|
|
5196
|
+
const stream = new ReadableStream({
|
|
5197
|
+
start(controller) {
|
|
5198
|
+
controller.enqueue(head);
|
|
5199
|
+
if (!firstChunk.done) {
|
|
5200
|
+
controller.enqueue(firstChunk.value);
|
|
5201
|
+
}
|
|
5202
|
+
if (firstChunk.done) {
|
|
5203
|
+
controller.enqueue(buildTail());
|
|
5204
|
+
controller.close();
|
|
5205
|
+
return;
|
|
5206
|
+
}
|
|
5207
|
+
const pumpLoop = () => {
|
|
5208
|
+
reader.read().then(({ done, value }) => done ? (controller.enqueue(buildTail()), controller.close()) : (controller.enqueue(value), pumpLoop())).catch((err) => {
|
|
5209
|
+
console.error("[SSR] Vue streaming render error:", err);
|
|
5210
|
+
reader.cancel(err).catch(() => {
|
|
5211
|
+
return;
|
|
5212
|
+
});
|
|
5213
|
+
controller.error(err);
|
|
5214
|
+
});
|
|
5215
|
+
};
|
|
5216
|
+
pumpLoop();
|
|
5217
|
+
}
|
|
5218
|
+
});
|
|
5219
|
+
const htmlStream = injectIslandPageContextStream(stream, {
|
|
5220
|
+
hasIslands: resolvedPage.hasIslands
|
|
5221
|
+
});
|
|
5222
|
+
return new Response(htmlStream, {
|
|
5223
|
+
headers: streamingPageHeaders()
|
|
5224
|
+
});
|
|
5365
5225
|
};
|
|
5226
|
+
const pageResponse = await runWithStreamingSlotWarningScope(() => resolvedOptions?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, resolvedOptions) : renderPageResponse(), { handlerCallsite });
|
|
5227
|
+
return withPageCacheHeaders(pageResponse, request, {
|
|
5228
|
+
bufferStreamForEtag: input.bufferStreamForEtag
|
|
5229
|
+
});
|
|
5230
|
+
} catch (error) {
|
|
5231
|
+
console.error("[SSR] Vue render error:", error);
|
|
5232
|
+
const conventionResponse = await renderConventionError("vue", pageName, error);
|
|
5233
|
+
if (conventionResponse) {
|
|
5234
|
+
return withPageCacheHeaders(conventionResponse, request);
|
|
5235
|
+
}
|
|
5236
|
+
return withPageCacheHeaders(new Response(ssrErrorPage("vue", error), {
|
|
5237
|
+
headers: { "Content-Type": "text/html" },
|
|
5238
|
+
status: 500
|
|
5239
|
+
}), request);
|
|
5366
5240
|
}
|
|
5367
|
-
});
|
|
5368
|
-
// src/vue/components/StreamSlot.ts
|
|
5369
|
-
import { defineComponent as defineComponent3, h as h3, useSSRContext as useSSRContext2 } from "vue";
|
|
5370
|
-
var StreamSlot = defineComponent3({
|
|
5371
|
-
name: "AbsoluteStreamSlot",
|
|
5372
|
-
props: {
|
|
5373
|
-
className: { default: undefined, type: String },
|
|
5374
|
-
errorHtml: { default: undefined, type: String },
|
|
5375
|
-
fallbackHtml: { default: "", type: String },
|
|
5376
|
-
id: { required: true, type: String },
|
|
5377
|
-
resolve: {
|
|
5378
|
-
required: true,
|
|
5379
|
-
type: Function
|
|
5380
|
-
},
|
|
5381
|
-
timeoutMs: { default: undefined, type: Number }
|
|
5382
|
-
},
|
|
5383
|
-
setup(props) {
|
|
5384
|
-
if (useSSRContext2() !== undefined) {
|
|
5385
|
-
registerStreamSlotForSsr(props);
|
|
5386
|
-
}
|
|
5387
|
-
return () => h3("div", {
|
|
5388
|
-
class: props.className,
|
|
5389
|
-
"data-absolute-slot": "true",
|
|
5390
|
-
id: props.id,
|
|
5391
|
-
innerHTML: props.fallbackHtml
|
|
5392
|
-
});
|
|
5393
|
-
}
|
|
5394
|
-
});
|
|
5395
|
-
var registerStreamSlotForSsr = (props) => {
|
|
5396
|
-
if (!isStreamingSlotCollectionActive()) {
|
|
5397
|
-
warnMissingStreamingSlotCollector("StreamSlot");
|
|
5398
|
-
return;
|
|
5399
|
-
}
|
|
5400
|
-
registerStreamingSlot({
|
|
5401
|
-
errorHtml: props.errorHtml,
|
|
5402
|
-
fallbackHtml: props.fallbackHtml,
|
|
5403
|
-
id: props.id,
|
|
5404
|
-
resolve: props.resolve,
|
|
5405
|
-
timeoutMs: props.timeoutMs
|
|
5406
|
-
});
|
|
5407
5241
|
};
|
|
5408
|
-
// src/vue/
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
// src/core/responseEnhancers.ts
|
|
5418
|
-
init_streamingSlots();
|
|
5419
|
-
init_pageResponseCache();
|
|
5420
|
-
var toResponse = async (responseLike) => responseLike;
|
|
5421
|
-
var cloneHeaders = (response) => {
|
|
5422
|
-
const headers = new Headers(response.headers);
|
|
5423
|
-
return headers;
|
|
5424
|
-
};
|
|
5425
|
-
var enhanceHtmlResponseWithStreamingSlots = (response, {
|
|
5426
|
-
nonce,
|
|
5427
|
-
onError,
|
|
5428
|
-
runtimePlacement,
|
|
5429
|
-
runtimePreludeScript,
|
|
5430
|
-
streamingSlots = [],
|
|
5431
|
-
policy
|
|
5432
|
-
} = {}) => {
|
|
5433
|
-
if (!response.body || streamingSlots.length === 0) {
|
|
5434
|
-
return response;
|
|
5242
|
+
// src/vue/routerRedirectProviders.ts
|
|
5243
|
+
var DEFAULT_REDIRECT_STATUS = 302;
|
|
5244
|
+
var normalisePathname = (raw) => {
|
|
5245
|
+
try {
|
|
5246
|
+
const parsed = new URL(raw, "http://placeholder.local/");
|
|
5247
|
+
return `${parsed.pathname}${parsed.search}`;
|
|
5248
|
+
} catch {
|
|
5249
|
+
return raw;
|
|
5435
5250
|
}
|
|
5436
|
-
const body = appendStreamingSlotPatchesToStream(response.body, streamingSlots, {
|
|
5437
|
-
nonce,
|
|
5438
|
-
onError,
|
|
5439
|
-
policy,
|
|
5440
|
-
runtimePlacement,
|
|
5441
|
-
runtimePreludeScript
|
|
5442
|
-
});
|
|
5443
|
-
const headers = cloneHeaders(response);
|
|
5444
|
-
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
5445
|
-
return new Response(body, {
|
|
5446
|
-
headers,
|
|
5447
|
-
status: response.status,
|
|
5448
|
-
statusText: response.statusText
|
|
5449
|
-
});
|
|
5450
|
-
};
|
|
5451
|
-
var withStreamingSlots = async (responseLike, options = {}) => enhanceHtmlResponseWithStreamingSlots(await toResponse(responseLike), options);
|
|
5452
|
-
var mergeStreamingSlots = (registered, explicit) => {
|
|
5453
|
-
const merged = new Map;
|
|
5454
|
-
for (const slot of registered)
|
|
5455
|
-
merged.set(slot.id, slot);
|
|
5456
|
-
for (const slot of explicit)
|
|
5457
|
-
merged.set(slot.id, slot);
|
|
5458
|
-
return [...merged.values()];
|
|
5459
5251
|
};
|
|
5460
|
-
var
|
|
5461
|
-
const
|
|
5462
|
-
const
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
});
|
|
5252
|
+
var applyVueRouterRedirect = (router, requestedUrl, setRedirect, status = DEFAULT_REDIRECT_STATUS) => {
|
|
5253
|
+
const finalPath = router.currentRoute.value.fullPath;
|
|
5254
|
+
const requestedPath = normalisePathname(requestedUrl);
|
|
5255
|
+
if (finalPath === requestedPath)
|
|
5256
|
+
return;
|
|
5257
|
+
setRedirect(finalPath, status);
|
|
5467
5258
|
};
|
|
5259
|
+
// src/vue/defineVuePage.ts
|
|
5260
|
+
var defineRoutes = (routes) => routes;
|
|
5261
|
+
var defineVueSetupApp = (hook) => hook;
|
|
5262
|
+
// src/vue/Island.ts
|
|
5263
|
+
import { defineComponent, h, onServerPrefetch } from "vue";
|
|
5468
5264
|
|
|
5469
|
-
// src/
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
var isAsyncLocalStorage3 = (value) => isObjectRecord5(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
5475
|
-
var getWarningStorage = () => {
|
|
5476
|
-
const value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY2);
|
|
5477
|
-
if (value === null || typeof value === "undefined") {
|
|
5478
|
-
return;
|
|
5265
|
+
// src/client/preserveIslandMarkup.ts
|
|
5266
|
+
init_islandMarkupAttributes();
|
|
5267
|
+
var getSnapshotMap = () => {
|
|
5268
|
+
if (typeof window === "undefined") {
|
|
5269
|
+
return null;
|
|
5479
5270
|
}
|
|
5480
|
-
|
|
5271
|
+
window.__ABS_SERVER_ISLAND_HTML__ ??= new Map;
|
|
5272
|
+
return window.__ABS_SERVER_ISLAND_HTML__;
|
|
5481
5273
|
};
|
|
5482
|
-
var
|
|
5483
|
-
const
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5274
|
+
var getIslandSignature = (props) => {
|
|
5275
|
+
const attributes = getIslandMarkerAttributes(props);
|
|
5276
|
+
return [
|
|
5277
|
+
attributes["data-component"],
|
|
5278
|
+
attributes["data-framework"],
|
|
5279
|
+
attributes["data-hydrate"],
|
|
5280
|
+
attributes["data-props"]
|
|
5281
|
+
].join("::");
|
|
5490
5282
|
};
|
|
5491
|
-
var
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
if (!match) {
|
|
5495
|
-
return `\x1B[36m${callsite}\x1B[0m`;
|
|
5283
|
+
var isMatchingIslandElement = (element, props) => {
|
|
5284
|
+
if (!(element instanceof HTMLElement)) {
|
|
5285
|
+
return false;
|
|
5496
5286
|
}
|
|
5497
|
-
|
|
5498
|
-
};
|
|
5499
|
-
var shouldIgnoreWarningFrame = (frame) => frame.includes("/node_modules/") || frame.includes("/dist/") || frame.includes("/src/react/pageHandler.") || frame.includes("/src/vue/pageHandler.") || frame.includes("/src/svelte/pageHandler.") || frame.includes("/src/angular/pageHandler.") || frame.includes("/src/core/streamingSlotWarningScope.");
|
|
5500
|
-
var getWarningLocation = (frame) => frame.match(/\((\/[^)]+:\d+:\d+)\)$/)?.[1] ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/)?.[1];
|
|
5501
|
-
var extractCallsiteFromStack = (stack) => {
|
|
5502
|
-
const location = stack.split(`
|
|
5503
|
-
`).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
|
|
5504
|
-
return location ? normalizeCallsitePath2(location) : undefined;
|
|
5287
|
+
const attributes = getIslandMarkerAttributes(props);
|
|
5288
|
+
return element.dataset.island === "true" && element.dataset.component === attributes["data-component"] && element.dataset.framework === attributes["data-framework"] && (element.dataset.hydrate ?? "load") === attributes["data-hydrate"] && (element.dataset.props ?? "{}") === attributes["data-props"];
|
|
5505
5289
|
};
|
|
5506
|
-
var
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
}
|
|
5513
|
-
store.hasWarned = true;
|
|
5514
|
-
logWarn(buildMissingCollectorWarning(primitiveName, store.handlerCallsite));
|
|
5290
|
+
var preserveIslandMarkup = (props) => {
|
|
5291
|
+
if (typeof document === "undefined") {
|
|
5292
|
+
return {
|
|
5293
|
+
attributes: getIslandMarkerAttributes(props),
|
|
5294
|
+
innerHTML: ""
|
|
5295
|
+
};
|
|
5515
5296
|
}
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
return;
|
|
5297
|
+
const snapshotMap = getSnapshotMap();
|
|
5298
|
+
const signature = getIslandSignature(props);
|
|
5299
|
+
const snapshotCandidate = snapshotMap?.get(signature)?.[0];
|
|
5300
|
+
if (snapshotCandidate) {
|
|
5301
|
+
return snapshotCandidate;
|
|
5522
5302
|
}
|
|
5523
|
-
|
|
5303
|
+
const liveCandidate = Array.from(document.querySelectorAll('[data-island="true"]')).find((element) => isMatchingIslandElement(element, props));
|
|
5304
|
+
if (!liveCandidate) {
|
|
5305
|
+
return {
|
|
5306
|
+
attributes: getIslandMarkerAttributes(props),
|
|
5307
|
+
innerHTML: ""
|
|
5308
|
+
};
|
|
5309
|
+
}
|
|
5310
|
+
return {
|
|
5311
|
+
attributes: Object.fromEntries(liveCandidate.getAttributeNames().map((name) => [name, liveCandidate.getAttribute(name) ?? ""])),
|
|
5312
|
+
innerHTML: liveCandidate.innerHTML
|
|
5313
|
+
};
|
|
5524
5314
|
};
|
|
5525
|
-
var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({ handlerCallsite: metadata?.handlerCallsite, hasWarned: false }, task);
|
|
5526
5315
|
|
|
5527
|
-
// src/vue/
|
|
5528
|
-
|
|
5529
|
-
init_routeAssets();
|
|
5316
|
+
// src/vue/Island.ts
|
|
5317
|
+
init_islandMarkupAttributes();
|
|
5530
5318
|
|
|
5531
|
-
// src/
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5319
|
+
// src/core/normalizeIslandProps.ts
|
|
5320
|
+
var EMPTY_PROPS = {};
|
|
5321
|
+
var ISLAND_FRAMEWORKS = [
|
|
5322
|
+
"react",
|
|
5323
|
+
"svelte",
|
|
5324
|
+
"vue",
|
|
5325
|
+
"angular",
|
|
5326
|
+
"ember"
|
|
5327
|
+
];
|
|
5328
|
+
var ISLAND_HYDRATE_MODES = [
|
|
5329
|
+
"load",
|
|
5330
|
+
"idle",
|
|
5331
|
+
"visible",
|
|
5332
|
+
"none"
|
|
5333
|
+
];
|
|
5334
|
+
var isIslandFramework = (value) => ISLAND_FRAMEWORKS.some((framework) => framework === value);
|
|
5335
|
+
var isIslandHydrate = (value) => ISLAND_HYDRATE_MODES.some((mode) => mode === value);
|
|
5336
|
+
var normalizeRuntimeIslandRenderProps = (raw) => {
|
|
5337
|
+
const { component, framework, hydrate, props } = raw;
|
|
5338
|
+
if (!isIslandFramework(framework)) {
|
|
5339
|
+
throw new Error(`Unknown island framework: "${framework}".`);
|
|
5340
|
+
}
|
|
5341
|
+
if (hydrate !== undefined && !isIslandHydrate(hydrate)) {
|
|
5342
|
+
throw new Error(`Unknown island hydrate mode: "${hydrate}".`);
|
|
5343
|
+
}
|
|
5344
|
+
return {
|
|
5345
|
+
component,
|
|
5346
|
+
framework,
|
|
5347
|
+
hydrate,
|
|
5348
|
+
props: normalizeIslandProps(props)
|
|
5349
|
+
};
|
|
5350
|
+
};
|
|
5351
|
+
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5352
|
+
var safeJsonParseObject = (raw) => {
|
|
5353
|
+
const trimmed = raw.trim();
|
|
5354
|
+
if (!trimmed)
|
|
5355
|
+
return EMPTY_PROPS;
|
|
5536
5356
|
try {
|
|
5537
|
-
|
|
5538
|
-
return
|
|
5357
|
+
const parsed = JSON.parse(trimmed);
|
|
5358
|
+
return isPlainObject(parsed) ? parsed : EMPTY_PROPS;
|
|
5539
5359
|
} catch {
|
|
5540
|
-
return
|
|
5541
|
-
}
|
|
5542
|
-
};
|
|
5543
|
-
var resolveGeneratedVueModulePath = async (pagePath) => {
|
|
5544
|
-
if (await canAccess(pagePath))
|
|
5545
|
-
return pagePath;
|
|
5546
|
-
const pageDirectory = dirname2(pagePath);
|
|
5547
|
-
const expectedPrefix = `${basename3(pagePath, ".js").split(".")[0]}.`;
|
|
5548
|
-
try {
|
|
5549
|
-
const pageEntries = await readdir(pageDirectory, {
|
|
5550
|
-
withFileTypes: true
|
|
5551
|
-
});
|
|
5552
|
-
const matchingEntries = pageEntries.filter((entry) => entry.isFile() && entry.name.endsWith(".js") && (entry.name === `${expectedPrefix.slice(0, EXCLUDE_LAST_OFFSET)}.js` || entry.name.startsWith(expectedPrefix)));
|
|
5553
|
-
const candidates = await Promise.all(matchingEntries.map(async (entry) => {
|
|
5554
|
-
const path = `${pageDirectory}/${entry.name}`;
|
|
5555
|
-
const metadata = await stat(path);
|
|
5556
|
-
return { modifiedAt: metadata.mtimeMs, path };
|
|
5557
|
-
}));
|
|
5558
|
-
candidates.sort((left, right) => right.modifiedAt - left.modifiedAt || left.path.localeCompare(right.path));
|
|
5559
|
-
return candidates[0]?.path ?? pagePath;
|
|
5560
|
-
} catch {
|
|
5561
|
-
return pagePath;
|
|
5562
|
-
}
|
|
5563
|
-
};
|
|
5564
|
-
|
|
5565
|
-
// src/vue/teleports.ts
|
|
5566
|
-
var ABSOLUTE_TELEPORT_TARGET_ID = "absolute-teleports";
|
|
5567
|
-
var ABSOLUTE_TELEPORT_TARGET = `#${ABSOLUTE_TELEPORT_TARGET_ID}`;
|
|
5568
|
-
|
|
5569
|
-
// src/vue/pageHandler.ts
|
|
5570
|
-
init_browserTranslation();
|
|
5571
|
-
var isRecord3 = (value) => typeof value === "object" && value !== null;
|
|
5572
|
-
var isGenericVueComponent = (value) => typeof value === "function" || isRecord3(value);
|
|
5573
|
-
var readHasIslands = (value) => {
|
|
5574
|
-
if (!isRecord3(value))
|
|
5575
|
-
return false;
|
|
5576
|
-
const hasIslands = value["__ABSOLUTE_PAGE_HAS_ISLANDS__"];
|
|
5577
|
-
return typeof hasIslands === "boolean" ? hasIslands : false;
|
|
5578
|
-
};
|
|
5579
|
-
var isVueSetupApp = (value) => typeof value === "function";
|
|
5580
|
-
var readSetupAppHook = (value) => {
|
|
5581
|
-
if (!isRecord3(value))
|
|
5582
|
-
return null;
|
|
5583
|
-
const { setupApp } = value;
|
|
5584
|
-
return isVueSetupApp(setupApp) ? setupApp : null;
|
|
5585
|
-
};
|
|
5586
|
-
var readHasSpaRoutes = (value) => isRecord3(value) && Array.isArray(value["routes"]);
|
|
5587
|
-
var readDefaultExport = (value) => isRecord3(value) ? value.default : undefined;
|
|
5588
|
-
var resolveRequestRenderUrl = (request) => {
|
|
5589
|
-
if (!request)
|
|
5590
|
-
return "/";
|
|
5591
|
-
try {
|
|
5592
|
-
const parsed = new URL(request.url);
|
|
5593
|
-
return `${parsed.pathname}${parsed.search}`;
|
|
5594
|
-
} catch {
|
|
5595
|
-
return "/";
|
|
5596
|
-
}
|
|
5597
|
-
};
|
|
5598
|
-
var primeVueStream = async (stream) => {
|
|
5599
|
-
const reader = stream.getReader();
|
|
5600
|
-
const firstChunk = await reader.read();
|
|
5601
|
-
return { firstChunk, reader };
|
|
5602
|
-
};
|
|
5603
|
-
var cachedSsrOnlyHmrShim = null;
|
|
5604
|
-
var buildSsrOnlyHmrShim = async () => {
|
|
5605
|
-
const { buildHMRClient: buildHMRClient2 } = await Promise.resolve().then(() => (init_buildHMRClient(), exports_buildHMRClient));
|
|
5606
|
-
const bundle = await buildHMRClient2();
|
|
5607
|
-
return `<script>window.__HMR_FRAMEWORK__="vue";</script><script data-hmr-client>${bundle}</script>`;
|
|
5608
|
-
};
|
|
5609
|
-
var getSsrOnlyHmrShim = () => {
|
|
5610
|
-
if (cachedSsrOnlyHmrShim)
|
|
5611
|
-
return cachedSsrOnlyHmrShim;
|
|
5612
|
-
cachedSsrOnlyHmrShim = buildSsrOnlyHmrShim();
|
|
5613
|
-
return cachedSsrOnlyHmrShim;
|
|
5614
|
-
};
|
|
5615
|
-
var handleVuePageRequest = async (input) => {
|
|
5616
|
-
const passedPageComponent = input.Page;
|
|
5617
|
-
const request = input.request ?? getCurrentAbsoluteRequest();
|
|
5618
|
-
const clientMode = input.client ?? "auto";
|
|
5619
|
-
const deferredAssets = input.pagePath === "" || clientMode === "auto" && input.indexPath === "" ? await resolveDeferredPageAssets() : null;
|
|
5620
|
-
const buildFailure = devBuildErrorResponse("vue", deferredAssets);
|
|
5621
|
-
if (buildFailure)
|
|
5622
|
-
return buildFailure;
|
|
5623
|
-
const resolvedPagePath = deferredAssets && input.pagePath === "" ? deferredAssets.lookup(deferredAssets.name) : input.pagePath;
|
|
5624
|
-
const resolvedIndexPath = deferredAssets && input.indexPath === "" ? deferredAssets.lookup(`${deferredAssets.name}Index`) : input.indexPath;
|
|
5625
|
-
const resolvedOptions = input;
|
|
5626
|
-
const pageName = deferredAssets?.name ?? derivePageName(resolvedPagePath);
|
|
5627
|
-
const pageId = input.__absoluteMobile?.pageId ?? pageName;
|
|
5628
|
-
const currentContract = input.__absoluteMobile?.contract ?? `vue:${pageId}:${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}`;
|
|
5629
|
-
const mobileResponse = finalizeAbsoluteMobilePage({
|
|
5630
|
-
compatibility: {
|
|
5631
|
-
framework: "vue",
|
|
5632
|
-
pageId,
|
|
5633
|
-
representations: [
|
|
5634
|
-
{ contract: currentContract, mapProps: (props) => props }
|
|
5635
|
-
],
|
|
5636
|
-
runtimes: [String(ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION)]
|
|
5637
|
-
},
|
|
5638
|
-
props: input.props ?? Object.create(null),
|
|
5639
|
-
request,
|
|
5640
|
-
route: () => {
|
|
5641
|
-
const head = withDeferredStylesheets(input.headTag ?? "", deferredAssets);
|
|
5642
|
-
const title = readHeadTitle(head);
|
|
5643
|
-
return {
|
|
5644
|
-
assets: {
|
|
5645
|
-
css: readHeadStylesheets(head),
|
|
5646
|
-
...clientMode === "auto" && resolvedIndexPath ? { index: resolvedIndexPath } : {}
|
|
5647
|
-
},
|
|
5648
|
-
...title ? { head: { title } } : {}
|
|
5649
|
-
};
|
|
5650
|
-
}
|
|
5651
|
-
});
|
|
5652
|
-
if (mobileResponse)
|
|
5653
|
-
return mobileResponse;
|
|
5654
|
-
const userHeadTag = withDeferredStylesheets(input.headTag ?? "<head></head>", deferredAssets);
|
|
5655
|
-
const [siblingCss, spaChildCss] = await Promise.all([
|
|
5656
|
-
readSiblingCss(resolvedPagePath),
|
|
5657
|
-
resolveSpaChildCss(resolvedPagePath, request?.url)
|
|
5658
|
-
]);
|
|
5659
|
-
const resolvedHeadTag = injectInlineCss(injectInlineCss(userHeadTag, siblingCss), spaChildCss);
|
|
5660
|
-
const maybeProps = input.props;
|
|
5661
|
-
if (resolvedPagePath === "") {
|
|
5662
|
-
throw new Error(`Asset "${pageName || "Page"}" not found in manifest.`);
|
|
5663
|
-
}
|
|
5664
|
-
if (clientMode === "auto" && resolvedIndexPath === "") {
|
|
5665
|
-
throw new Error(`Asset "${pageName || "Page"}Index" not found in manifest.`);
|
|
5666
|
-
}
|
|
5667
|
-
if (clientMode === "auto" && !resolvedIndexPath) {
|
|
5668
|
-
throw new Error('handleVuePageRequest: `indexPath` is required when `client` is `"auto"` (the default). Pass `client: "none"` to ship a SSR-only page with no client bundle.');
|
|
5669
|
-
}
|
|
5670
|
-
try {
|
|
5671
|
-
const spaNotFound = await renderSpaNotFound("vue", pageName, request);
|
|
5672
|
-
if (spaNotFound)
|
|
5673
|
-
return withPageCacheHeaders(spaNotFound, request);
|
|
5674
|
-
const handlerCallsite = resolvedOptions?.collectStreamingSlots === true ? undefined : getCurrentRouteRegistrationCallsite() ?? captureStreamingSlotWarningCallsite();
|
|
5675
|
-
const renderPageResponse = async () => {
|
|
5676
|
-
const resolvePageComponent = async () => {
|
|
5677
|
-
if (isGenericVueComponent(passedPageComponent)) {
|
|
5678
|
-
const setupApp = null;
|
|
5679
|
-
return {
|
|
5680
|
-
component: passedPageComponent,
|
|
5681
|
-
hasIslands: readHasIslands(passedPageComponent),
|
|
5682
|
-
hasSpaRoutes: false,
|
|
5683
|
-
setupApp
|
|
5684
|
-
};
|
|
5685
|
-
}
|
|
5686
|
-
const generatedPagePath = await resolveGeneratedVueModulePath(resolvedPagePath);
|
|
5687
|
-
const importedPageModule = await import(generatedPagePath);
|
|
5688
|
-
const importedPageComponent = readDefaultExport(importedPageModule) ?? importedPageModule;
|
|
5689
|
-
if (!isGenericVueComponent(importedPageComponent)) {
|
|
5690
|
-
throw new Error(`Invalid Vue page module: ${generatedPagePath}`);
|
|
5691
|
-
}
|
|
5692
|
-
return {
|
|
5693
|
-
component: importedPageComponent,
|
|
5694
|
-
hasIslands: readHasIslands(importedPageModule),
|
|
5695
|
-
hasSpaRoutes: readHasSpaRoutes(importedPageModule),
|
|
5696
|
-
setupApp: readSetupAppHook(importedPageModule)
|
|
5697
|
-
};
|
|
5698
|
-
};
|
|
5699
|
-
const resolvedPage = await resolvePageComponent();
|
|
5700
|
-
const { createSSRApp } = await import("vue");
|
|
5701
|
-
const { renderToString, renderToWebStream } = await import("vue/server-renderer");
|
|
5702
|
-
const app = createSSRApp(resolvedPage.component, maybeProps ?? null);
|
|
5703
|
-
let pendingRedirect = null;
|
|
5704
|
-
let pendingNotFound = false;
|
|
5705
|
-
if (resolvedPage.setupApp) {
|
|
5706
|
-
const url = resolveRequestRenderUrl(request);
|
|
5707
|
-
await resolvedPage.setupApp(app, {
|
|
5708
|
-
isServer: true,
|
|
5709
|
-
router: null,
|
|
5710
|
-
url,
|
|
5711
|
-
setNotFound: () => {
|
|
5712
|
-
pendingNotFound = true;
|
|
5713
|
-
},
|
|
5714
|
-
setRedirect: (location, status) => {
|
|
5715
|
-
pendingRedirect = {
|
|
5716
|
-
location,
|
|
5717
|
-
status: status ?? 302
|
|
5718
|
-
};
|
|
5719
|
-
}
|
|
5720
|
-
});
|
|
5721
|
-
}
|
|
5722
|
-
if (pendingRedirect !== null) {
|
|
5723
|
-
const redirect = pendingRedirect;
|
|
5724
|
-
return new Response(null, {
|
|
5725
|
-
headers: { Location: redirect.location },
|
|
5726
|
-
status: redirect.status
|
|
5727
|
-
});
|
|
5728
|
-
}
|
|
5729
|
-
if (pendingNotFound) {
|
|
5730
|
-
return await renderFirstNotFound() ?? new Response("Not found", {
|
|
5731
|
-
headers: { "Content-Type": "text/plain" },
|
|
5732
|
-
status: 404
|
|
5733
|
-
});
|
|
5734
|
-
}
|
|
5735
|
-
const ssrContext = {};
|
|
5736
|
-
const head = `<!DOCTYPE html><html>${resolvedHeadTag}<body><div id="root">`;
|
|
5737
|
-
const ssrOnlyHmrShim = clientMode === "none" ? await getSsrOnlyHmrShim() : "";
|
|
5738
|
-
const buildTail = () => {
|
|
5739
|
-
const teleports = ssrContext.teleports?.[ABSOLUTE_TELEPORT_TARGET] ?? "";
|
|
5740
|
-
const teleportHost = `<div id="${ABSOLUTE_TELEPORT_TARGET_ID}">${teleports}</div>`;
|
|
5741
|
-
return clientMode === "none" ? `</div>${teleportHost}${ssrOnlyHmrShim}</body></html>` : `</div>${teleportHost}<script>${BROWSER_TRANSLATION_BASELINE_SCRIPT}window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script><script type="module" src="${resolvedIndexPath}"></script></body></html>`;
|
|
5742
|
-
};
|
|
5743
|
-
if (resolvedPage.hasSpaRoutes && clientMode === "auto") {
|
|
5744
|
-
return new Response(`${head}${buildTail()}`, {
|
|
5745
|
-
headers: { "Content-Type": "text/html" }
|
|
5746
|
-
});
|
|
5747
|
-
}
|
|
5748
|
-
if (resolvedOptions?.collectStreamingSlots !== true) {
|
|
5749
|
-
const body = await renderToString(app, ssrContext);
|
|
5750
|
-
return new Response(`${head}${body}${buildTail()}`, {
|
|
5751
|
-
headers: streamingPageHeaders()
|
|
5752
|
-
});
|
|
5753
|
-
}
|
|
5754
|
-
const bodyStream = renderToWebStream(app, ssrContext);
|
|
5755
|
-
const { firstChunk, reader } = await primeVueStream(bodyStream);
|
|
5756
|
-
const stream = new ReadableStream({
|
|
5757
|
-
start(controller) {
|
|
5758
|
-
controller.enqueue(head);
|
|
5759
|
-
if (!firstChunk.done) {
|
|
5760
|
-
controller.enqueue(firstChunk.value);
|
|
5761
|
-
}
|
|
5762
|
-
if (firstChunk.done) {
|
|
5763
|
-
controller.enqueue(buildTail());
|
|
5764
|
-
controller.close();
|
|
5765
|
-
return;
|
|
5766
|
-
}
|
|
5767
|
-
const pumpLoop = () => {
|
|
5768
|
-
reader.read().then(({ done, value }) => done ? (controller.enqueue(buildTail()), controller.close()) : (controller.enqueue(value), pumpLoop())).catch((err) => {
|
|
5769
|
-
console.error("[SSR] Vue streaming render error:", err);
|
|
5770
|
-
reader.cancel(err).catch(() => {
|
|
5771
|
-
return;
|
|
5772
|
-
});
|
|
5773
|
-
controller.error(err);
|
|
5774
|
-
});
|
|
5775
|
-
};
|
|
5776
|
-
pumpLoop();
|
|
5777
|
-
}
|
|
5778
|
-
});
|
|
5779
|
-
const htmlStream = injectIslandPageContextStream(stream, {
|
|
5780
|
-
hasIslands: resolvedPage.hasIslands
|
|
5781
|
-
});
|
|
5782
|
-
return new Response(htmlStream, {
|
|
5783
|
-
headers: streamingPageHeaders()
|
|
5784
|
-
});
|
|
5785
|
-
};
|
|
5786
|
-
const pageResponse = await runWithStreamingSlotWarningScope(() => resolvedOptions?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, resolvedOptions) : renderPageResponse(), { handlerCallsite });
|
|
5787
|
-
return withPageCacheHeaders(pageResponse, request, {
|
|
5788
|
-
bufferStreamForEtag: input.bufferStreamForEtag
|
|
5789
|
-
});
|
|
5790
|
-
} catch (error) {
|
|
5791
|
-
console.error("[SSR] Vue render error:", error);
|
|
5792
|
-
const conventionResponse = await renderConventionError("vue", pageName, error);
|
|
5793
|
-
if (conventionResponse) {
|
|
5794
|
-
return withPageCacheHeaders(conventionResponse, request);
|
|
5795
|
-
}
|
|
5796
|
-
return withPageCacheHeaders(new Response(ssrErrorPage("vue", error), {
|
|
5797
|
-
headers: { "Content-Type": "text/html" },
|
|
5798
|
-
status: 500
|
|
5799
|
-
}), request);
|
|
5800
|
-
}
|
|
5801
|
-
};
|
|
5802
|
-
// src/vue/routerRedirectProviders.ts
|
|
5803
|
-
var DEFAULT_REDIRECT_STATUS = 302;
|
|
5804
|
-
var normalisePathname = (raw) => {
|
|
5805
|
-
try {
|
|
5806
|
-
const parsed = new URL(raw, "http://placeholder.local/");
|
|
5807
|
-
return `${parsed.pathname}${parsed.search}`;
|
|
5808
|
-
} catch {
|
|
5809
|
-
return raw;
|
|
5810
|
-
}
|
|
5811
|
-
};
|
|
5812
|
-
var applyVueRouterRedirect = (router, requestedUrl, setRedirect, status = DEFAULT_REDIRECT_STATUS) => {
|
|
5813
|
-
const finalPath = router.currentRoute.value.fullPath;
|
|
5814
|
-
const requestedPath = normalisePathname(requestedUrl);
|
|
5815
|
-
if (finalPath === requestedPath)
|
|
5816
|
-
return;
|
|
5817
|
-
setRedirect(finalPath, status);
|
|
5818
|
-
};
|
|
5819
|
-
// src/vue/defineVuePage.ts
|
|
5820
|
-
var defineRoutes = (routes) => routes;
|
|
5821
|
-
var defineVueSetupApp = (hook) => hook;
|
|
5822
|
-
// src/vue/Island.ts
|
|
5823
|
-
import { defineComponent as defineComponent4, h as h4, onServerPrefetch } from "vue";
|
|
5824
|
-
|
|
5825
|
-
// src/client/preserveIslandMarkup.ts
|
|
5826
|
-
init_islandMarkupAttributes();
|
|
5827
|
-
var getSnapshotMap = () => {
|
|
5828
|
-
if (typeof window === "undefined") {
|
|
5829
|
-
return null;
|
|
5830
|
-
}
|
|
5831
|
-
window.__ABS_SERVER_ISLAND_HTML__ ??= new Map;
|
|
5832
|
-
return window.__ABS_SERVER_ISLAND_HTML__;
|
|
5833
|
-
};
|
|
5834
|
-
var getIslandSignature = (props) => {
|
|
5835
|
-
const attributes = getIslandMarkerAttributes(props);
|
|
5836
|
-
return [
|
|
5837
|
-
attributes["data-component"],
|
|
5838
|
-
attributes["data-framework"],
|
|
5839
|
-
attributes["data-hydrate"],
|
|
5840
|
-
attributes["data-props"]
|
|
5841
|
-
].join("::");
|
|
5842
|
-
};
|
|
5843
|
-
var isMatchingIslandElement = (element, props) => {
|
|
5844
|
-
if (!(element instanceof HTMLElement)) {
|
|
5845
|
-
return false;
|
|
5846
|
-
}
|
|
5847
|
-
const attributes = getIslandMarkerAttributes(props);
|
|
5848
|
-
return element.dataset.island === "true" && element.dataset.component === attributes["data-component"] && element.dataset.framework === attributes["data-framework"] && (element.dataset.hydrate ?? "load") === attributes["data-hydrate"] && (element.dataset.props ?? "{}") === attributes["data-props"];
|
|
5849
|
-
};
|
|
5850
|
-
var preserveIslandMarkup = (props) => {
|
|
5851
|
-
if (typeof document === "undefined") {
|
|
5852
|
-
return {
|
|
5853
|
-
attributes: getIslandMarkerAttributes(props),
|
|
5854
|
-
innerHTML: ""
|
|
5855
|
-
};
|
|
5856
|
-
}
|
|
5857
|
-
const snapshotMap = getSnapshotMap();
|
|
5858
|
-
const signature = getIslandSignature(props);
|
|
5859
|
-
const snapshotCandidate = snapshotMap?.get(signature)?.[0];
|
|
5860
|
-
if (snapshotCandidate) {
|
|
5861
|
-
return snapshotCandidate;
|
|
5862
|
-
}
|
|
5863
|
-
const liveCandidate = Array.from(document.querySelectorAll('[data-island="true"]')).find((element) => isMatchingIslandElement(element, props));
|
|
5864
|
-
if (!liveCandidate) {
|
|
5865
|
-
return {
|
|
5866
|
-
attributes: getIslandMarkerAttributes(props),
|
|
5867
|
-
innerHTML: ""
|
|
5868
|
-
};
|
|
5869
|
-
}
|
|
5870
|
-
return {
|
|
5871
|
-
attributes: Object.fromEntries(liveCandidate.getAttributeNames().map((name) => [name, liveCandidate.getAttribute(name) ?? ""])),
|
|
5872
|
-
innerHTML: liveCandidate.innerHTML
|
|
5873
|
-
};
|
|
5874
|
-
};
|
|
5875
|
-
|
|
5876
|
-
// src/vue/Island.ts
|
|
5877
|
-
init_islandMarkupAttributes();
|
|
5878
|
-
|
|
5879
|
-
// src/core/normalizeIslandProps.ts
|
|
5880
|
-
var EMPTY_PROPS = {};
|
|
5881
|
-
var ISLAND_FRAMEWORKS = [
|
|
5882
|
-
"react",
|
|
5883
|
-
"svelte",
|
|
5884
|
-
"vue",
|
|
5885
|
-
"angular",
|
|
5886
|
-
"ember"
|
|
5887
|
-
];
|
|
5888
|
-
var ISLAND_HYDRATE_MODES = [
|
|
5889
|
-
"load",
|
|
5890
|
-
"idle",
|
|
5891
|
-
"visible",
|
|
5892
|
-
"none"
|
|
5893
|
-
];
|
|
5894
|
-
var isIslandFramework = (value) => ISLAND_FRAMEWORKS.some((framework) => framework === value);
|
|
5895
|
-
var isIslandHydrate = (value) => ISLAND_HYDRATE_MODES.some((mode) => mode === value);
|
|
5896
|
-
var normalizeRuntimeIslandRenderProps = (raw) => {
|
|
5897
|
-
const { component, framework, hydrate, props } = raw;
|
|
5898
|
-
if (!isIslandFramework(framework)) {
|
|
5899
|
-
throw new Error(`Unknown island framework: "${framework}".`);
|
|
5900
|
-
}
|
|
5901
|
-
if (hydrate !== undefined && !isIslandHydrate(hydrate)) {
|
|
5902
|
-
throw new Error(`Unknown island hydrate mode: "${hydrate}".`);
|
|
5903
|
-
}
|
|
5904
|
-
return {
|
|
5905
|
-
component,
|
|
5906
|
-
framework,
|
|
5907
|
-
hydrate,
|
|
5908
|
-
props: normalizeIslandProps(props)
|
|
5909
|
-
};
|
|
5910
|
-
};
|
|
5911
|
-
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5912
|
-
var safeJsonParseObject = (raw) => {
|
|
5913
|
-
const trimmed = raw.trim();
|
|
5914
|
-
if (!trimmed)
|
|
5915
|
-
return EMPTY_PROPS;
|
|
5916
|
-
try {
|
|
5917
|
-
const parsed = JSON.parse(trimmed);
|
|
5918
|
-
return isPlainObject(parsed) ? parsed : EMPTY_PROPS;
|
|
5919
|
-
} catch {
|
|
5920
|
-
return EMPTY_PROPS;
|
|
5360
|
+
return EMPTY_PROPS;
|
|
5921
5361
|
}
|
|
5922
5362
|
};
|
|
5923
5363
|
var normalizeIslandProps = (value) => {
|
|
@@ -5930,7 +5370,7 @@ var normalizeIslandProps = (value) => {
|
|
|
5930
5370
|
|
|
5931
5371
|
// src/vue/Island.ts
|
|
5932
5372
|
init_renderIslandMarkup();
|
|
5933
|
-
var defineRuntimeIslandComponent = (setup) =>
|
|
5373
|
+
var defineRuntimeIslandComponent = (setup) => defineComponent({
|
|
5934
5374
|
name: "AbsoluteIsland",
|
|
5935
5375
|
props: {
|
|
5936
5376
|
component: {
|
|
@@ -5962,7 +5402,7 @@ var Island = defineRuntimeIslandComponent((props) => {
|
|
|
5962
5402
|
});
|
|
5963
5403
|
return () => {
|
|
5964
5404
|
const preserved = isBrowser ? preserveIslandMarkup(props) : null;
|
|
5965
|
-
return
|
|
5405
|
+
return h("div", {
|
|
5966
5406
|
...preserved?.attributes ?? markerAttributes,
|
|
5967
5407
|
"data-allow-mismatch": "",
|
|
5968
5408
|
innerHTML: isBrowser ? preserved?.innerHTML : html
|
|
@@ -5972,8 +5412,8 @@ var Island = defineRuntimeIslandComponent((props) => {
|
|
|
5972
5412
|
// src/vue/createIsland.ts
|
|
5973
5413
|
init_islandMarkupAttributes();
|
|
5974
5414
|
init_renderIslandMarkup();
|
|
5975
|
-
import { defineComponent as
|
|
5976
|
-
var defineRuntimeIslandComponent2 = (setup) =>
|
|
5415
|
+
import { defineComponent as defineComponent2, h as h2, onServerPrefetch as onServerPrefetch2 } from "vue";
|
|
5416
|
+
var defineRuntimeIslandComponent2 = (setup) => defineComponent2({
|
|
5977
5417
|
name: "AbsoluteIsland",
|
|
5978
5418
|
props: {
|
|
5979
5419
|
component: {
|
|
@@ -6003,14 +5443,14 @@ var createTypedIsland = (registry) => defineRuntimeIslandComponent2((props) => {
|
|
|
6003
5443
|
const result = await renderIslandResult(registry, props);
|
|
6004
5444
|
({ attributes: markerAttributes, html } = result);
|
|
6005
5445
|
});
|
|
6006
|
-
return () =>
|
|
5446
|
+
return () => h2("div", {
|
|
6007
5447
|
...markerAttributes,
|
|
6008
5448
|
"data-allow-mismatch": "",
|
|
6009
5449
|
innerHTML: isBrowser ? undefined : html
|
|
6010
5450
|
});
|
|
6011
5451
|
});
|
|
6012
5452
|
// src/vue/useIslandStore.ts
|
|
6013
|
-
import { customRef, onBeforeUnmount
|
|
5453
|
+
import { customRef, onBeforeUnmount } from "vue";
|
|
6014
5454
|
|
|
6015
5455
|
// node_modules/zustand/esm/vanilla.mjs
|
|
6016
5456
|
var createStoreImpl = (createState) => {
|
|
@@ -6109,182 +5549,599 @@ var subscribeIslandStore = (store, selector, listener) => {
|
|
|
6109
5549
|
});
|
|
6110
5550
|
};
|
|
6111
5551
|
|
|
6112
|
-
// src/vue/useIslandStore.ts
|
|
6113
|
-
var useIslandStore = (store, selector) => {
|
|
6114
|
-
let current = readIslandStore(store, selector);
|
|
6115
|
-
let unsubscribe;
|
|
6116
|
-
const state = customRef((track, trigger) => {
|
|
6117
|
-
unsubscribe = subscribeIslandStore(store, selector, (value) => {
|
|
6118
|
-
current = value;
|
|
6119
|
-
trigger();
|
|
5552
|
+
// src/vue/useIslandStore.ts
|
|
5553
|
+
var useIslandStore = (store, selector) => {
|
|
5554
|
+
let current = readIslandStore(store, selector);
|
|
5555
|
+
let unsubscribe;
|
|
5556
|
+
const state = customRef((track, trigger) => {
|
|
5557
|
+
unsubscribe = subscribeIslandStore(store, selector, (value) => {
|
|
5558
|
+
current = value;
|
|
5559
|
+
trigger();
|
|
5560
|
+
});
|
|
5561
|
+
return {
|
|
5562
|
+
get() {
|
|
5563
|
+
track();
|
|
5564
|
+
return current;
|
|
5565
|
+
},
|
|
5566
|
+
set() {}
|
|
5567
|
+
};
|
|
5568
|
+
});
|
|
5569
|
+
onBeforeUnmount(() => {
|
|
5570
|
+
unsubscribe?.();
|
|
5571
|
+
});
|
|
5572
|
+
return state;
|
|
5573
|
+
};
|
|
5574
|
+
// src/client/browserTranslation.ts
|
|
5575
|
+
init_browserTranslationAttributes();
|
|
5576
|
+
var translatedFontText = (node, baselines) => {
|
|
5577
|
+
if (!(node instanceof Element) || node.tagName !== "FONT")
|
|
5578
|
+
return;
|
|
5579
|
+
const elements = [node, ...node.querySelectorAll("*")];
|
|
5580
|
+
if (elements.some((element) => element.tagName !== "FONT" || baselines.has(element)))
|
|
5581
|
+
return;
|
|
5582
|
+
return node.textContent ?? "";
|
|
5583
|
+
};
|
|
5584
|
+
var translationRestorer = (restore, hasTranslation) => Object.assign(restore, { hasTranslation });
|
|
5585
|
+
var emptyTranslationRestorer = () => translationRestorer(() => {
|
|
5586
|
+
return;
|
|
5587
|
+
}, false);
|
|
5588
|
+
var textNodeAt = (parent, index) => {
|
|
5589
|
+
const node = parent.childNodes[index];
|
|
5590
|
+
return node instanceof Text ? node : undefined;
|
|
5591
|
+
};
|
|
5592
|
+
var prepareTextTranslation = (element, index, baseline, path, baselines) => {
|
|
5593
|
+
const original = element.childNodes[index];
|
|
5594
|
+
const wrappedText = translatedFontText(original, baselines);
|
|
5595
|
+
if (wrappedText !== undefined) {
|
|
5596
|
+
original?.replaceWith(document.createTextNode(baseline));
|
|
5597
|
+
return { baseline, index, path, translated: wrappedText };
|
|
5598
|
+
}
|
|
5599
|
+
const node = textNodeAt(element, index);
|
|
5600
|
+
if (node === undefined || node.data === baseline)
|
|
5601
|
+
return;
|
|
5602
|
+
const snapshot = {
|
|
5603
|
+
baseline,
|
|
5604
|
+
index,
|
|
5605
|
+
path,
|
|
5606
|
+
translated: node.data
|
|
5607
|
+
};
|
|
5608
|
+
node.data = baseline;
|
|
5609
|
+
return snapshot;
|
|
5610
|
+
};
|
|
5611
|
+
var visitElements = (root, visit) => {
|
|
5612
|
+
visit(root);
|
|
5613
|
+
for (const element of root.querySelectorAll("*"))
|
|
5614
|
+
visit(element);
|
|
5615
|
+
};
|
|
5616
|
+
var elementPath = (root, element) => {
|
|
5617
|
+
const path = [];
|
|
5618
|
+
let current = element;
|
|
5619
|
+
while (current !== root) {
|
|
5620
|
+
const parent = current.parentElement;
|
|
5621
|
+
if (parent === null)
|
|
5622
|
+
return null;
|
|
5623
|
+
path.unshift([...parent.children].indexOf(current));
|
|
5624
|
+
current = parent;
|
|
5625
|
+
}
|
|
5626
|
+
return path;
|
|
5627
|
+
};
|
|
5628
|
+
var elementAtPath = (root, path) => {
|
|
5629
|
+
let current = root;
|
|
5630
|
+
for (const index of path) {
|
|
5631
|
+
const child = current.children[index];
|
|
5632
|
+
if (!(child instanceof Element))
|
|
5633
|
+
return null;
|
|
5634
|
+
current = child;
|
|
5635
|
+
}
|
|
5636
|
+
return current;
|
|
5637
|
+
};
|
|
5638
|
+
var captureSsrTextBaselines = (root) => {
|
|
5639
|
+
if (root === null || typeof window === "undefined")
|
|
5640
|
+
return;
|
|
5641
|
+
const baselines = window.__ABSOLUTE_SSR_TEXT_BASELINES__ ?? new WeakMap;
|
|
5642
|
+
const attributes = window.__ABSOLUTE_SSR_ATTRIBUTE_BASELINES__ ?? new WeakMap;
|
|
5643
|
+
visitElements(root, (element) => {
|
|
5644
|
+
const text = new Map;
|
|
5645
|
+
for (const [index, node] of [...element.childNodes].entries()) {
|
|
5646
|
+
if (node.nodeType === Node.TEXT_NODE)
|
|
5647
|
+
text.set(index, node.nodeValue ?? "");
|
|
5648
|
+
}
|
|
5649
|
+
if (text.size > 0)
|
|
5650
|
+
baselines.set(element, text);
|
|
5651
|
+
const values = new Map;
|
|
5652
|
+
for (const name of TRANSLATABLE_ATTRIBUTES) {
|
|
5653
|
+
const value = element.getAttribute(name);
|
|
5654
|
+
if (value !== null)
|
|
5655
|
+
values.set(name, value);
|
|
5656
|
+
}
|
|
5657
|
+
if (values.size > 0)
|
|
5658
|
+
attributes.set(element, values);
|
|
5659
|
+
});
|
|
5660
|
+
window.__ABSOLUTE_SSR_TEXT_BASELINES__ = baselines;
|
|
5661
|
+
window.__ABSOLUTE_SSR_ATTRIBUTE_BASELINES__ = attributes;
|
|
5662
|
+
};
|
|
5663
|
+
var prepareBrowserTranslationHydration = (root) => {
|
|
5664
|
+
if (root === null || typeof window === "undefined")
|
|
5665
|
+
return emptyTranslationRestorer();
|
|
5666
|
+
const baselines = window.__ABSOLUTE_SSR_TEXT_BASELINES__;
|
|
5667
|
+
if (baselines === undefined)
|
|
5668
|
+
return emptyTranslationRestorer();
|
|
5669
|
+
const translated = [];
|
|
5670
|
+
const translatedAttributes = [];
|
|
5671
|
+
const attributes = window.__ABSOLUTE_SSR_ATTRIBUTE_BASELINES__;
|
|
5672
|
+
visitElements(root, (element) => {
|
|
5673
|
+
const text = baselines.get(element);
|
|
5674
|
+
const path = elementPath(root, element);
|
|
5675
|
+
if (path === null)
|
|
5676
|
+
return;
|
|
5677
|
+
for (const [index, baseline] of text ?? []) {
|
|
5678
|
+
const snapshot = prepareTextTranslation(element, index, baseline, path, baselines);
|
|
5679
|
+
if (snapshot === undefined)
|
|
5680
|
+
continue;
|
|
5681
|
+
translated.push(snapshot);
|
|
5682
|
+
}
|
|
5683
|
+
for (const [name, baseline] of attributes?.get(element) ?? []) {
|
|
5684
|
+
const value = element.getAttribute(name);
|
|
5685
|
+
if (value === null || value === baseline)
|
|
5686
|
+
continue;
|
|
5687
|
+
translatedAttributes.push({
|
|
5688
|
+
baseline,
|
|
5689
|
+
name,
|
|
5690
|
+
path,
|
|
5691
|
+
translated: value
|
|
5692
|
+
});
|
|
5693
|
+
element.setAttribute(name, baseline);
|
|
5694
|
+
}
|
|
5695
|
+
});
|
|
5696
|
+
return translationRestorer(() => {
|
|
5697
|
+
for (const snapshot of translated) {
|
|
5698
|
+
const parent = elementAtPath(root, snapshot.path);
|
|
5699
|
+
if (parent === null)
|
|
5700
|
+
continue;
|
|
5701
|
+
const node = textNodeAt(parent, snapshot.index);
|
|
5702
|
+
if (node !== undefined && node.data === snapshot.baseline)
|
|
5703
|
+
node.data = snapshot.translated;
|
|
5704
|
+
}
|
|
5705
|
+
for (const snapshot of translatedAttributes) {
|
|
5706
|
+
const element = elementAtPath(root, snapshot.path);
|
|
5707
|
+
if (element?.getAttribute(snapshot.name) === snapshot.baseline)
|
|
5708
|
+
element.setAttribute(snapshot.name, snapshot.translated);
|
|
5709
|
+
}
|
|
5710
|
+
}, translated.length > 0 || translatedAttributes.length > 0);
|
|
5711
|
+
};
|
|
5712
|
+
|
|
5713
|
+
// src/vue/browserTranslation.ts
|
|
5714
|
+
var preserveBrowserTranslation = (strategy) => {
|
|
5715
|
+
const translatedStrategy = (hydrate, forEachElement) => strategy(() => {
|
|
5716
|
+
const restore = [];
|
|
5717
|
+
forEachElement((element) => {
|
|
5718
|
+
restore.push(prepareBrowserTranslationHydration(element));
|
|
5719
|
+
});
|
|
5720
|
+
try {
|
|
5721
|
+
hydrate();
|
|
5722
|
+
} finally {
|
|
5723
|
+
for (const apply of restore)
|
|
5724
|
+
apply();
|
|
5725
|
+
}
|
|
5726
|
+
}, forEachElement);
|
|
5727
|
+
return translatedStrategy;
|
|
5728
|
+
};
|
|
5729
|
+
// src/vue/components/Image.ts
|
|
5730
|
+
import { computed, defineComponent as defineComponent3, h as h3, ref } from "vue";
|
|
5731
|
+
|
|
5732
|
+
// src/utils/imageClient.ts
|
|
5733
|
+
init_constants();
|
|
5734
|
+
var DEFAULT_DEVICE_SIZES = IMAGE_DEFAULT_DEVICE_SIZES;
|
|
5735
|
+
var DEFAULT_IMAGE_SIZES = IMAGE_DEFAULT_IMAGE_SIZES;
|
|
5736
|
+
var DEFAULT_QUALITY = IMAGE_DEFAULT_QUALITY;
|
|
5737
|
+
var OPTIMIZATION_ENDPOINT = "/_absolute/image";
|
|
5738
|
+
var buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;
|
|
5739
|
+
var getAllSizes = (deviceSizes, imageSizes) => {
|
|
5740
|
+
const device = deviceSizes ?? DEFAULT_DEVICE_SIZES;
|
|
5741
|
+
const image = imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
5742
|
+
return [...device, ...image].sort((left, right) => left - right);
|
|
5743
|
+
};
|
|
5744
|
+
var snapToSize = (target, sizes) => {
|
|
5745
|
+
for (const size of sizes) {
|
|
5746
|
+
if (size >= target)
|
|
5747
|
+
return size;
|
|
5748
|
+
}
|
|
5749
|
+
return sizes[sizes.length - 1] ?? target;
|
|
5750
|
+
};
|
|
5751
|
+
var generateBlurSvg = (base64Thumbnail) => {
|
|
5752
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320"><filter id="b" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="20"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1"/></filter><image filter="url(#b)" x="0" y="0" width="100%" height="100%" href="${base64Thumbnail}"/></svg>`;
|
|
5753
|
+
const encoded = encodeURIComponent(svg);
|
|
5754
|
+
return `url("data:image/svg+xml,${encoded}")`;
|
|
5755
|
+
};
|
|
5756
|
+
var generateSrcSet = (src, width, sizes, deviceSizes, imageSizes) => {
|
|
5757
|
+
const quality = DEFAULT_QUALITY;
|
|
5758
|
+
if (sizes) {
|
|
5759
|
+
const allSizes = getAllSizes(deviceSizes, imageSizes);
|
|
5760
|
+
return allSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`).join(", ");
|
|
5761
|
+
}
|
|
5762
|
+
if (width) {
|
|
5763
|
+
const allSizes = getAllSizes(deviceSizes, imageSizes);
|
|
5764
|
+
const w1x = snapToSize(width, allSizes);
|
|
5765
|
+
const w2x = snapToSize(width * 2, allSizes);
|
|
5766
|
+
return `${buildOptimizedUrl(src, w1x, quality)} 1x, ${buildOptimizedUrl(src, w2x, quality)} 2x`;
|
|
5767
|
+
}
|
|
5768
|
+
const devSizes = deviceSizes ?? DEFAULT_DEVICE_SIZES;
|
|
5769
|
+
return devSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`).join(", ");
|
|
5770
|
+
};
|
|
5771
|
+
|
|
5772
|
+
// src/vue/components/Image.ts
|
|
5773
|
+
var fillWrapperStyle = {
|
|
5774
|
+
display: "block",
|
|
5775
|
+
height: "100%",
|
|
5776
|
+
overflow: "hidden",
|
|
5777
|
+
position: "relative",
|
|
5778
|
+
width: "100%"
|
|
5779
|
+
};
|
|
5780
|
+
var Image = defineComponent3({
|
|
5781
|
+
name: "AbsoluteImage",
|
|
5782
|
+
props: {
|
|
5783
|
+
alt: { required: true, type: String },
|
|
5784
|
+
blurDataURL: { default: undefined, type: String },
|
|
5785
|
+
className: { default: undefined, type: String },
|
|
5786
|
+
crossOrigin: { default: undefined, type: String },
|
|
5787
|
+
fetchPriority: { default: undefined, type: String },
|
|
5788
|
+
fill: { default: false, type: Boolean },
|
|
5789
|
+
height: { default: undefined, type: Number },
|
|
5790
|
+
loader: { default: undefined, type: Function },
|
|
5791
|
+
loading: { default: "lazy", type: String },
|
|
5792
|
+
onError: { default: undefined, type: Function },
|
|
5793
|
+
onLoad: { default: undefined, type: Function },
|
|
5794
|
+
overrideSrc: { default: undefined, type: String },
|
|
5795
|
+
placeholder: { default: undefined, type: String },
|
|
5796
|
+
priority: { default: false, type: Boolean },
|
|
5797
|
+
quality: { default: DEFAULT_QUALITY, type: Number },
|
|
5798
|
+
referrerPolicy: { default: undefined, type: String },
|
|
5799
|
+
sizes: { default: undefined, type: String },
|
|
5800
|
+
src: { required: true, type: String },
|
|
5801
|
+
style: { default: undefined, type: Object },
|
|
5802
|
+
unoptimized: { default: false, type: Boolean },
|
|
5803
|
+
width: { default: undefined, type: Number }
|
|
5804
|
+
},
|
|
5805
|
+
setup(props) {
|
|
5806
|
+
const blurRemoved = ref(false);
|
|
5807
|
+
const resolvedSrc = computed(() => {
|
|
5808
|
+
if (props.overrideSrc)
|
|
5809
|
+
return props.overrideSrc;
|
|
5810
|
+
if (props.unoptimized)
|
|
5811
|
+
return props.src;
|
|
5812
|
+
if (props.loader) {
|
|
5813
|
+
return props.loader({
|
|
5814
|
+
quality: props.quality ?? DEFAULT_QUALITY,
|
|
5815
|
+
src: props.src,
|
|
5816
|
+
width: props.width ?? 0
|
|
5817
|
+
});
|
|
5818
|
+
}
|
|
5819
|
+
if (!props.width) {
|
|
5820
|
+
return buildOptimizedUrl(props.src, 0, props.quality ?? DEFAULT_QUALITY);
|
|
5821
|
+
}
|
|
5822
|
+
return buildOptimizedUrl(props.src, props.width, props.quality ?? DEFAULT_QUALITY);
|
|
6120
5823
|
});
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
5824
|
+
const srcSet = computed(() => props.unoptimized ? undefined : generateSrcSet(props.src, props.width, props.sizes));
|
|
5825
|
+
const resolvedSizes = computed(() => props.sizes ?? (props.fill ? "100vw" : undefined));
|
|
5826
|
+
const resolvedLoading = computed(() => props.priority ? "eager" : props.loading ?? "lazy");
|
|
5827
|
+
const resolvedFetchPriority = computed(() => props.priority ? "high" : props.fetchPriority);
|
|
5828
|
+
const hasBlur = computed(() => props.placeholder === "blur" || typeof props.placeholder === "string" && props.placeholder !== "empty" && props.placeholder.startsWith("data:"));
|
|
5829
|
+
const blurBackground = computed(() => {
|
|
5830
|
+
if (!hasBlur.value || blurRemoved.value)
|
|
5831
|
+
return;
|
|
5832
|
+
if (typeof props.placeholder === "string" && props.placeholder !== "blur" && props.placeholder.startsWith("data:")) {
|
|
5833
|
+
return generateBlurSvg(props.placeholder);
|
|
5834
|
+
}
|
|
5835
|
+
if (props.blurDataURL)
|
|
5836
|
+
return generateBlurSvg(props.blurDataURL);
|
|
5837
|
+
return;
|
|
5838
|
+
});
|
|
5839
|
+
const imgStyle = computed(() => {
|
|
5840
|
+
const base = {
|
|
5841
|
+
...props.style ?? {},
|
|
5842
|
+
color: "transparent"
|
|
5843
|
+
};
|
|
5844
|
+
if (blurBackground.value) {
|
|
5845
|
+
base.backgroundImage = blurBackground.value;
|
|
5846
|
+
base.backgroundPosition = "center";
|
|
5847
|
+
base.backgroundRepeat = "no-repeat";
|
|
5848
|
+
base.backgroundSize = "cover";
|
|
5849
|
+
}
|
|
5850
|
+
if (props.fill) {
|
|
5851
|
+
base.height = "100%";
|
|
5852
|
+
base.inset = "0";
|
|
5853
|
+
base.objectFit = "cover";
|
|
5854
|
+
base.position = "absolute";
|
|
5855
|
+
base.width = "100%";
|
|
5856
|
+
}
|
|
5857
|
+
return base;
|
|
5858
|
+
});
|
|
5859
|
+
const handleLoad = (event) => {
|
|
5860
|
+
blurRemoved.value = true;
|
|
5861
|
+
props.onLoad?.(event);
|
|
6127
5862
|
};
|
|
5863
|
+
const handleError = (event) => {
|
|
5864
|
+
props.onError?.(event);
|
|
5865
|
+
};
|
|
5866
|
+
return () => {
|
|
5867
|
+
const imgNode = h3("img", {
|
|
5868
|
+
alt: props.alt,
|
|
5869
|
+
class: props.className,
|
|
5870
|
+
crossorigin: props.crossOrigin,
|
|
5871
|
+
decoding: "async",
|
|
5872
|
+
fetchpriority: resolvedFetchPriority.value,
|
|
5873
|
+
height: props.fill ? undefined : props.height,
|
|
5874
|
+
loading: resolvedLoading.value,
|
|
5875
|
+
onError: handleError,
|
|
5876
|
+
onLoad: handleLoad,
|
|
5877
|
+
referrerpolicy: props.referrerPolicy,
|
|
5878
|
+
sizes: resolvedSizes.value,
|
|
5879
|
+
src: resolvedSrc.value,
|
|
5880
|
+
srcset: srcSet.value,
|
|
5881
|
+
style: imgStyle.value,
|
|
5882
|
+
width: props.fill ? undefined : props.width
|
|
5883
|
+
});
|
|
5884
|
+
return props.fill ? h3("span", { style: fillWrapperStyle }, [imgNode]) : imgNode;
|
|
5885
|
+
};
|
|
5886
|
+
}
|
|
5887
|
+
});
|
|
5888
|
+
// src/vue/components/SuspenseSlot.ts
|
|
5889
|
+
import {
|
|
5890
|
+
cloneVNode,
|
|
5891
|
+
defineComponent as defineComponent4,
|
|
5892
|
+
h as h4,
|
|
5893
|
+
isVNode,
|
|
5894
|
+
onMounted,
|
|
5895
|
+
onBeforeUnmount as onBeforeUnmount2,
|
|
5896
|
+
ref as ref2,
|
|
5897
|
+
useSSRContext
|
|
5898
|
+
} from "vue";
|
|
5899
|
+
var renderVueNodesToHtml = async (nodes) => {
|
|
5900
|
+
const { createSSRApp, h: createVNode } = await import("vue");
|
|
5901
|
+
const { renderToString } = await import("vue/server-renderer");
|
|
5902
|
+
const app = createSSRApp({
|
|
5903
|
+
render: () => createVNode("div", undefined, nodes ?? undefined)
|
|
6128
5904
|
});
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
});
|
|
6132
|
-
return state;
|
|
5905
|
+
const html = await renderToString(app);
|
|
5906
|
+
return html.replace(/^<div>|<\/div>$/g, "");
|
|
6133
5907
|
};
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
5908
|
+
var hasFrameworkSlots = (defaultSlot, fallbackSlot, errorSlot, promise) => defaultSlot !== undefined || fallbackSlot !== undefined || errorSlot !== undefined || promise !== undefined;
|
|
5909
|
+
var allowMismatchOnSlotNodes = (nodes) => {
|
|
5910
|
+
if (Array.isArray(nodes)) {
|
|
5911
|
+
return nodes.map((node) => allowMismatchOnSlotNodes(node));
|
|
5912
|
+
}
|
|
5913
|
+
if (isVNode(nodes)) {
|
|
5914
|
+
return cloneVNode(nodes, {
|
|
5915
|
+
"data-allow-mismatch": ""
|
|
5916
|
+
});
|
|
5917
|
+
}
|
|
5918
|
+
return nodes;
|
|
6143
5919
|
};
|
|
6144
|
-
var
|
|
6145
|
-
|
|
5920
|
+
var resolveSuspenseValue = async (resolve, promise) => {
|
|
5921
|
+
if (resolve !== undefined) {
|
|
5922
|
+
return resolve();
|
|
5923
|
+
}
|
|
5924
|
+
if (promise !== undefined) {
|
|
5925
|
+
return promise;
|
|
5926
|
+
}
|
|
6146
5927
|
return;
|
|
6147
|
-
}, false);
|
|
6148
|
-
var textNodeAt = (parent, index) => {
|
|
6149
|
-
const node = parent.childNodes[index];
|
|
6150
|
-
return node instanceof Text ? node : undefined;
|
|
6151
5928
|
};
|
|
6152
|
-
var
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
original?.replaceWith(document.createTextNode(baseline));
|
|
6157
|
-
return { baseline, index, path, translated: wrappedText };
|
|
5929
|
+
var isObjectRecord5 = (value) => Boolean(value) && typeof value === "object";
|
|
5930
|
+
var isVueSuspensePayload = (payload) => {
|
|
5931
|
+
if (!isObjectRecord5(payload)) {
|
|
5932
|
+
return false;
|
|
6158
5933
|
}
|
|
6159
|
-
|
|
6160
|
-
if (node === undefined || node.data === baseline)
|
|
6161
|
-
return;
|
|
6162
|
-
const snapshot = {
|
|
6163
|
-
baseline,
|
|
6164
|
-
index,
|
|
6165
|
-
path,
|
|
6166
|
-
translated: node.data
|
|
6167
|
-
};
|
|
6168
|
-
node.data = baseline;
|
|
6169
|
-
return snapshot;
|
|
5934
|
+
return payload.kind === "vue-suspense";
|
|
6170
5935
|
};
|
|
6171
|
-
var
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
5936
|
+
var hasEventDetailId = (event, id) => {
|
|
5937
|
+
if (!(event instanceof CustomEvent)) {
|
|
5938
|
+
return false;
|
|
5939
|
+
}
|
|
5940
|
+
const { detail } = event;
|
|
5941
|
+
if (!detail || typeof detail !== "object") {
|
|
5942
|
+
return false;
|
|
5943
|
+
}
|
|
5944
|
+
return detail.id === id;
|
|
6175
5945
|
};
|
|
6176
|
-
var
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
while (current !== root) {
|
|
6180
|
-
const parent = current.parentElement;
|
|
6181
|
-
if (parent === null)
|
|
6182
|
-
return null;
|
|
6183
|
-
path.unshift([...parent.children].indexOf(current));
|
|
6184
|
-
current = parent;
|
|
5946
|
+
var toLegacySuspenseSlotRegistration = (props) => {
|
|
5947
|
+
if (!props.resolve) {
|
|
5948
|
+
return null;
|
|
6185
5949
|
}
|
|
6186
|
-
return
|
|
5950
|
+
return {
|
|
5951
|
+
errorHtml: props.errorHtml,
|
|
5952
|
+
fallbackHtml: props.fallbackHtml,
|
|
5953
|
+
id: props.id,
|
|
5954
|
+
timeoutMs: props.timeoutMs,
|
|
5955
|
+
resolve: async () => {
|
|
5956
|
+
const resolved = await props.resolve?.();
|
|
5957
|
+
return typeof resolved === "string" ? resolved : "";
|
|
5958
|
+
}
|
|
5959
|
+
};
|
|
5960
|
+
};
|
|
5961
|
+
var registerLegacySuspenseSlot = (props) => {
|
|
5962
|
+
registerStreamingSlot({
|
|
5963
|
+
errorHtml: props.errorHtml,
|
|
5964
|
+
fallbackHtml: props.fallbackHtml,
|
|
5965
|
+
id: props.id,
|
|
5966
|
+
resolve: props.resolve,
|
|
5967
|
+
timeoutMs: props.timeoutMs
|
|
5968
|
+
});
|
|
6187
5969
|
};
|
|
6188
|
-
var
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
const
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
5970
|
+
var resolveStreamingSuspenseSlot = async (props, slots) => {
|
|
5971
|
+
try {
|
|
5972
|
+
const value = await resolveSuspenseValue(props.resolve, props.promise);
|
|
5973
|
+
const nodes = allowMismatchOnSlotNodes(slots.default?.({ value }) ?? []);
|
|
5974
|
+
const html = await renderVueNodesToHtml(nodes);
|
|
5975
|
+
return {
|
|
5976
|
+
html,
|
|
5977
|
+
kind: "vue-suspense",
|
|
5978
|
+
value
|
|
5979
|
+
};
|
|
5980
|
+
} catch (error) {
|
|
5981
|
+
const errorNodes = slots.error?.({ error });
|
|
5982
|
+
if (errorNodes !== undefined)
|
|
5983
|
+
return renderVueNodesToHtml(allowMismatchOnSlotNodes(errorNodes));
|
|
5984
|
+
if (typeof props.errorHtml === "string")
|
|
5985
|
+
return props.errorHtml;
|
|
5986
|
+
throw error;
|
|
6195
5987
|
}
|
|
6196
|
-
return current;
|
|
6197
5988
|
};
|
|
6198
|
-
var
|
|
6199
|
-
if (
|
|
5989
|
+
var registerSuspenseSlotForSsr = (props, slots, usesFrameworkSlots) => {
|
|
5990
|
+
if (!isStreamingSlotCollectionActive()) {
|
|
5991
|
+
warnMissingStreamingSlotCollector("SuspenseSlot");
|
|
5992
|
+
}
|
|
5993
|
+
const legacyRegistration = toLegacySuspenseSlotRegistration(props);
|
|
5994
|
+
if (!usesFrameworkSlots && legacyRegistration) {
|
|
5995
|
+
registerLegacySuspenseSlot(legacyRegistration);
|
|
6200
5996
|
return;
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
if (node.nodeType === Node.TEXT_NODE)
|
|
6207
|
-
text.set(index, node.nodeValue ?? "");
|
|
6208
|
-
}
|
|
6209
|
-
if (text.size > 0)
|
|
6210
|
-
baselines.set(element, text);
|
|
6211
|
-
const values = new Map;
|
|
6212
|
-
for (const name of TRANSLATABLE_ATTRIBUTES) {
|
|
6213
|
-
const value = element.getAttribute(name);
|
|
6214
|
-
if (value !== null)
|
|
6215
|
-
values.set(name, value);
|
|
6216
|
-
}
|
|
6217
|
-
if (values.size > 0)
|
|
6218
|
-
attributes.set(element, values);
|
|
5997
|
+
}
|
|
5998
|
+
registerStreamingSlot({
|
|
5999
|
+
id: props.id,
|
|
6000
|
+
timeoutMs: props.timeoutMs,
|
|
6001
|
+
resolve: () => resolveStreamingSuspenseSlot(props, slots)
|
|
6219
6002
|
});
|
|
6220
|
-
window.__ABSOLUTE_SSR_TEXT_BASELINES__ = baselines;
|
|
6221
|
-
window.__ABSOLUTE_SSR_ATTRIBUTE_BASELINES__ = attributes;
|
|
6222
6003
|
};
|
|
6223
|
-
var
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6004
|
+
var applySuspensePayload = (payload, state) => {
|
|
6005
|
+
state.hasError.value = payload.state === "error";
|
|
6006
|
+
state.resolvedValue.value = payload.value;
|
|
6007
|
+
state.isResolved.value = payload.state !== "error";
|
|
6008
|
+
};
|
|
6009
|
+
var SuspenseSlot = defineComponent4({
|
|
6010
|
+
name: "AbsoluteSuspenseSlot",
|
|
6011
|
+
props: {
|
|
6012
|
+
className: { default: undefined, type: String },
|
|
6013
|
+
errorHtml: { default: undefined, type: String },
|
|
6014
|
+
fallbackHtml: { default: "", type: String },
|
|
6015
|
+
id: { required: true, type: String },
|
|
6016
|
+
promise: {
|
|
6017
|
+
default: undefined,
|
|
6018
|
+
type: Object
|
|
6019
|
+
},
|
|
6020
|
+
resolve: {
|
|
6021
|
+
default: undefined,
|
|
6022
|
+
type: Function
|
|
6023
|
+
},
|
|
6024
|
+
timeoutMs: { default: undefined, type: Number }
|
|
6025
|
+
},
|
|
6026
|
+
setup(props, { slots }) {
|
|
6027
|
+
const readPatchedDomState = () => {
|
|
6028
|
+
if (typeof document === "undefined")
|
|
6029
|
+
return false;
|
|
6030
|
+
const slotNode = document.getElementById(props.id);
|
|
6031
|
+
if (!slotNode)
|
|
6032
|
+
return false;
|
|
6033
|
+
return slotNode.getAttribute("data-absolute-slot-state") === "resolved";
|
|
6034
|
+
};
|
|
6035
|
+
const isResolved = ref2(false);
|
|
6036
|
+
const resolvedValue = ref2(undefined);
|
|
6037
|
+
const hasError = ref2(false);
|
|
6038
|
+
const hasPatchedDom = ref2(readPatchedDomState());
|
|
6039
|
+
const usesFrameworkSlots = hasFrameworkSlots(slots.default, slots.fallback, slots.error, props.promise);
|
|
6040
|
+
const isSsrRender = useSSRContext() !== undefined;
|
|
6041
|
+
if (isSsrRender) {
|
|
6042
|
+
registerSuspenseSlotForSsr(props, slots, usesFrameworkSlots);
|
|
6242
6043
|
}
|
|
6243
|
-
|
|
6244
|
-
const
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6044
|
+
if (typeof window !== "undefined" && usesFrameworkSlots) {
|
|
6045
|
+
const consumers = window.__ABS_SLOT_CONSUMERS__ = window.__ABS_SLOT_CONSUMERS__ ?? {};
|
|
6046
|
+
let runtimeReady = false;
|
|
6047
|
+
consumers[props.id] = (payload) => {
|
|
6048
|
+
if (!runtimeReady)
|
|
6049
|
+
return false;
|
|
6050
|
+
if (!isVueSuspensePayload(payload)) {
|
|
6051
|
+
return false;
|
|
6052
|
+
}
|
|
6053
|
+
applySuspensePayload(payload, {
|
|
6054
|
+
hasError,
|
|
6055
|
+
isResolved,
|
|
6056
|
+
resolvedValue
|
|
6057
|
+
});
|
|
6058
|
+
return true;
|
|
6059
|
+
};
|
|
6060
|
+
const handlePatchedDom = (event) => {
|
|
6061
|
+
if (hasEventDetailId(event, props.id)) {
|
|
6062
|
+
hasPatchedDom.value = true;
|
|
6063
|
+
}
|
|
6064
|
+
};
|
|
6065
|
+
onMounted(() => {
|
|
6066
|
+
hasPatchedDom.value = readPatchedDomState();
|
|
6067
|
+
window.addEventListener("absolutejs:slot-patch", handlePatchedDom);
|
|
6068
|
+
runtimeReady = true;
|
|
6069
|
+
window.__ABS_SLOT_FLUSH__?.();
|
|
6070
|
+
});
|
|
6071
|
+
onBeforeUnmount2(() => {
|
|
6072
|
+
window.removeEventListener("absolutejs:slot-patch", handlePatchedDom);
|
|
6073
|
+
delete window.__ABS_SLOT_CONSUMERS__?.[props.id];
|
|
6252
6074
|
});
|
|
6253
|
-
element.setAttribute(name, baseline);
|
|
6254
|
-
}
|
|
6255
|
-
});
|
|
6256
|
-
return translationRestorer(() => {
|
|
6257
|
-
for (const snapshot of translated) {
|
|
6258
|
-
const parent = elementAtPath(root, snapshot.path);
|
|
6259
|
-
if (parent === null)
|
|
6260
|
-
continue;
|
|
6261
|
-
const node = textNodeAt(parent, snapshot.index);
|
|
6262
|
-
if (node !== undefined && node.data === snapshot.baseline)
|
|
6263
|
-
node.data = snapshot.translated;
|
|
6264
6075
|
}
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6076
|
+
const resolveSlotChildren = () => {
|
|
6077
|
+
if (hasPatchedDom.value) {
|
|
6078
|
+
return;
|
|
6079
|
+
}
|
|
6080
|
+
if (hasError.value) {
|
|
6081
|
+
return allowMismatchOnSlotNodes(slots.error?.({ error: undefined }) ?? slots.fallback?.() ?? undefined) ?? undefined;
|
|
6082
|
+
}
|
|
6083
|
+
if (isResolved.value) {
|
|
6084
|
+
return allowMismatchOnSlotNodes(slots.default?.({ value: resolvedValue.value }) ?? undefined) ?? undefined;
|
|
6085
|
+
}
|
|
6086
|
+
return allowMismatchOnSlotNodes(slots.fallback?.() ?? undefined);
|
|
6087
|
+
};
|
|
6088
|
+
return () => {
|
|
6089
|
+
if (!usesFrameworkSlots) {
|
|
6090
|
+
return h4("div", {
|
|
6091
|
+
class: props.className,
|
|
6092
|
+
"data-absolute-slot": "true",
|
|
6093
|
+
id: props.id,
|
|
6094
|
+
innerHTML: props.fallbackHtml
|
|
6095
|
+
});
|
|
6096
|
+
}
|
|
6097
|
+
return h4("div", {
|
|
6098
|
+
class: props.className,
|
|
6099
|
+
"data-absolute-slot": "true",
|
|
6100
|
+
"data-allow-mismatch": "",
|
|
6101
|
+
id: props.id
|
|
6102
|
+
}, resolveSlotChildren() ?? undefined);
|
|
6103
|
+
};
|
|
6104
|
+
}
|
|
6105
|
+
});
|
|
6106
|
+
// src/vue/components/StreamSlot.ts
|
|
6107
|
+
import { defineComponent as defineComponent5, h as h5, useSSRContext as useSSRContext2 } from "vue";
|
|
6108
|
+
var StreamSlot = defineComponent5({
|
|
6109
|
+
name: "AbsoluteStreamSlot",
|
|
6110
|
+
props: {
|
|
6111
|
+
className: { default: undefined, type: String },
|
|
6112
|
+
errorHtml: { default: undefined, type: String },
|
|
6113
|
+
fallbackHtml: { default: "", type: String },
|
|
6114
|
+
id: { required: true, type: String },
|
|
6115
|
+
resolve: {
|
|
6116
|
+
required: true,
|
|
6117
|
+
type: Function
|
|
6118
|
+
},
|
|
6119
|
+
timeoutMs: { default: undefined, type: Number }
|
|
6120
|
+
},
|
|
6121
|
+
setup(props) {
|
|
6122
|
+
if (useSSRContext2() !== undefined) {
|
|
6123
|
+
registerStreamSlotForSsr(props);
|
|
6269
6124
|
}
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
const translatedStrategy = (hydrate, forEachElement) => strategy(() => {
|
|
6276
|
-
const restore = [];
|
|
6277
|
-
forEachElement((element) => {
|
|
6278
|
-
restore.push(prepareBrowserTranslationHydration(element));
|
|
6125
|
+
return () => h5("div", {
|
|
6126
|
+
class: props.className,
|
|
6127
|
+
"data-absolute-slot": "true",
|
|
6128
|
+
id: props.id,
|
|
6129
|
+
innerHTML: props.fallbackHtml
|
|
6279
6130
|
});
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
}
|
|
6287
|
-
|
|
6131
|
+
}
|
|
6132
|
+
});
|
|
6133
|
+
var registerStreamSlotForSsr = (props) => {
|
|
6134
|
+
if (!isStreamingSlotCollectionActive()) {
|
|
6135
|
+
warnMissingStreamingSlotCollector("StreamSlot");
|
|
6136
|
+
return;
|
|
6137
|
+
}
|
|
6138
|
+
registerStreamingSlot({
|
|
6139
|
+
errorHtml: props.errorHtml,
|
|
6140
|
+
fallbackHtml: props.fallbackHtml,
|
|
6141
|
+
id: props.id,
|
|
6142
|
+
resolve: props.resolve,
|
|
6143
|
+
timeoutMs: props.timeoutMs
|
|
6144
|
+
});
|
|
6288
6145
|
};
|
|
6289
6146
|
// src/vue/useResource.ts
|
|
6290
6147
|
import {
|
|
@@ -6470,8 +6327,8 @@ var enqueue = (task) => {
|
|
|
6470
6327
|
let release = () => {
|
|
6471
6328
|
return;
|
|
6472
6329
|
};
|
|
6473
|
-
const gate = new Promise((
|
|
6474
|
-
release =
|
|
6330
|
+
const gate = new Promise((resolve) => {
|
|
6331
|
+
release = resolve;
|
|
6475
6332
|
});
|
|
6476
6333
|
const queued = {
|
|
6477
6334
|
cancelled: false,
|
|
@@ -6855,5 +6712,5 @@ export {
|
|
|
6855
6712
|
useResource
|
|
6856
6713
|
};
|
|
6857
6714
|
|
|
6858
|
-
//# debugId=
|
|
6715
|
+
//# debugId=E472C93501A48F4B64756E2164756E21
|
|
6859
6716
|
//# sourceMappingURL=index.js.map
|