@absolutejs/absolute 0.20.0-beta.180 → 0.20.0-beta.182
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 +41 -0
- package/changelog.json +70 -0
- package/dist/angular/browser.js +2 -2
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/components/constants.js +4 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +349 -48
- package/dist/angular/index.js.map +11 -11
- package/dist/angular/server.js +349 -48
- package/dist/angular/server.js.map +11 -11
- package/dist/build.js +605 -114
- package/dist/build.js.map +20 -20
- package/dist/cli/{add-8gw9mk2b.js → add-jft96bp4.js} +9 -9
- package/dist/cli/{analyze-e57zz9x8.js → analyze-5w46d1f0.js} +3 -3
- package/dist/cli/{androidEmulatorController-vqc5m2rp.js → androidEmulatorController-gbf9r660.js} +6 -6
- package/dist/cli/{androidNativeWatcher-s03aczxv.js → androidNativeWatcher-3astrxxz.js} +6 -6
- package/dist/cli/{api-8ppxw487.js → api-zmvnvdsf.js} +8 -8
- package/dist/cli/{build-fz7qbdn3.js → build-mskrk9zb.js} +3 -3
- package/dist/cli/{build-fntmf42w.js → build-p3qra1nj.js} +65 -7
- package/dist/cli/{buildDepVendor-qnwfct22.js → buildDepVendor-36d1aa7c.js} +2 -2
- package/dist/cli/{buildReactServerComponents-fq6mw10d.js → buildReactServerComponents-vc9hh2rd.js} +5 -5
- package/dist/cli/{compile-54rb8szn.js → compile-7mjd739p.js} +10 -6
- package/dist/cli/config/server.js +18 -17
- package/dist/cli/{db-qbzjw3en.js → db-mpmj37jq.js} +2 -2
- package/dist/cli/{dev-6s6g5tnk.js → dev-9d6d7757.js} +14 -14
- package/dist/cli/{doctor-m36tmx4d.js → doctor-nng9szw6.js} +3 -3
- package/dist/cli/{emulatorDoctor-s1z5tkp7.js → emulatorDoctor-3eszsqs8.js} +5 -5
- package/dist/cli/{emulatorInstaller-pgkdswvq.js → emulatorInstaller-1r6cawm0.js} +6 -6
- package/dist/cli/{env-5nz1qm8e.js → env-bfa7vs35.js} +3 -3
- package/dist/cli/{expoDevController-018anvbm.js → expoDevController-s0msdwbm.js} +6 -6
- package/dist/cli/{generate-5vyz1s44.js → generate-xk3a7qnc.js} +8 -8
- package/dist/cli/{heapDiff-kncvdtn8.js → heapDiff-3ba8p8wf.js} +3 -3
- package/dist/cli/{htmx-26hs6jdm.js → htmx-an2x3gpx.js} +6 -6
- package/dist/cli/{index-7854xf0m.js → index-1bszxtdj.js} +1 -1
- package/dist/cli/{index-kx2d067c.js → index-3066eqr3.js} +8 -5
- package/dist/cli/{index-8khbn8qr.js → index-3a9h87v5.js} +3 -3
- package/dist/cli/{index-9djrap79.js → index-3pz5sjaz.js} +1 -1
- package/dist/cli/{index-50ag35xg.js → index-3ys9tz53.js} +2 -2
- package/dist/cli/{index-6f448d7m.js → index-4ynx0cq6.js} +26 -12
- package/dist/cli/{index-btp4fyf1.js → index-785hpa2r.js} +2 -2
- package/dist/cli/{index-w79snsxv.js → index-7zwzyymv.js} +2 -2
- package/dist/cli/{index-kes8he5s.js → index-9sqqzeq4.js} +1 -1
- package/dist/cli/{index-pr1skxen.js → index-akseq9ps.js} +1 -1
- package/dist/cli/{index-23hvdyxf.js → index-c6j2727a.js} +1 -1
- package/dist/cli/{index-pkw3jktb.js → index-eh786rj4.js} +2 -2
- package/dist/cli/{index-aemhvvwb.js → index-eydgkr7w.js} +1 -1
- package/dist/cli/{index-rz56x932.js → index-fbmfpqk8.js} +1 -1
- package/dist/cli/{index-xf9sfr8a.js → index-fgqh48qr.js} +63 -1
- package/dist/cli/{index-c8rcfe5a.js → index-fy4th3n0.js} +1 -1
- package/dist/cli/{index-prza6tkp.js → index-gx6pjzzk.js} +3 -3
- package/dist/cli/{index-125cfzvn.js → index-hker5fs4.js} +2 -2
- package/dist/cli/{index-cgmp9d02.js → index-hqkcxa2p.js} +1 -1
- package/dist/cli/{index-x1vvn549.js → index-mmm6d3k5.js} +3 -3
- package/dist/cli/{index-enbw9484.js → index-wpgsermq.js} +1 -1
- package/dist/cli/{index-0z5fgb80.js → index-wqpg377f.js} +1 -1
- package/dist/cli/{index-3sfcmb49.js → index-x7h6w6td.js} +1 -1
- package/dist/cli/{index-a6xx0p9e.js → index-ydaxsftq.js} +1 -1
- package/dist/cli/{index-3ewt17wm.js → index-yhkg5by0.js} +1 -1
- package/dist/cli/{index-aqe25w4h.js → index-zeeep92g.js} +1 -1
- package/dist/cli/index.js +32 -32
- package/dist/cli/{info-k124sh7g.js → info-5rwsbhe2.js} +4 -4
- package/dist/cli/{inspect-n6pcfvfw.js → inspect-nmwb0q5k.js} +5 -5
- package/dist/cli/{iosNativeWatcher-wdq2fvj1.js → iosNativeWatcher-7r9gnk87.js} +7 -7
- package/dist/cli/{iosSimulatorController-n97dpa8p.js → iosSimulatorController-w963vv9r.js} +7 -7
- package/dist/cli/{islands-17tfx8jf.js → islands-w9xrehpk.js} +3 -3
- package/dist/cli/{logs-shg23fbt.js → logs-m793x8a7.js} +3 -3
- package/dist/cli/{ls-0wr74w0b.js → ls-k31npd5b.js} +3 -3
- package/dist/cli/{mem-16sy1707.js → mem-jm6kw6gr.js} +5 -5
- package/dist/cli/{migrate-k91k050s.js → migrate-95bjkqkr.js} +2 -2
- package/dist/cli/{mobile-hpqpy61f.js → mobile-cpp8vfn7.js} +13 -13
- package/dist/cli/prerender-26pzynh4.js +13 -0
- package/dist/cli/{prettier-dh5fh786.js → prettier-0ws9pbc1.js} +1 -1
- package/dist/cli/{ps-pk7ncjac.js → ps-fx8mz3e3.js} +6 -6
- package/dist/cli/{psTui-50wf0b72.js → psTui-0e9c7an6.js} +7 -7
- package/dist/cli/{remoteMacProtocol-g10s408w.js → remoteMacProtocol-y7h79gr8.js} +7 -7
- package/dist/cli/{remove-x987pvd3.js → remove-xhvph8bz.js} +8 -8
- package/dist/cli/{routes-mc3ymp8t.js → routes-hq9yje5z.js} +3 -3
- package/dist/cli/{start-mbn2zgs2.js → start-5mjh9hh2.js} +5 -5
- package/dist/cli/{staticAnalyzeSpaRoutes-2nev05m1.js → staticAnalyzeSpaRoutes-rcc1d3az.js} +3 -1
- package/dist/cli/{typecheck-488txsfc.js → typecheck-yjme4fv1.js} +71 -35
- package/dist/cli/{workspace-7sbyyc59.js → workspace-xeb6abxj.js} +5 -5
- package/dist/index.js +620 -126
- package/dist/index.js.map +22 -22
- package/dist/islands/index.js +312 -23
- package/dist/islands/index.js.map +5 -5
- package/dist/mobile/index.js +2 -2
- package/dist/mobile/index.js.map +3 -3
- package/dist/react/browser.js +18 -1
- package/dist/react/browser.js.map +6 -4
- package/dist/react/components/index.js +2 -2
- package/dist/react/components/index.js.map +3 -3
- package/dist/react/index.js +366 -61
- package/dist/react/index.js.map +14 -13
- package/dist/react/server.js +47 -35
- package/dist/react/server.js.map +10 -10
- package/dist/src/angular/components/constants.d.ts +1 -0
- package/dist/src/angular/components/defer-slot-payload.d.ts +5 -0
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +9 -0
- package/dist/src/cli/scripts/manifestKeysEditorHint.d.ts +9 -0
- package/dist/src/cli/scripts/typecheck.d.ts +7 -0
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/core/prerender.d.ts +10 -0
- package/dist/src/dev/spaRouteRefresh.d.ts +12 -5
- package/dist/src/react/browser.d.ts +1 -0
- package/dist/src/react/index.d.ts +1 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +23 -0
- package/dist/src/utils/pageCspNonce.d.ts +14 -0
- package/dist/src/utils/spaRouteManifest.d.ts +2 -0
- package/dist/svelte/components/Image.svelte +1 -1
- package/dist/svelte/components/Island.svelte +1 -1
- package/dist/svelte/index.js +368 -68
- package/dist/svelte/index.js.map +11 -11
- package/dist/svelte/router/Router.svelte.d.ts +31 -1
- package/dist/svelte/server.js +359 -59
- package/dist/svelte/server.js.map +11 -11
- package/dist/types/manifest.d.ts +3 -2
- package/dist/types/svelte.d.ts +3 -0
- package/dist/vue/components/Image.js +2 -2
- package/dist/vue/components/Image.js.map +3 -3
- package/dist/vue/components/index.js +2 -2
- package/dist/vue/components/index.js.map +3 -3
- package/dist/vue/index.js +360 -60
- package/dist/vue/index.js.map +11 -11
- package/dist/vue/server.js +50 -39
- package/dist/vue/server.js.map +9 -9
- package/package.json +4 -1
- package/dist/cli/prerender-w65xp6h8.js +0 -11
- /package/dist/cli/{index-t8jmj8w1.js → index-fm9x6sjs.js} +0 -0
package/dist/build.js
CHANGED
|
@@ -73,7 +73,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
73
73
|
var __require = import.meta.require;
|
|
74
74
|
|
|
75
75
|
// src/constants.ts
|
|
76
|
-
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_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, 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, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, 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;
|
|
76
|
+
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_RELOAD_BACKOFF_BASE_MS = 1000, CSS_RELOAD_BACKOFF_MAX_MS = 60000, 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, HTML_CONTENT_TYPE = "text/html; charset=utf-8", HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HTTP_STATUS_GONE = 410, HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, 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;
|
|
77
77
|
var init_constants = __esm(() => {
|
|
78
78
|
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
79
79
|
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
@@ -4002,9 +4002,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
4002
4002
|
tail: ""
|
|
4003
4003
|
};
|
|
4004
4004
|
};
|
|
4005
|
-
const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
|
|
4005
|
+
const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
|
|
4006
4006
|
if (winner.kind !== "base") {
|
|
4007
|
-
return { baseDone
|
|
4007
|
+
return { baseDone, baseRead, footer, handled: false, tail };
|
|
4008
4008
|
}
|
|
4009
4009
|
if (winner.done) {
|
|
4010
4010
|
return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
|
|
@@ -4047,7 +4047,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
4047
4047
|
return footer;
|
|
4048
4048
|
}
|
|
4049
4049
|
const winner = await Promise.race(racers);
|
|
4050
|
-
const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
|
|
4050
|
+
const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
|
|
4051
4051
|
handleResolvedSlot(controller, slotWinner);
|
|
4052
4052
|
});
|
|
4053
4053
|
({ baseDone, baseRead, footer, tail } = baseWinnerState);
|
|
@@ -5543,23 +5543,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
5543
5543
|
index = markup.indexOf("{", end);
|
|
5544
5544
|
}
|
|
5545
5545
|
return tags;
|
|
5546
|
-
}, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"),
|
|
5547
|
-
|
|
5548
|
-
const
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5546
|
+
}, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"), HTML_HELPERS = "__absoluteAwaitHtml", AWAIT_SCOPE_CLASS_PLACEHOLDER = "__absoluteAwaitScopeClass__", AWAIT_HTML_HELPERS_SOURCE, applyAwaitScopeClass = (code, scopeClass) => code.replaceAll(AWAIT_SCOPE_CLASS_PLACEHOLDER, scopeClass), createAwaitScopeClassCapture = () => {
|
|
5547
|
+
let scopeClass = "";
|
|
5548
|
+
const cssHash = ({ css, filename, hash }) => {
|
|
5549
|
+
scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
|
|
5550
|
+
return scopeClass;
|
|
5551
|
+
};
|
|
5552
|
+
const apply = (code) => applyAwaitScopeClass(code, scopeClass);
|
|
5553
|
+
return { apply, cssHash };
|
|
5554
|
+
}, BOOLEAN_ATTRIBUTES, DIRECTIVE_ATTRIBUTE_RE, ATTRIBUTE_NAME_END_RE, RAW_TEXT_ELEMENTS, helperCall = (name, ...args) => `\${${HTML_HELPERS}.${name}(${args.join(", ")})}`, SHADOW_VALUE, END_TAG_RE, isShadowAttribute = (name) => !DIRECTIVE_ATTRIBUTE_RE.test(name) && !/^on/i.test(name), pushText = (scan, text) => {
|
|
5555
|
+
scan.literal += escapeTemplateLiteral(text);
|
|
5556
|
+
}, readExpressionTag = (scan) => {
|
|
5557
|
+
const end = findTagEnd(scan.source, scan.index);
|
|
5558
|
+
if (end === -1) {
|
|
5559
|
+
fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
|
|
5560
|
+
}
|
|
5561
|
+
const inner = scan.source.slice(scan.index + 1, end - 1).trim();
|
|
5562
|
+
scan.index = end;
|
|
5563
|
+
return inner;
|
|
5564
|
+
}, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
|
|
5565
|
+
const char = scan.source[scan.index] ?? "";
|
|
5566
|
+
if (quote)
|
|
5567
|
+
return char === quote;
|
|
5568
|
+
return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
|
|
5569
|
+
}, readValueText = (scan, quote) => {
|
|
5570
|
+
const start = scan.index;
|
|
5571
|
+
while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
|
|
5572
|
+
scan.index += 1;
|
|
5573
|
+
}
|
|
5574
|
+
return scan.source.slice(start, scan.index);
|
|
5575
|
+
}, readAttributeValue = (scan) => {
|
|
5576
|
+
const { source } = scan;
|
|
5577
|
+
const quote = source[scan.index];
|
|
5578
|
+
const chunks = [];
|
|
5579
|
+
const isQuoted = quote === '"' || quote === "'";
|
|
5580
|
+
if (isQuoted)
|
|
5581
|
+
scan.index += 1;
|
|
5582
|
+
if (!isQuoted && source[scan.index] === "{") {
|
|
5583
|
+
chunks.push({ code: readExpressionTag(scan) });
|
|
5584
|
+
return chunks;
|
|
5585
|
+
}
|
|
5586
|
+
const valueQuote = isQuoted ? quote : undefined;
|
|
5587
|
+
while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
|
|
5588
|
+
chunks.push({ text: readValueText(scan, valueQuote) });
|
|
5589
|
+
if (source[scan.index] === "{")
|
|
5590
|
+
chunks.push({ code: readExpressionTag(scan) });
|
|
5591
|
+
}
|
|
5592
|
+
if (isQuoted)
|
|
5593
|
+
scan.index += 1;
|
|
5594
|
+
return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
|
|
5595
|
+
}, pushDynamicAttribute = (scan, name, chunks) => {
|
|
5596
|
+
if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
|
|
5597
|
+
failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
|
|
5598
|
+
}
|
|
5599
|
+
const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
|
|
5600
|
+
if (tag && "code" in tag) {
|
|
5601
|
+
failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
|
|
5602
|
+
}
|
|
5603
|
+
if (isShadowAttribute(name))
|
|
5604
|
+
scan.shadow += ` ${name}=${SHADOW_VALUE}`;
|
|
5605
|
+
const isClass = name === "class";
|
|
5606
|
+
if (isClass)
|
|
5607
|
+
scan.hasClass = true;
|
|
5608
|
+
const [only] = chunks;
|
|
5609
|
+
const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
|
|
5610
|
+
if (isClass && chunks.length > 1 && codes.length === chunks.length) {
|
|
5611
|
+
scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
|
|
5612
|
+
return;
|
|
5613
|
+
}
|
|
5614
|
+
if (chunks.length === 1 && only && "code" in only) {
|
|
5615
|
+
const value = `(${only.code})`;
|
|
5616
|
+
if (name === "class")
|
|
5617
|
+
scan.literal += helperCall("class", value);
|
|
5618
|
+
else if (name === "style")
|
|
5619
|
+
scan.literal += helperCall("style", value);
|
|
5620
|
+
else
|
|
5621
|
+
scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
|
|
5622
|
+
return;
|
|
5623
|
+
}
|
|
5624
|
+
pushText(scan, ` ${name}="`);
|
|
5625
|
+
for (const chunk of chunks) {
|
|
5626
|
+
if ("code" in chunk)
|
|
5627
|
+
scan.literal += helperCall("part", `(${chunk.code})`);
|
|
5628
|
+
else
|
|
5629
|
+
pushText(scan, chunk.text.replaceAll('"', """));
|
|
5630
|
+
}
|
|
5631
|
+
if (isClass)
|
|
5632
|
+
scan.literal += helperCall("scoped");
|
|
5633
|
+
pushText(scan, '"');
|
|
5634
|
+
}, pushStaticAttribute = (scan, whitespace, name, value) => {
|
|
5635
|
+
if (isShadowAttribute(name))
|
|
5636
|
+
scan.shadow += `${whitespace}${name}=${value}`;
|
|
5637
|
+
if (name !== "class") {
|
|
5638
|
+
pushText(scan, `${whitespace}${name}=${value}`);
|
|
5639
|
+
return;
|
|
5640
|
+
}
|
|
5641
|
+
scan.hasClass = true;
|
|
5642
|
+
const [first = ""] = value;
|
|
5643
|
+
const isQuoted = first === '"' || first === "'";
|
|
5644
|
+
const quote = isQuoted ? first : '"';
|
|
5645
|
+
const classes = isQuoted ? value.slice(1, -1) : value;
|
|
5646
|
+
if (classes === "") {
|
|
5647
|
+
scan.literal += helperCall("class", "''");
|
|
5648
|
+
return;
|
|
5649
|
+
}
|
|
5650
|
+
pushText(scan, `${whitespace}${name}=${quote}${classes}`);
|
|
5651
|
+
scan.literal += helperCall("scoped");
|
|
5652
|
+
pushText(scan, quote);
|
|
5653
|
+
}, readAttributeName = (scan) => {
|
|
5654
|
+
const { source } = scan;
|
|
5655
|
+
const start = scan.index;
|
|
5656
|
+
while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
|
|
5657
|
+
scan.index += 1;
|
|
5658
|
+
}
|
|
5659
|
+
return source.slice(start, scan.index);
|
|
5660
|
+
}, skipWhitespace = (scan) => {
|
|
5661
|
+
const start = scan.index;
|
|
5662
|
+
while (/\s/.test(scan.source[scan.index] ?? ""))
|
|
5663
|
+
scan.index += 1;
|
|
5664
|
+
return scan.source.slice(start, scan.index);
|
|
5665
|
+
}, pushTagExpression = (scan) => {
|
|
5666
|
+
const inner = readExpressionTag(scan);
|
|
5667
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
|
|
5668
|
+
failAttribute(scan, `{${inner}} in a start tag`);
|
|
5669
|
+
}
|
|
5670
|
+
pushDynamicAttribute(scan, inner, [{ code: inner }]);
|
|
5671
|
+
}, pushAttribute = (scan) => {
|
|
5672
|
+
const { source } = scan;
|
|
5673
|
+
const whitespace = skipWhitespace(scan);
|
|
5674
|
+
const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
|
|
5675
|
+
const isEnd = scan.index >= source.length;
|
|
5676
|
+
if (isEnd || source.startsWith(closing, scan.index)) {
|
|
5677
|
+
if (!scan.hasClass)
|
|
5678
|
+
scan.literal += helperCall("scope");
|
|
5679
|
+
const tagEnd = isEnd ? "" : closing;
|
|
5680
|
+
pushText(scan, whitespace + tagEnd);
|
|
5681
|
+
scan.shadow += whitespace + (isEnd ? ">" : closing);
|
|
5682
|
+
scan.index += tagEnd.length;
|
|
5683
|
+
return false;
|
|
5684
|
+
}
|
|
5685
|
+
if (source[scan.index] === "{") {
|
|
5686
|
+
pushTagExpression(scan);
|
|
5687
|
+
return true;
|
|
5555
5688
|
}
|
|
5556
|
-
|
|
5557
|
-
|
|
5689
|
+
const name = readAttributeName(scan);
|
|
5690
|
+
if (!name) {
|
|
5691
|
+
pushText(scan, whitespace + (source[scan.index] ?? ""));
|
|
5692
|
+
scan.index += 1;
|
|
5693
|
+
return true;
|
|
5694
|
+
}
|
|
5695
|
+
const beforeEquals = scan.index;
|
|
5696
|
+
skipWhitespace(scan);
|
|
5697
|
+
if (source[scan.index] !== "=") {
|
|
5698
|
+
scan.index = beforeEquals;
|
|
5699
|
+
pushText(scan, whitespace + name);
|
|
5700
|
+
if (isShadowAttribute(name))
|
|
5701
|
+
scan.shadow += whitespace + name;
|
|
5702
|
+
return true;
|
|
5703
|
+
}
|
|
5704
|
+
scan.index += 1;
|
|
5705
|
+
skipWhitespace(scan);
|
|
5706
|
+
const valueStart = scan.index;
|
|
5707
|
+
const chunks = readAttributeValue(scan);
|
|
5708
|
+
if (chunks.some((chunk) => ("code" in chunk))) {
|
|
5709
|
+
pushDynamicAttribute(scan, name, chunks);
|
|
5710
|
+
return true;
|
|
5711
|
+
}
|
|
5712
|
+
pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
|
|
5713
|
+
return true;
|
|
5714
|
+
}, pushStartTag = (scan) => {
|
|
5715
|
+
const { source } = scan;
|
|
5716
|
+
const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
|
|
5717
|
+
const tagName = nameMatch?.[0] ?? "";
|
|
5718
|
+
pushText(scan, `<${tagName}`);
|
|
5719
|
+
scan.shadow += `<${tagName}`;
|
|
5720
|
+
scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
|
|
5721
|
+
scan.index += 1 + tagName.length;
|
|
5722
|
+
while (pushAttribute(scan))
|
|
5723
|
+
;
|
|
5724
|
+
return tagName.toLowerCase();
|
|
5725
|
+
}, pushRawText = (scan, tagName, shadowStart) => {
|
|
5726
|
+
const { source } = scan;
|
|
5727
|
+
const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
|
|
5728
|
+
const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
|
|
5729
|
+
const end = closeEnd === -1 ? source.length : closeEnd + 1;
|
|
5730
|
+
pushText(scan, source.slice(scan.index, end));
|
|
5731
|
+
scan.shadow = scan.shadow.slice(0, shadowStart);
|
|
5732
|
+
scan.index = end;
|
|
5733
|
+
}, pushTextExpression = (scan) => {
|
|
5734
|
+
const inner = readExpressionTag(scan);
|
|
5735
|
+
const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
|
|
5736
|
+
if (rawHtml) {
|
|
5737
|
+
scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
|
|
5738
|
+
return;
|
|
5739
|
+
}
|
|
5740
|
+
scan.literal += helperCall("text", `(${inner})`);
|
|
5741
|
+
}, pushComment = (scan) => {
|
|
5742
|
+
const close = scan.source.indexOf("-->", scan.index + "<!--".length);
|
|
5743
|
+
const end = close === -1 ? scan.source.length : close + "-->".length;
|
|
5744
|
+
pushText(scan, scan.source.slice(scan.index, end));
|
|
5745
|
+
scan.index = end;
|
|
5746
|
+
}, scanTextPosition = (scan) => {
|
|
5747
|
+
const { index, source } = scan;
|
|
5748
|
+
if (source.startsWith("<!--", index)) {
|
|
5749
|
+
pushComment(scan);
|
|
5750
|
+
return;
|
|
5751
|
+
}
|
|
5752
|
+
if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
|
|
5753
|
+
const shadowStart = scan.shadow.length;
|
|
5754
|
+
const tagName = pushStartTag(scan);
|
|
5755
|
+
if (RAW_TEXT_ELEMENTS.has(tagName))
|
|
5756
|
+
pushRawText(scan, tagName, shadowStart);
|
|
5757
|
+
return;
|
|
5758
|
+
}
|
|
5759
|
+
if (source[index] === "{") {
|
|
5760
|
+
pushTextExpression(scan);
|
|
5761
|
+
return;
|
|
5762
|
+
}
|
|
5763
|
+
const next = source.slice(index + 1).search(/[<{]/);
|
|
5764
|
+
const end = next === -1 ? source.length : index + 1 + next;
|
|
5765
|
+
const text = source.slice(index, end);
|
|
5766
|
+
pushText(scan, text);
|
|
5767
|
+
scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
|
|
5768
|
+
scan.index = end;
|
|
5769
|
+
}, lowerBranch = (markup, branch, filePath) => {
|
|
5770
|
+
const scan = {
|
|
5771
|
+
branch,
|
|
5772
|
+
filePath,
|
|
5773
|
+
hasClass: false,
|
|
5774
|
+
index: 0,
|
|
5775
|
+
literal: "",
|
|
5776
|
+
shadow: "",
|
|
5777
|
+
source: markup.trim()
|
|
5778
|
+
};
|
|
5779
|
+
while (scan.index < scan.source.length)
|
|
5780
|
+
scanTextPosition(scan);
|
|
5781
|
+
return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
|
|
5558
5782
|
}, fail = (filePath, message) => {
|
|
5559
5783
|
throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
|
|
5560
5784
|
}, assertPlainHtml = (markup, branch, filePath) => {
|
|
5561
5785
|
const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
|
|
5562
|
-
const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[
|
|
5786
|
+
const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
|
|
5563
5787
|
if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
|
|
5564
5788
|
fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
|
|
5565
5789
|
}
|
|
@@ -5603,12 +5827,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
5603
5827
|
thenIdentifier: thenMatch?.[2],
|
|
5604
5828
|
thenMarkup
|
|
5605
5829
|
};
|
|
5606
|
-
}, renderSlot = (block, slotId, dynamic) => {
|
|
5830
|
+
}, renderSlot = (block, slotId, dynamic, filePath) => {
|
|
5607
5831
|
const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
|
|
5608
5832
|
const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
|
|
5609
|
-
const
|
|
5610
|
-
|
|
5611
|
-
|
|
5833
|
+
const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
|
|
5834
|
+
const then = lowerBranch(block.thenMarkup, "then", filePath);
|
|
5835
|
+
const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
|
|
5836
|
+
const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
|
|
5837
|
+
const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
|
|
5838
|
+
return `<AbsoluteAwaitSlot id="${slotId}"${dynamic ? " dynamic" : ""} fallbackHtml={${pending.literal}} resolve={async () => { try { const ${thenValueIdentifier} = await (${block.expression}); return ${then.literal}; } ${catchBranch} }} />{#if ${HTML_HELPERS}.shadow}${shadows}{/if}`;
|
|
5839
|
+
}, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
|
|
5612
5840
|
if (!source.includes("absolute:stream")) {
|
|
5613
5841
|
return { code: source, transformed: false };
|
|
5614
5842
|
}
|
|
@@ -5623,7 +5851,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
5623
5851
|
const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
|
|
5624
5852
|
awaitIndex += 1;
|
|
5625
5853
|
lowered += source.slice(cursor, directive.index);
|
|
5626
|
-
lowered += renderSlot(block, slotId, directive[1] !== undefined);
|
|
5854
|
+
lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
|
|
5627
5855
|
cursor = block.end;
|
|
5628
5856
|
}
|
|
5629
5857
|
if (awaitIndex === 0) {
|
|
@@ -5633,14 +5861,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
5633
5861
|
if (lowered.includes("<script")) {
|
|
5634
5862
|
return {
|
|
5635
5863
|
code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
|
|
5636
|
-
${
|
|
5864
|
+
${INJECTED_SCRIPT}
|
|
5637
5865
|
`),
|
|
5638
5866
|
transformed: true
|
|
5639
5867
|
};
|
|
5640
5868
|
}
|
|
5641
5869
|
return {
|
|
5642
5870
|
code: `<script lang="ts">
|
|
5643
|
-
${
|
|
5871
|
+
${INJECTED_SCRIPT}
|
|
5644
5872
|
</script>
|
|
5645
5873
|
${lowered}`,
|
|
5646
5874
|
transformed: true
|
|
@@ -5652,6 +5880,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
5652
5880
|
BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
|
|
5653
5881
|
SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
|
|
5654
5882
|
QUOTES = new Set(['"', "'", "`"]);
|
|
5883
|
+
AWAIT_HTML_HELPERS_SOURCE = [
|
|
5884
|
+
`const ${HTML_HELPERS} = (() => {`,
|
|
5885
|
+
` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
|
|
5886
|
+
` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&' : char === '"' ? '"' : '<');`,
|
|
5887
|
+
"\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
|
|
5888
|
+
"\tconst classNames = (value) => { if (Array.isArray(value)) return value.filter(Boolean).map(classNames).filter(Boolean).join(' '); if (value && typeof value === 'object') return Object.keys(value).filter((key) => value[key]).join(' '); return typeof value === 'string' || typeof value === 'number' ? String(value) : ''; };",
|
|
5889
|
+
"\treturn {",
|
|
5890
|
+
` attr: (name, value, isBoolean) => { const boolean = isBoolean || (name === 'hidden' && value !== 'until-found'); if (value == null || (!value && boolean)) return ''; const normalized = name === 'translate' && typeof value === 'boolean' ? (value ? 'yes' : 'no') : value; return boolean ? ' ' + name + '=""' : ' ' + name + '="' + escape(normalized, true) + '"'; },`,
|
|
5891
|
+
` class: (value) => { const resolved = typeof value === 'object' ? classNames(value) : value ?? ''; let name = '' + resolved; if (scope) name = name ? name + ' ' + scope : scope; return name ? ' class="' + escape(name, true) + '"' : ''; },`,
|
|
5892
|
+
"\t\thtml: (value) => String(value ?? ''),",
|
|
5893
|
+
"\t\tjoin: (...values) => values.map(stringify).join(''),",
|
|
5894
|
+
"\t\tpart: (value) => escape(stringify(value), true),",
|
|
5895
|
+
` scope: () => scope ? ' class="' + scope + '"' : '',`,
|
|
5896
|
+
"\t\tscoped: () => scope ? ' ' + scope : '',",
|
|
5897
|
+
"\t\tshadow: false,",
|
|
5898
|
+
` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
|
|
5899
|
+
"\t\ttext: (value) => escape(value, false)",
|
|
5900
|
+
"\t};",
|
|
5901
|
+
"})();"
|
|
5902
|
+
].join(`
|
|
5903
|
+
`);
|
|
5904
|
+
BOOLEAN_ATTRIBUTES = new Set([
|
|
5905
|
+
"allowfullscreen",
|
|
5906
|
+
"async",
|
|
5907
|
+
"autofocus",
|
|
5908
|
+
"autoplay",
|
|
5909
|
+
"checked",
|
|
5910
|
+
"controls",
|
|
5911
|
+
"default",
|
|
5912
|
+
"defer",
|
|
5913
|
+
"disabled",
|
|
5914
|
+
"disablepictureinpicture",
|
|
5915
|
+
"disableremoteplayback",
|
|
5916
|
+
"formnovalidate",
|
|
5917
|
+
"indeterminate",
|
|
5918
|
+
"inert",
|
|
5919
|
+
"ismap",
|
|
5920
|
+
"loop",
|
|
5921
|
+
"multiple",
|
|
5922
|
+
"muted",
|
|
5923
|
+
"nomodule",
|
|
5924
|
+
"novalidate",
|
|
5925
|
+
"open",
|
|
5926
|
+
"playsinline",
|
|
5927
|
+
"readonly",
|
|
5928
|
+
"required",
|
|
5929
|
+
"reversed",
|
|
5930
|
+
"seamless",
|
|
5931
|
+
"selected",
|
|
5932
|
+
"webkitdirectory"
|
|
5933
|
+
]);
|
|
5934
|
+
DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
|
|
5935
|
+
ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
|
|
5936
|
+
RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
|
|
5937
|
+
SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
|
|
5938
|
+
END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
|
|
5939
|
+
INJECTED_SCRIPT = `${IMPORT_LINE}
|
|
5940
|
+
${AWAIT_HTML_HELPERS_SOURCE}`;
|
|
5655
5941
|
});
|
|
5656
5942
|
|
|
5657
5943
|
// src/svelte/router/lazyModule.ts
|
|
@@ -5847,15 +6133,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
|
|
|
5847
6133
|
for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
|
|
5848
6134
|
transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
|
|
5849
6135
|
}
|
|
5850
|
-
|
|
6136
|
+
const scopeClass = createAwaitScopeClassCapture();
|
|
6137
|
+
const compiledServer = compile(transpiled, {
|
|
5851
6138
|
css: "injected",
|
|
6139
|
+
cssHash: scopeClass.cssHash,
|
|
5852
6140
|
experimental: {
|
|
5853
6141
|
async: loweredAwaitSource.transformed || loweredSource.transformed
|
|
5854
6142
|
},
|
|
5855
6143
|
filename: resolutionSourcePath,
|
|
5856
6144
|
generate: "server",
|
|
5857
6145
|
hmr: isDevelopmentRuntime()
|
|
5858
|
-
})
|
|
6146
|
+
});
|
|
6147
|
+
let compiledCode = scopeClass.apply(compiledServer.js.code);
|
|
5859
6148
|
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
5860
6149
|
compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
|
|
5861
6150
|
}
|
|
@@ -6559,43 +6848,91 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
|
|
|
6559
6848
|
include chain: ${context.chain.map((path) => describe(path, context.root)).join(" \u2192 ")}`), findTagClose = (html, start) => {
|
|
6560
6849
|
const match = /^<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/.exec(html.slice(start));
|
|
6561
6850
|
return match ? start + match[0].length : -1;
|
|
6562
|
-
},
|
|
6563
|
-
const
|
|
6564
|
-
|
|
6565
|
-
const
|
|
6566
|
-
|
|
6851
|
+
}, readOpeningTag = (html, tag, start) => {
|
|
6852
|
+
const end = findTagClose(html, start);
|
|
6853
|
+
const raw = html.slice(start + tag.length + 1, end === -1 ? html.length : end - 1);
|
|
6854
|
+
const selfClosing = end !== -1 && raw.trimEnd().endsWith("/");
|
|
6855
|
+
const opening = {
|
|
6856
|
+
attributes: selfClosing ? raw.trimEnd().slice(0, -1) : raw,
|
|
6857
|
+
closing: false,
|
|
6858
|
+
end,
|
|
6859
|
+
selfClosing,
|
|
6860
|
+
start
|
|
6861
|
+
};
|
|
6862
|
+
return opening;
|
|
6863
|
+
}, nextTag = (html, tag, from) => {
|
|
6864
|
+
const tokens = new RegExp(`<${tag}(?=[\\s/>])|</${tag}\\s*>`, "gi");
|
|
6865
|
+
tokens.lastIndex = from;
|
|
6866
|
+
const token = tokens.exec(html);
|
|
6867
|
+
if (!token)
|
|
6567
6868
|
return null;
|
|
6568
|
-
|
|
6569
|
-
|
|
6869
|
+
if (!token[0].startsWith("</"))
|
|
6870
|
+
return readOpeningTag(html, tag, token.index);
|
|
6871
|
+
const closing = {
|
|
6872
|
+
attributes: "",
|
|
6873
|
+
closing: true,
|
|
6874
|
+
end: token.index + token[0].length,
|
|
6875
|
+
selfClosing: false,
|
|
6876
|
+
start: token.index
|
|
6877
|
+
};
|
|
6878
|
+
return closing;
|
|
6879
|
+
}, depthChange = (token) => {
|
|
6880
|
+
if (token.selfClosing)
|
|
6881
|
+
return 0;
|
|
6882
|
+
return token.closing ? -1 : 1;
|
|
6883
|
+
}, findElement = (html, tag, from) => {
|
|
6884
|
+
let open = nextTag(html, tag, from);
|
|
6885
|
+
while (open?.closing)
|
|
6886
|
+
open = nextTag(html, tag, open.end);
|
|
6887
|
+
if (!open || open.end === -1)
|
|
6570
6888
|
return null;
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
end: tagEnd,
|
|
6889
|
+
if (open.selfClosing) {
|
|
6890
|
+
const empty = {
|
|
6891
|
+
attributes: open.attributes,
|
|
6892
|
+
end: open.end,
|
|
6576
6893
|
inner: "",
|
|
6577
|
-
start:
|
|
6894
|
+
start: open.start
|
|
6578
6895
|
};
|
|
6579
|
-
return
|
|
6896
|
+
return empty;
|
|
6580
6897
|
}
|
|
6581
|
-
const tokens = new RegExp(`<${tag}(?=[\\s/>])|</${tag}\\s*>`, "gi");
|
|
6582
|
-
tokens.lastIndex = tagEnd;
|
|
6583
6898
|
let depth = 1;
|
|
6584
|
-
let token =
|
|
6585
|
-
while (token &&
|
|
6586
|
-
depth += token
|
|
6587
|
-
if (depth
|
|
6588
|
-
|
|
6899
|
+
let token = nextTag(html, tag, open.end);
|
|
6900
|
+
while (token && token.end !== -1) {
|
|
6901
|
+
depth += depthChange(token);
|
|
6902
|
+
if (depth === 0)
|
|
6903
|
+
break;
|
|
6904
|
+
token = nextTag(html, tag, token.end);
|
|
6589
6905
|
}
|
|
6590
|
-
if (!token)
|
|
6906
|
+
if (!token || token.end === -1)
|
|
6591
6907
|
return null;
|
|
6592
6908
|
const element = {
|
|
6593
|
-
attributes,
|
|
6594
|
-
end: token.
|
|
6595
|
-
inner: html.slice(
|
|
6596
|
-
start:
|
|
6909
|
+
attributes: open.attributes,
|
|
6910
|
+
end: token.end,
|
|
6911
|
+
inner: html.slice(open.end, token.start),
|
|
6912
|
+
start: open.start
|
|
6597
6913
|
};
|
|
6598
6914
|
return element;
|
|
6915
|
+
}, lineOf = (html, index) => html.slice(0, index).split(`
|
|
6916
|
+
`).length, assertBalanced = (html, tag, file, context) => {
|
|
6917
|
+
const open = [];
|
|
6918
|
+
let token = nextTag(html, tag, 0);
|
|
6919
|
+
while (token) {
|
|
6920
|
+
const where = `${describe(file, context.root)}:${lineOf(html, token.start)}`;
|
|
6921
|
+
if (token.end === -1)
|
|
6922
|
+
throw includeError(context, `Unterminated <${tag}> tag in ${where}`);
|
|
6923
|
+
if (token.closing && !open.pop())
|
|
6924
|
+
throw includeError(context, `</${tag}> without a matching <${tag}> in ${where}`);
|
|
6925
|
+
if (!token.closing && !token.selfClosing)
|
|
6926
|
+
open.push(token);
|
|
6927
|
+
token = nextTag(html, tag, token.end);
|
|
6928
|
+
}
|
|
6929
|
+
const [unclosed] = open;
|
|
6930
|
+
if (!unclosed)
|
|
6931
|
+
return;
|
|
6932
|
+
throw includeError(context, `Unclosed <${tag}${unclosed.attributes.trimEnd()}> in ${describe(file, context.root)}:${lineOf(html, unclosed.start)}: close it with </${tag}> or make it self-closing (<${tag} \u2026 />)`);
|
|
6933
|
+
}, INCLUDE_TAGS, assertIncludeTagsBalanced = (html, file, context) => {
|
|
6934
|
+
for (const tag of INCLUDE_TAGS)
|
|
6935
|
+
assertBalanced(html, tag, file, context);
|
|
6599
6936
|
}, readAttribute = (attributes, name) => new RegExp(`(?:^|\\s)${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i").exec(attributes)?.slice(1).find((value) => value !== undefined), replaceElements = (html, tag, replace) => {
|
|
6600
6937
|
let output = "";
|
|
6601
6938
|
let cursor = 0;
|
|
@@ -6637,6 +6974,7 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
|
|
|
6637
6974
|
throw includeError({ ...context, chain }, `<abs-include src="${src}"> in ${describe(file, context.root)}: file not found (${target})`);
|
|
6638
6975
|
}
|
|
6639
6976
|
context.dependencies.add(target);
|
|
6977
|
+
assertIncludeTagsBalanced(source, target, { ...context, chain });
|
|
6640
6978
|
const values = new Map([...collectSlotValues(element.inner)].map(([name, value]) => [
|
|
6641
6979
|
name,
|
|
6642
6980
|
expandWithin(value, file, context)
|
|
@@ -6661,10 +6999,13 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
|
|
|
6661
6999
|
readFile: options.readFile ?? readUtf8,
|
|
6662
7000
|
root: options.root ?? process.cwd()
|
|
6663
7001
|
};
|
|
7002
|
+
assertIncludeTagsBalanced(html, file, context);
|
|
6664
7003
|
const expanded = expandWithin(html, file, context);
|
|
6665
7004
|
return { dependencies: [...context.dependencies], html: expanded };
|
|
6666
7005
|
};
|
|
6667
|
-
var init_htmlIncludes = () => {
|
|
7006
|
+
var init_htmlIncludes = __esm(() => {
|
|
7007
|
+
INCLUDE_TAGS = ["abs-include", "abs-slot"];
|
|
7008
|
+
});
|
|
6668
7009
|
|
|
6669
7010
|
// src/build/spaSideManifests.ts
|
|
6670
7011
|
import { writeFile as writeFile4 } from "fs/promises";
|
|
@@ -7385,6 +7726,8 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
7385
7726
|
// src/angular/staticAnalyzeSpaRoutes.ts
|
|
7386
7727
|
var exports_staticAnalyzeSpaRoutes = {};
|
|
7387
7728
|
__export(exports_staticAnalyzeSpaRoutes, {
|
|
7729
|
+
analyzeAngularColocatedRouteFile: () => analyzeAngularColocatedRouteFile,
|
|
7730
|
+
analyzeAngularColocatedRoutes: () => analyzeAngularColocatedRoutes,
|
|
7388
7731
|
analyzeAngularSpaRouteFile: () => analyzeAngularSpaRouteFile,
|
|
7389
7732
|
analyzeAngularSpaRoutes: () => analyzeAngularSpaRoutes
|
|
7390
7733
|
});
|
|
@@ -7572,6 +7915,47 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
7572
7915
|
routes,
|
|
7573
7916
|
sourceFile: filePath
|
|
7574
7917
|
};
|
|
7918
|
+
}, unwrapExpression = (expression) => {
|
|
7919
|
+
if (lazyTypescript.isAsExpression(expression) || lazyTypescript.isSatisfiesExpression(expression) || lazyTypescript.isParenthesizedExpression(expression))
|
|
7920
|
+
return unwrapExpression(expression.expression);
|
|
7921
|
+
return expression;
|
|
7922
|
+
}, findColocatedRoutesArray = (sourceFile) => {
|
|
7923
|
+
for (const statement of sourceFile.statements) {
|
|
7924
|
+
if (!lazyTypescript.isVariableStatement(statement))
|
|
7925
|
+
continue;
|
|
7926
|
+
const exported = statement.modifiers?.some((modifier) => modifier.kind === lazyTypescript.SyntaxKind.ExportKeyword);
|
|
7927
|
+
if (!exported)
|
|
7928
|
+
continue;
|
|
7929
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
7930
|
+
if (!lazyTypescript.isIdentifier(declaration.name))
|
|
7931
|
+
continue;
|
|
7932
|
+
if (declaration.name.text !== "routes")
|
|
7933
|
+
continue;
|
|
7934
|
+
if (!declaration.initializer)
|
|
7935
|
+
continue;
|
|
7936
|
+
const initializer = unwrapExpression(declaration.initializer);
|
|
7937
|
+
if (lazyTypescript.isArrayLiteralExpression(initializer))
|
|
7938
|
+
return initializer;
|
|
7939
|
+
}
|
|
7940
|
+
}
|
|
7941
|
+
return null;
|
|
7942
|
+
}, COLOCATED_ROUTES_EXPORT, analyzeAngularColocatedRouteFile = async (filePath) => {
|
|
7943
|
+
let source;
|
|
7944
|
+
try {
|
|
7945
|
+
source = await fs.readFile(filePath, "utf-8");
|
|
7946
|
+
} catch {
|
|
7947
|
+
return null;
|
|
7948
|
+
}
|
|
7949
|
+
if (!COLOCATED_ROUTES_EXPORT.test(source))
|
|
7950
|
+
return null;
|
|
7951
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
7952
|
+
const routesArray = findColocatedRoutesArray(sourceFile);
|
|
7953
|
+
if (!routesArray)
|
|
7954
|
+
return null;
|
|
7955
|
+
const routes = [];
|
|
7956
|
+
extractRoutePaths(routesArray, "", false, routes);
|
|
7957
|
+
const host = { baseHref: "/", routes, sourceFile: filePath };
|
|
7958
|
+
return host;
|
|
7575
7959
|
}, walkTsFiles = async (dir, files) => {
|
|
7576
7960
|
let items;
|
|
7577
7961
|
try {
|
|
@@ -7593,6 +7977,22 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
7593
7977
|
}
|
|
7594
7978
|
}
|
|
7595
7979
|
await Promise.all(directories.map((directory) => walkTsFiles(directory, files)));
|
|
7980
|
+
}, analyzeAngularColocatedRoutes = async (angularDirectory) => {
|
|
7981
|
+
if (!existsSync16(angularDirectory))
|
|
7982
|
+
return [];
|
|
7983
|
+
const tsFiles = [];
|
|
7984
|
+
await walkTsFiles(angularDirectory, tsFiles);
|
|
7985
|
+
const pages = [];
|
|
7986
|
+
await Promise.all(tsFiles.map(async (file) => {
|
|
7987
|
+
try {
|
|
7988
|
+
if (await analyzeAngularSpaRouteFile(file))
|
|
7989
|
+
return;
|
|
7990
|
+
const page = await analyzeAngularColocatedRouteFile(file);
|
|
7991
|
+
if (page)
|
|
7992
|
+
pages.push(page);
|
|
7993
|
+
} catch {}
|
|
7994
|
+
}));
|
|
7995
|
+
return pages;
|
|
7596
7996
|
}, analyzeAngularSpaRoutes = async (angularDirectory) => {
|
|
7597
7997
|
if (!existsSync16(angularDirectory))
|
|
7598
7998
|
return [];
|
|
@@ -7613,6 +8013,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
7613
8013
|
var init_staticAnalyzeSpaRoutes = __esm(() => {
|
|
7614
8014
|
init_lazyTypescript();
|
|
7615
8015
|
DYNAMIC_SEGMENT_PATTERN = /^[:*]/;
|
|
8016
|
+
COLOCATED_ROUTES_EXPORT = /\bexport\s+(?:const|let|var)\s+routes\b/;
|
|
7616
8017
|
});
|
|
7617
8018
|
|
|
7618
8019
|
// src/react/staticAnalyzeSpaRoutes.ts
|
|
@@ -15638,7 +16039,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15638
16039
|
nonce: readCspNonce()
|
|
15639
16040
|
});
|
|
15640
16041
|
return new Response(stream, {
|
|
15641
|
-
headers: { "Content-Type":
|
|
16042
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15642
16043
|
status: 500
|
|
15643
16044
|
});
|
|
15644
16045
|
}, renderSvelteError = async (conventionPath, errorProps) => {
|
|
@@ -15654,7 +16055,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15654
16055
|
});
|
|
15655
16056
|
const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
|
|
15656
16057
|
return new Response(html, {
|
|
15657
|
-
headers: { "Content-Type":
|
|
16058
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15658
16059
|
status: 500
|
|
15659
16060
|
});
|
|
15660
16061
|
}, unescapeVueStyles = (ssrBody) => {
|
|
@@ -15678,7 +16079,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15678
16079
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
15679
16080
|
const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
|
|
15680
16081
|
return new Response(html, {
|
|
15681
|
-
headers: { "Content-Type":
|
|
16082
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15682
16083
|
status: 500
|
|
15683
16084
|
});
|
|
15684
16085
|
}, renderAngularError = async (conventionPath, errorProps) => {
|
|
@@ -15688,14 +16089,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15688
16089
|
return null;
|
|
15689
16090
|
const html = renderFn(errorProps);
|
|
15690
16091
|
return new Response(html, {
|
|
15691
|
-
headers: { "Content-Type":
|
|
16092
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15692
16093
|
status: 500
|
|
15693
16094
|
});
|
|
15694
16095
|
}, escapeHtml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), replaceErrorTokens = (template, errorProps) => template.replace(/\{\{\s*name\s*\}\}/g, escapeHtml(errorProps.name)).replace(/\{\{\s*message\s*\}\}/g, escapeHtml(errorProps.message)).replace(/\{\{\s*stack\s*\}\}/g, errorProps.stack ? escapeHtml(errorProps.stack) : ""), renderHtmlError = async (conventionPath, errorProps) => {
|
|
15695
16096
|
const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
|
|
15696
16097
|
const html = replaceErrorTokens(template, errorProps);
|
|
15697
16098
|
return new Response(html, {
|
|
15698
|
-
headers: { "Content-Type":
|
|
16099
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15699
16100
|
status: 500
|
|
15700
16101
|
});
|
|
15701
16102
|
}, logConventionRenderError = (framework, label, renderError) => {
|
|
@@ -15774,7 +16175,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15774
16175
|
nonce: readCspNonce()
|
|
15775
16176
|
});
|
|
15776
16177
|
return new Response(stream, {
|
|
15777
|
-
headers: { "Content-Type":
|
|
16178
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15778
16179
|
status: 404
|
|
15779
16180
|
});
|
|
15780
16181
|
}, renderSvelteNotFound = async (conventionPath) => {
|
|
@@ -15787,7 +16188,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15787
16188
|
const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
|
|
15788
16189
|
const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
|
|
15789
16190
|
return new Response(html, {
|
|
15790
|
-
headers: { "Content-Type":
|
|
16191
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15791
16192
|
status: 404
|
|
15792
16193
|
});
|
|
15793
16194
|
}, renderVueNotFound = async (conventionPath) => {
|
|
@@ -15804,7 +16205,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15804
16205
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
15805
16206
|
const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
|
|
15806
16207
|
return new Response(html, {
|
|
15807
|
-
headers: { "Content-Type":
|
|
16208
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15808
16209
|
status: 404
|
|
15809
16210
|
});
|
|
15810
16211
|
}, renderAngularNotFound = async (conventionPath) => {
|
|
@@ -15814,13 +16215,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15814
16215
|
return null;
|
|
15815
16216
|
const html = renderFn();
|
|
15816
16217
|
return new Response(html, {
|
|
15817
|
-
headers: { "Content-Type":
|
|
16218
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15818
16219
|
status: 404
|
|
15819
16220
|
});
|
|
15820
16221
|
}, renderHtmlNotFound = async (conventionPath) => {
|
|
15821
16222
|
const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
|
|
15822
16223
|
return new Response(html, {
|
|
15823
|
-
headers: { "Content-Type":
|
|
16224
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
15824
16225
|
status: 404
|
|
15825
16226
|
});
|
|
15826
16227
|
}, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
|
|
@@ -15854,6 +16255,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
15854
16255
|
return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
|
|
15855
16256
|
};
|
|
15856
16257
|
var init_resolveConvention = __esm(() => {
|
|
16258
|
+
init_constants();
|
|
15857
16259
|
init_cspNonceRef();
|
|
15858
16260
|
init_staticHtmlNonce();
|
|
15859
16261
|
init_ssrErrorPage();
|
|
@@ -15892,6 +16294,11 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
|
15892
16294
|
}, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
|
|
15893
16295
|
const value = Reflect.get(globalThis, SPA_ROUTES_KEY);
|
|
15894
16296
|
return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
|
|
16297
|
+
}, OBSERVED_SPA_ROUTES_KEY = "__absoluteObservedSpaRoutes", getObservedSpaRoutes = () => {
|
|
16298
|
+
const value = Reflect.get(globalThis, OBSERVED_SPA_ROUTES_KEY);
|
|
16299
|
+
return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
|
|
16300
|
+
}, setObservedSpaRoutes = (hosts) => {
|
|
16301
|
+
Reflect.set(globalThis, OBSERVED_SPA_ROUTES_KEY, hosts);
|
|
15895
16302
|
}, normalizePath2 = (path) => {
|
|
15896
16303
|
const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
|
|
15897
16304
|
const trimmed = withLeadingSlash.replace(/\/+$/, "");
|
|
@@ -19899,13 +20306,13 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
19899
20306
|
return name.text;
|
|
19900
20307
|
}
|
|
19901
20308
|
return null;
|
|
19902
|
-
},
|
|
20309
|
+
}, unwrapExpression2 = (node) => {
|
|
19903
20310
|
if (lazyTypescript.isAsExpression(node) || lazyTypescript.isSatisfiesExpression(node) || lazyTypescript.isParenthesizedExpression(node) || lazyTypescript.isTypeAssertionExpression(node)) {
|
|
19904
|
-
return
|
|
20311
|
+
return unwrapExpression2(node.expression);
|
|
19905
20312
|
}
|
|
19906
20313
|
return node;
|
|
19907
20314
|
}, readLiteral = (node) => {
|
|
19908
|
-
const inner =
|
|
20315
|
+
const inner = unwrapExpression2(node);
|
|
19909
20316
|
if (lazyTypescript.isStringLiteral(inner) || lazyTypescript.isNoSubstitutionTemplateLiteral(inner)) {
|
|
19910
20317
|
return inner.text;
|
|
19911
20318
|
}
|
|
@@ -19924,7 +20331,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
19924
20331
|
lazyTypescript.forEachChild(sourceFile, visit);
|
|
19925
20332
|
return constants;
|
|
19926
20333
|
}, readStringValue = (node, constants) => {
|
|
19927
|
-
const inner =
|
|
20334
|
+
const inner = unwrapExpression2(node);
|
|
19928
20335
|
if (lazyTypescript.isIdentifier(inner))
|
|
19929
20336
|
return constants.get(inner.text) ?? null;
|
|
19930
20337
|
return readLiteral(inner);
|
|
@@ -20774,6 +21181,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
20774
21181
|
};
|
|
20775
21182
|
const generate = (mode) => {
|
|
20776
21183
|
const transpiled = mode === "server" ? transpiledServer : transpiledClient;
|
|
21184
|
+
const scopeClass = createAwaitScopeClassCapture();
|
|
20777
21185
|
const compiled = isModule ? compileModule(transpiled, {
|
|
20778
21186
|
dev: mode === "client" && dev,
|
|
20779
21187
|
experimental: {
|
|
@@ -20782,6 +21190,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
20782
21190
|
filename: src
|
|
20783
21191
|
}) : compile(transpiled, {
|
|
20784
21192
|
css: externalCss && mode === "client" ? "external" : "injected",
|
|
21193
|
+
cssHash: scopeClass.cssHash,
|
|
20785
21194
|
dev: mode === "client" && dev,
|
|
20786
21195
|
experimental: {
|
|
20787
21196
|
async: transformedByLowering
|
|
@@ -20791,7 +21200,7 @@ var withResolvedSources = (map, sourceFile) => {
|
|
|
20791
21200
|
hmr: isDev
|
|
20792
21201
|
});
|
|
20793
21202
|
const compiledJs = compiled.js;
|
|
20794
|
-
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
21203
|
+
let code = scopeClass.apply(compiledJs.code).replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
20795
21204
|
if (mode === "client" && isDev) {
|
|
20796
21205
|
const moduleKey = `/@src/${relative23(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
20797
21206
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
@@ -23070,10 +23479,10 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
23070
23479
|
}
|
|
23071
23480
|
return {
|
|
23072
23481
|
content: parsedBlock.content.trim(),
|
|
23073
|
-
nextIndex: input.keyword === "@placeholder" ?
|
|
23482
|
+
nextIndex: input.keyword === "@placeholder" ? skipWhitespace2(input.template, parsedBlock.nextIndex) : parsedBlock.nextIndex
|
|
23074
23483
|
};
|
|
23075
23484
|
}, resolveDeferSlotStart = (template, deferIndex, markerCursor) => {
|
|
23076
|
-
const nextMarkerCursor =
|
|
23485
|
+
const nextMarkerCursor = skipWhitespace2(template, markerCursor);
|
|
23077
23486
|
if (template[nextMarkerCursor] === "{") {
|
|
23078
23487
|
return {
|
|
23079
23488
|
changed: false,
|
|
@@ -23298,7 +23707,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
23298
23707
|
template: resolvedBlockState.template
|
|
23299
23708
|
};
|
|
23300
23709
|
}
|
|
23301
|
-
const blockContent = parsePlaceholderAndErrorBlocks(template,
|
|
23710
|
+
const blockContent = parsePlaceholderAndErrorBlocks(template, skipWhitespace2(template, resolvedBlock.nextIndex));
|
|
23302
23711
|
const builtSlot = buildDeferredSlot({
|
|
23303
23712
|
cursorAfterResolved: blockContent.cursorAfterResolved,
|
|
23304
23713
|
errorHtml: blockContent.errorHtml,
|
|
@@ -23328,14 +23737,14 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
23328
23737
|
({ cursor, depth } = consumed);
|
|
23329
23738
|
}
|
|
23330
23739
|
return { content: value.slice(start + 1), nextIndex: value.length };
|
|
23331
|
-
},
|
|
23740
|
+
}, skipWhitespace2 = (value, index) => {
|
|
23332
23741
|
let cursor = index;
|
|
23333
23742
|
while (cursor < value.length && /\s/.test(value[cursor] ?? "")) {
|
|
23334
23743
|
cursor += 1;
|
|
23335
23744
|
}
|
|
23336
23745
|
return cursor;
|
|
23337
23746
|
}, parseOptionalParenthesizedBlock = (value, index) => {
|
|
23338
|
-
let cursor =
|
|
23747
|
+
let cursor = skipWhitespace2(value, index);
|
|
23339
23748
|
if (value[cursor] !== "(") {
|
|
23340
23749
|
return null;
|
|
23341
23750
|
}
|
|
@@ -23399,7 +23808,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
23399
23808
|
return null;
|
|
23400
23809
|
}
|
|
23401
23810
|
const blockKeywordCursor = cursorAfterResolved + keyword.length;
|
|
23402
|
-
const blockStart =
|
|
23811
|
+
const blockStart = skipWhitespace2(template, blockKeywordCursor);
|
|
23403
23812
|
if (template[blockStart] !== "{") {
|
|
23404
23813
|
return null;
|
|
23405
23814
|
}
|
|
@@ -24061,7 +24470,7 @@ ${importLine}${source.slice(insertAt)}`;
|
|
|
24061
24470
|
const rawExpression = value.slice(interpolationStart + 2, nextCursor - 2).trim();
|
|
24062
24471
|
const expression = rawExpression.length === 0 ? "''" : rawExpression;
|
|
24063
24472
|
const expressionLiteral = JSON.stringify(expression);
|
|
24064
|
-
parts.push(`\${this.__absoluteDeferResolveTemplateExpression(${expressionLiteral})}`);
|
|
24473
|
+
parts.push(`\${this.__absoluteDeferEscapeHtml(this.__absoluteDeferResolveTemplateExpression(${expressionLiteral}))}`);
|
|
24065
24474
|
cursor = nextCursor;
|
|
24066
24475
|
}
|
|
24067
24476
|
return parts.join("");
|
|
@@ -24092,6 +24501,10 @@ ${importLine}${source.slice(insertAt)}`;
|
|
|
24092
24501
|
` + ` return value;
|
|
24093
24502
|
` + ` }
|
|
24094
24503
|
|
|
24504
|
+
` + ` __absoluteDeferEscapeHtml(value: string) {
|
|
24505
|
+
` + ` return value.replace(/[&<>"']/g, (char) => char === '&' ? '&' : char === '<' ? '<' : char === '>' ? '>' : char === '"' ? '"' : ''');
|
|
24506
|
+
` + ` }
|
|
24507
|
+
|
|
24095
24508
|
`, buildDeferSlotFields = (slots) => [
|
|
24096
24509
|
buildDeferSlotTemplateResolver(),
|
|
24097
24510
|
...slots.map((slot, index) => {
|
|
@@ -27998,6 +28411,11 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27998
28411
|
}))
|
|
27999
28412
|
];
|
|
28000
28413
|
setSpaRouteManifest(spaRouteHosts);
|
|
28414
|
+
const observedAngularHosts = isDev && angularDir ? await Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), {})).then((module) => analyzeAngularColocatedRoutes(angularDir)) : [];
|
|
28415
|
+
setObservedSpaRoutes(observedAngularHosts.map((host) => ({
|
|
28416
|
+
...host,
|
|
28417
|
+
framework: "angular"
|
|
28418
|
+
})));
|
|
28001
28419
|
writeFileSync14(join57(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
28002
28420
|
if (isIncremental) {
|
|
28003
28421
|
writeBuildTrace(buildPath);
|
|
@@ -29736,7 +30154,7 @@ var init_assetStore = __esm(() => {
|
|
|
29736
30154
|
".css": "text/css",
|
|
29737
30155
|
".eot": "application/vnd.ms-fontobject",
|
|
29738
30156
|
".gif": "image/gif",
|
|
29739
|
-
".html": "text/html",
|
|
30157
|
+
".html": "text/html; charset=utf-8",
|
|
29740
30158
|
".ico": "image/x-icon",
|
|
29741
30159
|
".jpeg": "image/jpeg",
|
|
29742
30160
|
".jpg": "image/jpeg",
|
|
@@ -30245,10 +30663,15 @@ var normalizePath3 = (path) => resolve56(path).replace(/\\/g, "/"), owningFramew
|
|
|
30245
30663
|
default:
|
|
30246
30664
|
return null;
|
|
30247
30665
|
}
|
|
30666
|
+
}, analyzeObservedFile = async (framework, file) => {
|
|
30667
|
+
if (framework !== "angular")
|
|
30668
|
+
return null;
|
|
30669
|
+
return (await Promise.resolve().then(() => (init_staticAnalyzeSpaRoutes(), exports_staticAnalyzeSpaRoutes))).analyzeAngularColocatedRouteFile(file);
|
|
30248
30670
|
}, readHost = async (framework, file) => {
|
|
30249
30671
|
try {
|
|
30250
30672
|
const host = await analyzeFile(framework, file);
|
|
30251
|
-
|
|
30673
|
+
const observed = host ? null : await analyzeObservedFile(framework, file);
|
|
30674
|
+
return { host, observed };
|
|
30252
30675
|
} catch (error) {
|
|
30253
30676
|
logWarn(`Could not re-read SPA routes from ${file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
30254
30677
|
return null;
|
|
@@ -30260,43 +30683,73 @@ var normalizePath3 = (path) => resolve56(path).replace(/\\/g, "/"), owningFramew
|
|
|
30260
30683
|
added: [...afterPaths].filter((path) => !beforePaths.has(path)),
|
|
30261
30684
|
removed: [...beforePaths].filter((path) => !afterPaths.has(path))
|
|
30262
30685
|
};
|
|
30263
|
-
},
|
|
30686
|
+
}, findHost = (hosts, framework, file) => hosts.find((host) => host.framework === framework && normalizePath3(host.sourceFile) === file), replaceHost = (hosts, change, next) => {
|
|
30687
|
+
const previous = findHost(hosts, change.framework, change.file);
|
|
30688
|
+
return [
|
|
30689
|
+
...hosts.filter((host) => host !== previous),
|
|
30690
|
+
...next ? [{ ...next, framework: change.framework }] : []
|
|
30691
|
+
];
|
|
30692
|
+
}, writeRouteTable = async (hosts, paths) => {
|
|
30693
|
+
setSpaRouteManifest(hosts);
|
|
30694
|
+
try {
|
|
30695
|
+
await writeFile14(join63(paths.buildDir, "spa-routes.json"), JSON.stringify(hosts, null, "\t"));
|
|
30696
|
+
} catch {}
|
|
30697
|
+
}, publishRouteChanges = async (pending, paths) => {
|
|
30698
|
+
if (pending.length === 0)
|
|
30699
|
+
return;
|
|
30700
|
+
let hosts = getSpaRouteManifest();
|
|
30701
|
+
let observed = getObservedSpaRoutes();
|
|
30702
|
+
let enforcedChanged = false;
|
|
30703
|
+
for (const change of pending) {
|
|
30704
|
+
const previous = findHost(hosts, change.framework, change.file);
|
|
30705
|
+
if (hostSignature(previous) !== hostSignature(change.next))
|
|
30706
|
+
enforcedChanged = true;
|
|
30707
|
+
hosts = replaceHost(hosts, change, change.next);
|
|
30708
|
+
observed = replaceHost(observed, change, change.nextObserved);
|
|
30709
|
+
}
|
|
30710
|
+
setObservedSpaRoutes(observed);
|
|
30711
|
+
if (enforcedChanged)
|
|
30712
|
+
await writeRouteTable(hosts, paths);
|
|
30713
|
+
for (const change of pending) {
|
|
30714
|
+
logRoutesUpdate(change.file, change.framework, change.added, change.removed);
|
|
30715
|
+
}
|
|
30716
|
+
}, readSpaRouteChanges = async (files, paths) => {
|
|
30264
30717
|
const candidates = [...new Set(files.map(normalizePath3))].flatMap((file) => {
|
|
30265
30718
|
const framework = owningFramework(file, paths);
|
|
30266
30719
|
return framework ? [{ file, framework }] : [];
|
|
30267
30720
|
});
|
|
30268
|
-
|
|
30269
|
-
|
|
30270
|
-
|
|
30271
|
-
const changes = [];
|
|
30721
|
+
const hosts = getSpaRouteManifest();
|
|
30722
|
+
const observed = getObservedSpaRoutes();
|
|
30723
|
+
const pending = [];
|
|
30272
30724
|
await Promise.all(candidates.map(async ({ file, framework }) => {
|
|
30273
30725
|
const read = await readHost(framework, file);
|
|
30274
30726
|
if (!read)
|
|
30275
30727
|
return;
|
|
30276
|
-
const
|
|
30277
|
-
const
|
|
30278
|
-
if (hostSignature(previous) === hostSignature(
|
|
30728
|
+
const previous = findHost(hosts, framework, file);
|
|
30729
|
+
const previousObserved = findHost(observed, framework, file);
|
|
30730
|
+
if (hostSignature(previous) === hostSignature(read.host) && hostSignature(previousObserved) === hostSignature(read.observed))
|
|
30279
30731
|
return;
|
|
30280
|
-
|
|
30281
|
-
...hosts.filter((host) => host !== previous),
|
|
30282
|
-
...next ? [{ ...next, framework }] : []
|
|
30283
|
-
];
|
|
30284
|
-
changes.push({
|
|
30732
|
+
pending.push({
|
|
30285
30733
|
file,
|
|
30286
30734
|
framework,
|
|
30287
|
-
|
|
30735
|
+
next: read.host,
|
|
30736
|
+
nextObserved: read.observed,
|
|
30737
|
+
...diffRoutes(previous ?? previousObserved, read.host ?? read.observed)
|
|
30288
30738
|
});
|
|
30289
30739
|
}));
|
|
30290
|
-
|
|
30291
|
-
|
|
30292
|
-
|
|
30293
|
-
|
|
30294
|
-
|
|
30295
|
-
}
|
|
30296
|
-
|
|
30297
|
-
|
|
30298
|
-
|
|
30299
|
-
|
|
30740
|
+
const changes = pending.map(({ added, file, framework, removed }) => ({
|
|
30741
|
+
added,
|
|
30742
|
+
file,
|
|
30743
|
+
framework,
|
|
30744
|
+
removed
|
|
30745
|
+
}));
|
|
30746
|
+
const publish = async (frameworks) => {
|
|
30747
|
+
const batch = pending.filter((change) => !frameworks || frameworks.includes(change.framework));
|
|
30748
|
+
for (const change of batch)
|
|
30749
|
+
pending.splice(pending.indexOf(change), 1);
|
|
30750
|
+
await publishRouteChanges(batch, paths);
|
|
30751
|
+
};
|
|
30752
|
+
return { changes, publish };
|
|
30300
30753
|
};
|
|
30301
30754
|
var init_spaRouteRefresh = __esm(() => {
|
|
30302
30755
|
init_logger();
|
|
@@ -36699,8 +37152,10 @@ ${code}`;
|
|
|
36699
37152
|
}).js.code;
|
|
36700
37153
|
}, compileSvelteComponent = (raw, filePath, projectRoot, enableAsync = false) => {
|
|
36701
37154
|
const compiler = getLoadedSvelteCompiler();
|
|
37155
|
+
const scopeClass = createAwaitScopeClassCapture();
|
|
36702
37156
|
const compiled = compiler.compile(raw, {
|
|
36703
37157
|
css: "external",
|
|
37158
|
+
cssHash: scopeClass.cssHash,
|
|
36704
37159
|
dev: true,
|
|
36705
37160
|
experimental: {
|
|
36706
37161
|
async: enableAsync
|
|
@@ -36709,7 +37164,7 @@ ${code}`;
|
|
|
36709
37164
|
generate: "client",
|
|
36710
37165
|
hmr: true
|
|
36711
37166
|
});
|
|
36712
|
-
let
|
|
37167
|
+
let code = scopeClass.apply(compiled.js.code);
|
|
36713
37168
|
if (compiled.css?.code) {
|
|
36714
37169
|
const cssPath = `${filePath}.css`;
|
|
36715
37170
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
@@ -37381,14 +37836,14 @@ var init_rewriteImports = __esm(() => {
|
|
|
37381
37836
|
|
|
37382
37837
|
// src/core/pageResponseCache.ts
|
|
37383
37838
|
import { createHash as createHash12 } from "crypto";
|
|
37384
|
-
var STREAMING_PAGE_HEADER = "x-absolute-stream",
|
|
37839
|
+
var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
|
|
37385
37840
|
const headers = new Headers(extra);
|
|
37386
37841
|
headers.set("content-type", HTML_CONTENT_TYPE);
|
|
37387
37842
|
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
37388
37843
|
return headers;
|
|
37389
37844
|
}, computeEtag = (html) => `W/"${createHash12("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
|
|
37390
37845
|
const contentType = response.headers.get("content-type") ?? "";
|
|
37391
|
-
if (!contentType.includes(
|
|
37846
|
+
if (!contentType.includes(HTML_MEDIA_TYPE))
|
|
37392
37847
|
return response;
|
|
37393
37848
|
const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
|
|
37394
37849
|
if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
|
|
@@ -37414,7 +37869,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
|
|
|
37414
37869
|
statusText: response.statusText
|
|
37415
37870
|
});
|
|
37416
37871
|
};
|
|
37417
|
-
var init_pageResponseCache = () => {
|
|
37872
|
+
var init_pageResponseCache = __esm(() => {
|
|
37873
|
+
init_constants();
|
|
37874
|
+
});
|
|
37418
37875
|
|
|
37419
37876
|
// src/core/routeAssets.ts
|
|
37420
37877
|
var LINK_TAG_RE, REL_STYLESHEET_RE, HREF_RE, TITLE_RE, ENTITIES, ENTITY_RE, decodeEntities = (value) => value.replace(ENTITY_RE, (match) => ENTITIES[match] ?? match), readHeadStylesheets = (head) => {
|
|
@@ -37458,6 +37915,7 @@ var emberCacheBuster = 0, invalidateEmberSsrCache = () => {
|
|
|
37458
37915
|
emberCacheBuster = Date.now();
|
|
37459
37916
|
};
|
|
37460
37917
|
var init_pageHandler = __esm(() => {
|
|
37918
|
+
init_constants();
|
|
37461
37919
|
init_escapeScriptContent();
|
|
37462
37920
|
init_cspNonceRef();
|
|
37463
37921
|
init_pageResponseCache();
|
|
@@ -38439,7 +38897,7 @@ var records, recordFor = (path) => {
|
|
|
38439
38897
|
for (const update of updates)
|
|
38440
38898
|
update(value);
|
|
38441
38899
|
}
|
|
38442
|
-
}, managedModulePaths = () => [...records.keys()], moduleRecord = (path) => records.get(path),
|
|
38900
|
+
}, managedModulePaths = () => [...records.keys()], moduleRecord = (path) => records.get(path), nextTag2 = (path) => {
|
|
38443
38901
|
const record = recordFor(path);
|
|
38444
38902
|
record.tag += 1;
|
|
38445
38903
|
return record.tag;
|
|
@@ -38574,7 +39032,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
38574
39032
|
return call === 1 || meta[name]?.kind !== "function";
|
|
38575
39033
|
}));
|
|
38576
39034
|
}, importNextVersion = async (path) => {
|
|
38577
|
-
const namespace = await import(`${path}?absolute-hot=${
|
|
39035
|
+
const namespace = await import(`${path}?absolute-hot=${nextTag2(path)}`);
|
|
38578
39036
|
if (typeof namespace !== "object" || namespace === null)
|
|
38579
39037
|
throw new Error(`${path} did not evaluate to a module`);
|
|
38580
39038
|
return Object.fromEntries(Object.entries(namespace));
|
|
@@ -40286,16 +40744,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
40286
40744
|
ctx.inFlight = drive();
|
|
40287
40745
|
ctx.inFlight.then(resolveFn, resolveFn);
|
|
40288
40746
|
};
|
|
40289
|
-
return () => {
|
|
40747
|
+
return ({ immediate = false } = {}) => {
|
|
40290
40748
|
if (!ctx.debouncedPromise) {
|
|
40291
40749
|
ctx.debouncedPromise = new Promise((resolve) => {
|
|
40292
40750
|
ctx.debouncedResolve = resolve;
|
|
40293
40751
|
});
|
|
40294
40752
|
}
|
|
40753
|
+
const scheduled = ctx.debouncedPromise;
|
|
40295
40754
|
if (ctx.debounceTimer)
|
|
40296
40755
|
clearTimeout(ctx.debounceTimer);
|
|
40297
|
-
ctx.debounceTimer =
|
|
40298
|
-
|
|
40756
|
+
ctx.debounceTimer = null;
|
|
40757
|
+
if (immediate)
|
|
40758
|
+
fire();
|
|
40759
|
+
else
|
|
40760
|
+
ctx.debounceTimer = setTimeout(fire, SVELTE_BUNDLE_DEBOUNCE_MS);
|
|
40761
|
+
return scheduled;
|
|
40299
40762
|
};
|
|
40300
40763
|
}, handleSvelteFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
40301
40764
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -40570,16 +41033,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
40570
41033
|
ctx.inFlight = drive();
|
|
40571
41034
|
ctx.inFlight.then(resolveFn, resolveFn);
|
|
40572
41035
|
};
|
|
40573
|
-
return () => {
|
|
41036
|
+
return ({ immediate = false } = {}) => {
|
|
40574
41037
|
if (!ctx.debouncedPromise) {
|
|
40575
41038
|
ctx.debouncedPromise = new Promise((resolve) => {
|
|
40576
41039
|
ctx.debouncedResolve = resolve;
|
|
40577
41040
|
});
|
|
40578
41041
|
}
|
|
41042
|
+
const scheduled = ctx.debouncedPromise;
|
|
40579
41043
|
if (ctx.debounceTimer)
|
|
40580
41044
|
clearTimeout(ctx.debounceTimer);
|
|
40581
|
-
ctx.debounceTimer =
|
|
40582
|
-
|
|
41045
|
+
ctx.debounceTimer = null;
|
|
41046
|
+
if (immediate)
|
|
41047
|
+
fire();
|
|
41048
|
+
else
|
|
41049
|
+
ctx.debounceTimer = setTimeout(fire, VUE_BUNDLE_DEBOUNCE_MS);
|
|
41050
|
+
return scheduled;
|
|
40583
41051
|
};
|
|
40584
41052
|
}, handleVueFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
40585
41053
|
const vueFiles = filesToRebuild.filter((file) => file.endsWith(".vue") && detectFramework(file, state.resolvedPaths) === "vue");
|
|
@@ -41309,9 +41777,29 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
41309
41777
|
await processMarkupFiles(markupFiles);
|
|
41310
41778
|
}, runHtmlFastPath = async (state, config, filesToRebuild, startTime) => runMarkupFastPath(state, config, filesToRebuild, startTime, "html"), runHtmxFastPath = async (state, config, filesToRebuild, startTime) => runMarkupFastPath(state, config, filesToRebuild, startTime, "htmx"), markHandledFiles = (files, framework, resolvedPaths, handled) => {
|
|
41311
41779
|
files.filter((f) => detectFramework(f, resolvedPaths) === framework).forEach((f) => handled.add(f));
|
|
41780
|
+
}, rebuildSsrForRouteChanges = async (state, config, changes) => {
|
|
41781
|
+
const changedFiles = (framework) => changes.filter((change) => change.framework === framework).map((change) => change.file);
|
|
41782
|
+
const vueFiles = changedFiles("vue");
|
|
41783
|
+
const svelteFiles = changedFiles("svelte");
|
|
41784
|
+
await Promise.all([
|
|
41785
|
+
vueFiles.length > 0 && config.vueDirectory ? scheduleVueBundleRebuild(state, vueFiles, config)({ immediate: true }) : undefined,
|
|
41786
|
+
svelteFiles.length > 0 && config.svelteDirectory ? scheduleSvelteBundleRebuild(state, svelteFiles, config)({ immediate: true }) : undefined
|
|
41787
|
+
]);
|
|
41788
|
+
}, flushAngularBundleRebuild = async (state) => {
|
|
41789
|
+
const ctx = angularBundleState.get(state);
|
|
41790
|
+
if (!ctx)
|
|
41791
|
+
return;
|
|
41792
|
+
if (ctx.debounceTimer) {
|
|
41793
|
+
await scheduleAngularBundleRebuild(state, ctx.pageEntries, ctx.angularDir)({ immediate: true });
|
|
41794
|
+
return;
|
|
41795
|
+
}
|
|
41796
|
+
if (ctx.inFlight)
|
|
41797
|
+
await ctx.inFlight;
|
|
41312
41798
|
}, runFrameworkFastPaths = async (state, config, affectedFrameworks, files, startTime, onRebuildComplete) => {
|
|
41313
41799
|
const handled = new Set;
|
|
41314
|
-
await
|
|
41800
|
+
const routeChanges = await readSpaRouteChanges(files, state.resolvedPaths);
|
|
41801
|
+
await rebuildSsrForRouteChanges(state, config, routeChanges.changes);
|
|
41802
|
+
await routeChanges.publish(["react", "svelte", "vue"]);
|
|
41315
41803
|
const fastPaths = [
|
|
41316
41804
|
{
|
|
41317
41805
|
directory: config.angularDirectory,
|
|
@@ -41345,6 +41833,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
41345
41833
|
await fastPath.handler(state, config, files, startTime, onRebuildComplete);
|
|
41346
41834
|
markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
|
|
41347
41835
|
});
|
|
41836
|
+
if (routeChanges.changes.some((change) => change.framework === "angular"))
|
|
41837
|
+
await flushAngularBundleRebuild(state);
|
|
41838
|
+
await routeChanges.publish();
|
|
41348
41839
|
for (const file of files) {
|
|
41349
41840
|
if (!handled.has(file) && detectFramework(file, state.resolvedPaths) === "unknown" && !state.lastUserEditedFiles?.has(resolvePath4(file)))
|
|
41350
41841
|
handled.add(file);
|
|
@@ -42649,5 +43140,5 @@ export {
|
|
|
42649
43140
|
devBuild
|
|
42650
43141
|
};
|
|
42651
43142
|
|
|
42652
|
-
//# debugId=
|
|
43143
|
+
//# debugId=5FE00C7F10BE86B364756E2164756E21
|
|
42653
43144
|
//# sourceMappingURL=build.js.map
|