@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/angular/server.js
CHANGED
|
@@ -88,7 +88,7 @@ var ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER = "x-skip-transfer-cache", buildAbs
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
// src/constants.ts
|
|
91
|
-
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;
|
|
91
|
+
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;
|
|
92
92
|
var init_constants = __esm(() => {
|
|
93
93
|
TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
|
|
94
94
|
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
@@ -865,7 +865,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
865
865
|
nonce: readCspNonce()
|
|
866
866
|
});
|
|
867
867
|
return new Response(stream, {
|
|
868
|
-
headers: { "Content-Type":
|
|
868
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
869
869
|
status: 500
|
|
870
870
|
});
|
|
871
871
|
}, renderSvelteError = async (conventionPath, errorProps) => {
|
|
@@ -881,7 +881,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
881
881
|
});
|
|
882
882
|
const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
|
|
883
883
|
return new Response(html, {
|
|
884
|
-
headers: { "Content-Type":
|
|
884
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
885
885
|
status: 500
|
|
886
886
|
});
|
|
887
887
|
}, unescapeVueStyles = (ssrBody) => {
|
|
@@ -905,7 +905,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
905
905
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
906
906
|
const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
|
|
907
907
|
return new Response(html, {
|
|
908
|
-
headers: { "Content-Type":
|
|
908
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
909
909
|
status: 500
|
|
910
910
|
});
|
|
911
911
|
}, renderAngularError = async (conventionPath, errorProps) => {
|
|
@@ -915,14 +915,14 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
915
915
|
return null;
|
|
916
916
|
const html = renderFn(errorProps);
|
|
917
917
|
return new Response(html, {
|
|
918
|
-
headers: { "Content-Type":
|
|
918
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
919
919
|
status: 500
|
|
920
920
|
});
|
|
921
921
|
}, 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) => {
|
|
922
922
|
const template = await nonceStaticHtml(await Bun.file(conventionPath).text());
|
|
923
923
|
const html = replaceErrorTokens(template, errorProps);
|
|
924
924
|
return new Response(html, {
|
|
925
|
-
headers: { "Content-Type":
|
|
925
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
926
926
|
status: 500
|
|
927
927
|
});
|
|
928
928
|
}, logConventionRenderError = (framework, label, renderError) => {
|
|
@@ -1001,7 +1001,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
1001
1001
|
nonce: readCspNonce()
|
|
1002
1002
|
});
|
|
1003
1003
|
return new Response(stream, {
|
|
1004
|
-
headers: { "Content-Type":
|
|
1004
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
1005
1005
|
status: 404
|
|
1006
1006
|
});
|
|
1007
1007
|
}, renderSvelteNotFound = async (conventionPath) => {
|
|
@@ -1014,7 +1014,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
1014
1014
|
const { head, body } = render(NotFoundComponent, nonce ? { csp: { nonce } } : {});
|
|
1015
1015
|
const html = `<!DOCTYPE html><html><head>${nonceSvelteHeadStyles(head)}</head><body>${body}</body></html>`;
|
|
1016
1016
|
return new Response(html, {
|
|
1017
|
-
headers: { "Content-Type":
|
|
1017
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
1018
1018
|
status: 404
|
|
1019
1019
|
});
|
|
1020
1020
|
}, renderVueNotFound = async (conventionPath) => {
|
|
@@ -1031,7 +1031,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
1031
1031
|
const { styles, body } = unescapeVueStyles(rawBody);
|
|
1032
1032
|
const html = `<!DOCTYPE html><html><head>${styles}</head><body><div id="root">${body}</div></body></html>`;
|
|
1033
1033
|
return new Response(html, {
|
|
1034
|
-
headers: { "Content-Type":
|
|
1034
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
1035
1035
|
status: 404
|
|
1036
1036
|
});
|
|
1037
1037
|
}, renderAngularNotFound = async (conventionPath) => {
|
|
@@ -1041,13 +1041,13 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
1041
1041
|
return null;
|
|
1042
1042
|
const html = renderFn();
|
|
1043
1043
|
return new Response(html, {
|
|
1044
|
-
headers: { "Content-Type":
|
|
1044
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
1045
1045
|
status: 404
|
|
1046
1046
|
});
|
|
1047
1047
|
}, renderHtmlNotFound = async (conventionPath) => {
|
|
1048
1048
|
const html = await nonceStaticHtml(await Bun.file(conventionPath).text());
|
|
1049
1049
|
return new Response(html, {
|
|
1050
|
-
headers: { "Content-Type":
|
|
1050
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
1051
1051
|
status: 404
|
|
1052
1052
|
});
|
|
1053
1053
|
}, NOT_FOUND_RENDERERS, renderConventionNotFound = async (framework) => {
|
|
@@ -1081,6 +1081,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
|
|
|
1081
1081
|
return renderNext(options.preferHtmx ? ["htmx", ...NOT_FOUND_PRIORITY.filter((key) => key !== "htmx")] : NOT_FOUND_PRIORITY);
|
|
1082
1082
|
};
|
|
1083
1083
|
var init_resolveConvention = __esm(() => {
|
|
1084
|
+
init_constants();
|
|
1084
1085
|
init_cspNonceRef();
|
|
1085
1086
|
init_staticHtmlNonce();
|
|
1086
1087
|
init_ssrErrorPage();
|
|
@@ -1442,6 +1443,11 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
|
|
|
1442
1443
|
}, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
|
|
1443
1444
|
const value = Reflect.get(globalThis, SPA_ROUTES_KEY);
|
|
1444
1445
|
return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
|
|
1446
|
+
}, OBSERVED_SPA_ROUTES_KEY = "__absoluteObservedSpaRoutes", getObservedSpaRoutes = () => {
|
|
1447
|
+
const value = Reflect.get(globalThis, OBSERVED_SPA_ROUTES_KEY);
|
|
1448
|
+
return Array.isArray(value) ? value.filter(isRuntimeSpaHost) : [];
|
|
1449
|
+
}, setObservedSpaRoutes = (hosts) => {
|
|
1450
|
+
Reflect.set(globalThis, OBSERVED_SPA_ROUTES_KEY, hosts);
|
|
1445
1451
|
}, normalizePath = (path) => {
|
|
1446
1452
|
const withLeadingSlash = path.startsWith("/") ? path : `/${path}`;
|
|
1447
1453
|
const trimmed = withLeadingSlash.replace(/\/+$/, "");
|
|
@@ -2495,23 +2501,247 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
2495
2501
|
index = markup.indexOf("{", end);
|
|
2496
2502
|
}
|
|
2497
2503
|
return tags;
|
|
2498
|
-
}, escapeTemplateLiteral = (value) => value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${"),
|
|
2499
|
-
|
|
2500
|
-
const
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2504
|
+
}, 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 = () => {
|
|
2505
|
+
let scopeClass = "";
|
|
2506
|
+
const cssHash = ({ css, filename, hash }) => {
|
|
2507
|
+
scopeClass = `svelte-${hash(filename === "(unknown)" ? css : filename ?? css)}`;
|
|
2508
|
+
return scopeClass;
|
|
2509
|
+
};
|
|
2510
|
+
const apply = (code) => applyAwaitScopeClass(code, scopeClass);
|
|
2511
|
+
return { apply, cssHash };
|
|
2512
|
+
}, 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) => {
|
|
2513
|
+
scan.literal += escapeTemplateLiteral(text);
|
|
2514
|
+
}, readExpressionTag = (scan) => {
|
|
2515
|
+
const end = findTagEnd(scan.source, scan.index);
|
|
2516
|
+
if (end === -1) {
|
|
2517
|
+
fail(scan.filePath, `unterminated tag in the ${scan.branch} branch`);
|
|
2518
|
+
}
|
|
2519
|
+
const inner = scan.source.slice(scan.index + 1, end - 1).trim();
|
|
2520
|
+
scan.index = end;
|
|
2521
|
+
return inner;
|
|
2522
|
+
}, failAttribute = (scan, detail) => fail(scan.filePath, `the ${scan.branch} branch of a streamed {#await} has ${detail}`), atValueEnd = (scan, quote) => {
|
|
2523
|
+
const char = scan.source[scan.index] ?? "";
|
|
2524
|
+
if (quote)
|
|
2525
|
+
return char === quote;
|
|
2526
|
+
return /[\s>]/.test(char) || scan.source.startsWith("/>", scan.index);
|
|
2527
|
+
}, readValueText = (scan, quote) => {
|
|
2528
|
+
const start = scan.index;
|
|
2529
|
+
while (scan.index < scan.source.length && scan.source[scan.index] !== "{" && !atValueEnd(scan, quote)) {
|
|
2530
|
+
scan.index += 1;
|
|
2531
|
+
}
|
|
2532
|
+
return scan.source.slice(start, scan.index);
|
|
2533
|
+
}, readAttributeValue = (scan) => {
|
|
2534
|
+
const { source } = scan;
|
|
2535
|
+
const quote = source[scan.index];
|
|
2536
|
+
const chunks = [];
|
|
2537
|
+
const isQuoted = quote === '"' || quote === "'";
|
|
2538
|
+
if (isQuoted)
|
|
2539
|
+
scan.index += 1;
|
|
2540
|
+
if (!isQuoted && source[scan.index] === "{") {
|
|
2541
|
+
chunks.push({ code: readExpressionTag(scan) });
|
|
2542
|
+
return chunks;
|
|
2543
|
+
}
|
|
2544
|
+
const valueQuote = isQuoted ? quote : undefined;
|
|
2545
|
+
while (scan.index < source.length && !atValueEnd(scan, valueQuote)) {
|
|
2546
|
+
chunks.push({ text: readValueText(scan, valueQuote) });
|
|
2547
|
+
if (source[scan.index] === "{")
|
|
2548
|
+
chunks.push({ code: readExpressionTag(scan) });
|
|
2549
|
+
}
|
|
2550
|
+
if (isQuoted)
|
|
2551
|
+
scan.index += 1;
|
|
2552
|
+
return chunks.filter((chunk) => !("text" in chunk) || chunk.text !== "");
|
|
2553
|
+
}, pushDynamicAttribute = (scan, name, chunks) => {
|
|
2554
|
+
if (DIRECTIVE_ATTRIBUTE_RE.test(name) || /^on/i.test(name)) {
|
|
2555
|
+
failAttribute(scan, `an expression in ${name}= (directives and event handlers need Svelte to run them)`);
|
|
2556
|
+
}
|
|
2557
|
+
const tag = chunks.find((chunk) => ("code" in chunk) && /^[#:/@]/.test(chunk.code));
|
|
2558
|
+
if (tag && "code" in tag) {
|
|
2559
|
+
failAttribute(scan, `{${tag.code}} in the ${name}= attribute`);
|
|
2560
|
+
}
|
|
2561
|
+
if (isShadowAttribute(name))
|
|
2562
|
+
scan.shadow += ` ${name}=${SHADOW_VALUE}`;
|
|
2563
|
+
const isClass = name === "class";
|
|
2564
|
+
if (isClass)
|
|
2565
|
+
scan.hasClass = true;
|
|
2566
|
+
const [only] = chunks;
|
|
2567
|
+
const codes = chunks.flatMap((chunk) => ("code" in chunk) ? [`(${chunk.code})`] : []);
|
|
2568
|
+
if (isClass && chunks.length > 1 && codes.length === chunks.length) {
|
|
2569
|
+
scan.literal += helperCall("class", `${HTML_HELPERS}.join(${codes.join(", ")})`);
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2572
|
+
if (chunks.length === 1 && only && "code" in only) {
|
|
2573
|
+
const value = `(${only.code})`;
|
|
2574
|
+
if (name === "class")
|
|
2575
|
+
scan.literal += helperCall("class", value);
|
|
2576
|
+
else if (name === "style")
|
|
2577
|
+
scan.literal += helperCall("style", value);
|
|
2578
|
+
else
|
|
2579
|
+
scan.literal += helperCall("attr", JSON.stringify(name), value, String(BOOLEAN_ATTRIBUTES.has(name)));
|
|
2580
|
+
return;
|
|
2581
|
+
}
|
|
2582
|
+
pushText(scan, ` ${name}="`);
|
|
2583
|
+
for (const chunk of chunks) {
|
|
2584
|
+
if ("code" in chunk)
|
|
2585
|
+
scan.literal += helperCall("part", `(${chunk.code})`);
|
|
2586
|
+
else
|
|
2587
|
+
pushText(scan, chunk.text.replaceAll('"', """));
|
|
2588
|
+
}
|
|
2589
|
+
if (isClass)
|
|
2590
|
+
scan.literal += helperCall("scoped");
|
|
2591
|
+
pushText(scan, '"');
|
|
2592
|
+
}, pushStaticAttribute = (scan, whitespace, name, value) => {
|
|
2593
|
+
if (isShadowAttribute(name))
|
|
2594
|
+
scan.shadow += `${whitespace}${name}=${value}`;
|
|
2595
|
+
if (name !== "class") {
|
|
2596
|
+
pushText(scan, `${whitespace}${name}=${value}`);
|
|
2597
|
+
return;
|
|
2598
|
+
}
|
|
2599
|
+
scan.hasClass = true;
|
|
2600
|
+
const [first = ""] = value;
|
|
2601
|
+
const isQuoted = first === '"' || first === "'";
|
|
2602
|
+
const quote = isQuoted ? first : '"';
|
|
2603
|
+
const classes = isQuoted ? value.slice(1, -1) : value;
|
|
2604
|
+
if (classes === "") {
|
|
2605
|
+
scan.literal += helperCall("class", "''");
|
|
2606
|
+
return;
|
|
2607
|
+
}
|
|
2608
|
+
pushText(scan, `${whitespace}${name}=${quote}${classes}`);
|
|
2609
|
+
scan.literal += helperCall("scoped");
|
|
2610
|
+
pushText(scan, quote);
|
|
2611
|
+
}, readAttributeName = (scan) => {
|
|
2612
|
+
const { source } = scan;
|
|
2613
|
+
const start = scan.index;
|
|
2614
|
+
while (scan.index < source.length && !ATTRIBUTE_NAME_END_RE.test(source[scan.index] ?? "")) {
|
|
2615
|
+
scan.index += 1;
|
|
2616
|
+
}
|
|
2617
|
+
return source.slice(start, scan.index);
|
|
2618
|
+
}, skipWhitespace = (scan) => {
|
|
2619
|
+
const start = scan.index;
|
|
2620
|
+
while (/\s/.test(scan.source[scan.index] ?? ""))
|
|
2621
|
+
scan.index += 1;
|
|
2622
|
+
return scan.source.slice(start, scan.index);
|
|
2623
|
+
}, pushTagExpression = (scan) => {
|
|
2624
|
+
const inner = readExpressionTag(scan);
|
|
2625
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(inner)) {
|
|
2626
|
+
failAttribute(scan, `{${inner}} in a start tag`);
|
|
2627
|
+
}
|
|
2628
|
+
pushDynamicAttribute(scan, inner, [{ code: inner }]);
|
|
2629
|
+
}, pushAttribute = (scan) => {
|
|
2630
|
+
const { source } = scan;
|
|
2631
|
+
const whitespace = skipWhitespace(scan);
|
|
2632
|
+
const closing = source.startsWith("/>", scan.index) ? "/>" : ">";
|
|
2633
|
+
const isEnd = scan.index >= source.length;
|
|
2634
|
+
if (isEnd || source.startsWith(closing, scan.index)) {
|
|
2635
|
+
if (!scan.hasClass)
|
|
2636
|
+
scan.literal += helperCall("scope");
|
|
2637
|
+
const tagEnd = isEnd ? "" : closing;
|
|
2638
|
+
pushText(scan, whitespace + tagEnd);
|
|
2639
|
+
scan.shadow += whitespace + (isEnd ? ">" : closing);
|
|
2640
|
+
scan.index += tagEnd.length;
|
|
2641
|
+
return false;
|
|
2642
|
+
}
|
|
2643
|
+
if (source[scan.index] === "{") {
|
|
2644
|
+
pushTagExpression(scan);
|
|
2645
|
+
return true;
|
|
2646
|
+
}
|
|
2647
|
+
const name = readAttributeName(scan);
|
|
2648
|
+
if (!name) {
|
|
2649
|
+
pushText(scan, whitespace + (source[scan.index] ?? ""));
|
|
2650
|
+
scan.index += 1;
|
|
2651
|
+
return true;
|
|
2652
|
+
}
|
|
2653
|
+
const beforeEquals = scan.index;
|
|
2654
|
+
skipWhitespace(scan);
|
|
2655
|
+
if (source[scan.index] !== "=") {
|
|
2656
|
+
scan.index = beforeEquals;
|
|
2657
|
+
pushText(scan, whitespace + name);
|
|
2658
|
+
if (isShadowAttribute(name))
|
|
2659
|
+
scan.shadow += whitespace + name;
|
|
2660
|
+
return true;
|
|
2507
2661
|
}
|
|
2508
|
-
|
|
2509
|
-
|
|
2662
|
+
scan.index += 1;
|
|
2663
|
+
skipWhitespace(scan);
|
|
2664
|
+
const valueStart = scan.index;
|
|
2665
|
+
const chunks = readAttributeValue(scan);
|
|
2666
|
+
if (chunks.some((chunk) => ("code" in chunk))) {
|
|
2667
|
+
pushDynamicAttribute(scan, name, chunks);
|
|
2668
|
+
return true;
|
|
2669
|
+
}
|
|
2670
|
+
pushStaticAttribute(scan, whitespace, name, source.slice(valueStart, scan.index));
|
|
2671
|
+
return true;
|
|
2672
|
+
}, pushStartTag = (scan) => {
|
|
2673
|
+
const { source } = scan;
|
|
2674
|
+
const nameMatch = source.slice(scan.index + 1).match(/^[^\s/>{]+/);
|
|
2675
|
+
const tagName = nameMatch?.[0] ?? "";
|
|
2676
|
+
pushText(scan, `<${tagName}`);
|
|
2677
|
+
scan.shadow += `<${tagName}`;
|
|
2678
|
+
scan.hasClass = RAW_TEXT_ELEMENTS.has(tagName.toLowerCase());
|
|
2679
|
+
scan.index += 1 + tagName.length;
|
|
2680
|
+
while (pushAttribute(scan))
|
|
2681
|
+
;
|
|
2682
|
+
return tagName.toLowerCase();
|
|
2683
|
+
}, pushRawText = (scan, tagName, shadowStart) => {
|
|
2684
|
+
const { source } = scan;
|
|
2685
|
+
const close = source.toLowerCase().indexOf(`</${tagName}`, scan.index);
|
|
2686
|
+
const closeEnd = close === -1 ? -1 : source.indexOf(">", close);
|
|
2687
|
+
const end = closeEnd === -1 ? source.length : closeEnd + 1;
|
|
2688
|
+
pushText(scan, source.slice(scan.index, end));
|
|
2689
|
+
scan.shadow = scan.shadow.slice(0, shadowStart);
|
|
2690
|
+
scan.index = end;
|
|
2691
|
+
}, pushTextExpression = (scan) => {
|
|
2692
|
+
const inner = readExpressionTag(scan);
|
|
2693
|
+
const rawHtml = inner.match(/^@html\s([\s\S]*)$/);
|
|
2694
|
+
if (rawHtml) {
|
|
2695
|
+
scan.literal += helperCall("html", `(${(rawHtml[1] ?? "").trim()})`);
|
|
2696
|
+
return;
|
|
2697
|
+
}
|
|
2698
|
+
scan.literal += helperCall("text", `(${inner})`);
|
|
2699
|
+
}, pushComment = (scan) => {
|
|
2700
|
+
const close = scan.source.indexOf("-->", scan.index + "<!--".length);
|
|
2701
|
+
const end = close === -1 ? scan.source.length : close + "-->".length;
|
|
2702
|
+
pushText(scan, scan.source.slice(scan.index, end));
|
|
2703
|
+
scan.index = end;
|
|
2704
|
+
}, scanTextPosition = (scan) => {
|
|
2705
|
+
const { index, source } = scan;
|
|
2706
|
+
if (source.startsWith("<!--", index)) {
|
|
2707
|
+
pushComment(scan);
|
|
2708
|
+
return;
|
|
2709
|
+
}
|
|
2710
|
+
if (source[index] === "<" && /[A-Za-z]/.test(source[index + 1] ?? "")) {
|
|
2711
|
+
const shadowStart = scan.shadow.length;
|
|
2712
|
+
const tagName = pushStartTag(scan);
|
|
2713
|
+
if (RAW_TEXT_ELEMENTS.has(tagName))
|
|
2714
|
+
pushRawText(scan, tagName, shadowStart);
|
|
2715
|
+
return;
|
|
2716
|
+
}
|
|
2717
|
+
if (source[index] === "{") {
|
|
2718
|
+
pushTextExpression(scan);
|
|
2719
|
+
return;
|
|
2720
|
+
}
|
|
2721
|
+
const next = source.slice(index + 1).search(/[<{]/);
|
|
2722
|
+
const end = next === -1 ? source.length : index + 1 + next;
|
|
2723
|
+
const text = source.slice(index, end);
|
|
2724
|
+
pushText(scan, text);
|
|
2725
|
+
scan.shadow += (text.match(END_TAG_RE) ?? []).join("");
|
|
2726
|
+
scan.index = end;
|
|
2727
|
+
}, lowerBranch = (markup, branch, filePath) => {
|
|
2728
|
+
const scan = {
|
|
2729
|
+
branch,
|
|
2730
|
+
filePath,
|
|
2731
|
+
hasClass: false,
|
|
2732
|
+
index: 0,
|
|
2733
|
+
literal: "",
|
|
2734
|
+
shadow: "",
|
|
2735
|
+
source: markup.trim()
|
|
2736
|
+
};
|
|
2737
|
+
while (scan.index < scan.source.length)
|
|
2738
|
+
scanTextPosition(scan);
|
|
2739
|
+
return { literal: `\`${scan.literal}\``, shadow: scan.shadow };
|
|
2510
2740
|
}, fail = (filePath, message) => {
|
|
2511
2741
|
throw new Error(`${filePath ? `${filePath}: ` : ""}${message} (${AWAIT_STREAM_DIRECTIVE} streams plain HTML; remove the directive to let Svelte render the block and hydrate it)`);
|
|
2512
2742
|
}, assertPlainHtml = (markup, branch, filePath) => {
|
|
2513
2743
|
const withoutExpressions = topLevelTags(markup).reduceRight((text, { end, start }) => text.slice(0, start) + text.slice(end), markup);
|
|
2514
|
-
const nestedTag = topLevelTags(markup).find(({ text }) => /^\{[
|
|
2744
|
+
const nestedTag = topLevelTags(markup).find(({ text }) => /^\{(?:[#:/]|@(?!html\s))/.test(text));
|
|
2515
2745
|
if (nestedTag || SVELTE_ONLY_MARKUP_RE.test(withoutExpressions)) {
|
|
2516
2746
|
fail(filePath, `the ${branch} branch of a streamed {#await} holds Svelte markup (${nestedTag?.text ?? withoutExpressions.match(SVELTE_ONLY_MARKUP_RE)?.[0]}\u2026)`);
|
|
2517
2747
|
}
|
|
@@ -2555,12 +2785,16 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
2555
2785
|
thenIdentifier: thenMatch?.[2],
|
|
2556
2786
|
thenMarkup
|
|
2557
2787
|
};
|
|
2558
|
-
}, renderSlot = (block, slotId, dynamic) => {
|
|
2788
|
+
}, renderSlot = (block, slotId, dynamic, filePath) => {
|
|
2559
2789
|
const thenValueIdentifier = block.thenIdentifier ?? "__awaitValue";
|
|
2560
2790
|
const catchValueIdentifier = block.catchIdentifier ?? "__awaitError";
|
|
2561
|
-
const
|
|
2562
|
-
|
|
2563
|
-
|
|
2791
|
+
const pending = lowerBranch(block.pendingMarkup, "pending", filePath);
|
|
2792
|
+
const then = lowerBranch(block.thenMarkup, "then", filePath);
|
|
2793
|
+
const caught = block.catchMarkup === undefined ? undefined : lowerBranch(block.catchMarkup, "catch", filePath);
|
|
2794
|
+
const catchBranch = caught ? `catch (${catchValueIdentifier}) { return ${caught.literal}; }` : "catch (_absoluteAwaitError) { throw _absoluteAwaitError; }";
|
|
2795
|
+
const shadows = [pending, then, caught].map((branch) => branch ? `<svelte:element this={'div'} data-absolute-slot="true">${branch.shadow}</svelte:element>` : "").join("");
|
|
2796
|
+
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}`;
|
|
2797
|
+
}, IMPORT_LINE = 'import AbsoluteAwaitSlot from "@absolutejs/absolute/svelte/components/AwaitSlot.svelte";', INJECTED_SCRIPT, lowerSvelteAwaitSlotSyntax = (source, filePath) => {
|
|
2564
2798
|
if (!source.includes("absolute:stream")) {
|
|
2565
2799
|
return { code: source, transformed: false };
|
|
2566
2800
|
}
|
|
@@ -2575,7 +2809,7 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
2575
2809
|
const slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;
|
|
2576
2810
|
awaitIndex += 1;
|
|
2577
2811
|
lowered += source.slice(cursor, directive.index);
|
|
2578
|
-
lowered += renderSlot(block, slotId, directive[1] !== undefined);
|
|
2812
|
+
lowered += renderSlot(block, slotId, directive[1] !== undefined, filePath);
|
|
2579
2813
|
cursor = block.end;
|
|
2580
2814
|
}
|
|
2581
2815
|
if (awaitIndex === 0) {
|
|
@@ -2585,14 +2819,14 @@ var AWAIT_STREAM_DIRECTIVE = "<!-- absolute:stream -->", DIRECTIVE_RE, BRANCH_TA
|
|
|
2585
2819
|
if (lowered.includes("<script")) {
|
|
2586
2820
|
return {
|
|
2587
2821
|
code: lowered.replace(/<script(\s[^>]*)?>/, (match) => `${match}
|
|
2588
|
-
${
|
|
2822
|
+
${INJECTED_SCRIPT}
|
|
2589
2823
|
`),
|
|
2590
2824
|
transformed: true
|
|
2591
2825
|
};
|
|
2592
2826
|
}
|
|
2593
2827
|
return {
|
|
2594
2828
|
code: `<script lang="ts">
|
|
2595
|
-
${
|
|
2829
|
+
${INJECTED_SCRIPT}
|
|
2596
2830
|
</script>
|
|
2597
2831
|
${lowered}`,
|
|
2598
2832
|
transformed: true
|
|
@@ -2604,6 +2838,64 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
2604
2838
|
BRANCH_TAG_RE = /^\{:(then|catch)(?:\s+([A-Za-z_$][\w$]*))?\s*\}$/;
|
|
2605
2839
|
SVELTE_ONLY_MARKUP_RE = /\{[#:/@]|<[A-Z]|<svelte:/;
|
|
2606
2840
|
QUOTES = new Set(['"', "'", "`"]);
|
|
2841
|
+
AWAIT_HTML_HELPERS_SOURCE = [
|
|
2842
|
+
`const ${HTML_HELPERS} = (() => {`,
|
|
2843
|
+
` const scope = ${JSON.stringify(AWAIT_SCOPE_CLASS_PLACEHOLDER)};`,
|
|
2844
|
+
` const escape = (value, isAttr) => String(value ?? '').replace(isAttr ? /[&"<]/g : /[&<]/g, (char) => char === '&' ? '&' : char === '"' ? '"' : '<');`,
|
|
2845
|
+
"\tconst stringify = (value) => typeof value === 'string' ? value : value == null ? '' : value + '';",
|
|
2846
|
+
"\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) : ''; };",
|
|
2847
|
+
"\treturn {",
|
|
2848
|
+
` 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) + '"'; },`,
|
|
2849
|
+
` 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) + '"' : ''; },`,
|
|
2850
|
+
"\t\thtml: (value) => String(value ?? ''),",
|
|
2851
|
+
"\t\tjoin: (...values) => values.map(stringify).join(''),",
|
|
2852
|
+
"\t\tpart: (value) => escape(stringify(value), true),",
|
|
2853
|
+
` scope: () => scope ? ' class="' + scope + '"' : '',`,
|
|
2854
|
+
"\t\tscoped: () => scope ? ' ' + scope : '',",
|
|
2855
|
+
"\t\tshadow: false,",
|
|
2856
|
+
` style: (value) => { const style = value == null ? '' : String(value); return style ? ' style="' + escape(style, true) + '"' : ''; },`,
|
|
2857
|
+
"\t\ttext: (value) => escape(value, false)",
|
|
2858
|
+
"\t};",
|
|
2859
|
+
"})();"
|
|
2860
|
+
].join(`
|
|
2861
|
+
`);
|
|
2862
|
+
BOOLEAN_ATTRIBUTES = new Set([
|
|
2863
|
+
"allowfullscreen",
|
|
2864
|
+
"async",
|
|
2865
|
+
"autofocus",
|
|
2866
|
+
"autoplay",
|
|
2867
|
+
"checked",
|
|
2868
|
+
"controls",
|
|
2869
|
+
"default",
|
|
2870
|
+
"defer",
|
|
2871
|
+
"disabled",
|
|
2872
|
+
"disablepictureinpicture",
|
|
2873
|
+
"disableremoteplayback",
|
|
2874
|
+
"formnovalidate",
|
|
2875
|
+
"indeterminate",
|
|
2876
|
+
"inert",
|
|
2877
|
+
"ismap",
|
|
2878
|
+
"loop",
|
|
2879
|
+
"multiple",
|
|
2880
|
+
"muted",
|
|
2881
|
+
"nomodule",
|
|
2882
|
+
"novalidate",
|
|
2883
|
+
"open",
|
|
2884
|
+
"playsinline",
|
|
2885
|
+
"readonly",
|
|
2886
|
+
"required",
|
|
2887
|
+
"reversed",
|
|
2888
|
+
"seamless",
|
|
2889
|
+
"selected",
|
|
2890
|
+
"webkitdirectory"
|
|
2891
|
+
]);
|
|
2892
|
+
DIRECTIVE_ATTRIBUTE_RE = /^(?:animate|bind|class|in|let|on|out|style|transition|use):/;
|
|
2893
|
+
ATTRIBUTE_NAME_END_RE = /[\s=>/{]/;
|
|
2894
|
+
RAW_TEXT_ELEMENTS = new Set(["script", "style"]);
|
|
2895
|
+
SHADOW_VALUE = `{${HTML_HELPERS}.shadow}`;
|
|
2896
|
+
END_TAG_RE = /<\/[A-Za-z][^\s>]*\s*>/g;
|
|
2897
|
+
INJECTED_SCRIPT = `${IMPORT_LINE}
|
|
2898
|
+
${AWAIT_HTML_HELPERS_SOURCE}`;
|
|
2607
2899
|
});
|
|
2608
2900
|
|
|
2609
2901
|
// src/build/stylePreprocessor.ts
|
|
@@ -3375,15 +3667,18 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
|
|
|
3375
3667
|
for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
|
|
3376
3668
|
transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
|
|
3377
3669
|
}
|
|
3378
|
-
|
|
3670
|
+
const scopeClass = createAwaitScopeClassCapture();
|
|
3671
|
+
const compiledServer = compile(transpiled, {
|
|
3379
3672
|
css: "injected",
|
|
3673
|
+
cssHash: scopeClass.cssHash,
|
|
3380
3674
|
experimental: {
|
|
3381
3675
|
async: loweredAwaitSource.transformed || loweredSource.transformed
|
|
3382
3676
|
},
|
|
3383
3677
|
filename: resolutionSourcePath,
|
|
3384
3678
|
generate: "server",
|
|
3385
3679
|
hmr: isDevelopmentRuntime()
|
|
3386
|
-
})
|
|
3680
|
+
});
|
|
3681
|
+
let compiledCode = scopeClass.apply(compiledServer.js.code);
|
|
3387
3682
|
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
3388
3683
|
compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
|
|
3389
3684
|
}
|
|
@@ -4317,14 +4612,14 @@ var init_pageProtocol = __esm(() => {
|
|
|
4317
4612
|
|
|
4318
4613
|
// src/core/pageResponseCache.ts
|
|
4319
4614
|
import { createHash } from "crypto";
|
|
4320
|
-
var STREAMING_PAGE_HEADER = "x-absolute-stream",
|
|
4615
|
+
var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_MEDIA_TYPE = "text/html", streamingPageHeaders = (extra) => {
|
|
4321
4616
|
const headers = new Headers(extra);
|
|
4322
4617
|
headers.set("content-type", HTML_CONTENT_TYPE);
|
|
4323
4618
|
headers.set(STREAMING_PAGE_HEADER, "1");
|
|
4324
4619
|
return headers;
|
|
4325
4620
|
}, computeEtag = (html) => `W/"${createHash("sha1").update(html).digest("base64url")}"`, withPageCacheHeaders = async (response, request, options) => {
|
|
4326
4621
|
const contentType = response.headers.get("content-type") ?? "";
|
|
4327
|
-
if (!contentType.includes(
|
|
4622
|
+
if (!contentType.includes(HTML_MEDIA_TYPE))
|
|
4328
4623
|
return response;
|
|
4329
4624
|
const isStreaming = response.headers.get(STREAMING_PAGE_HEADER) === "1";
|
|
4330
4625
|
if (isStreaming && !options?.bufferStreamForEtag || !response.body) {
|
|
@@ -4350,7 +4645,9 @@ var STREAMING_PAGE_HEADER = "x-absolute-stream", HTML_CONTENT_TYPE = "text/html"
|
|
|
4350
4645
|
statusText: response.statusText
|
|
4351
4646
|
});
|
|
4352
4647
|
};
|
|
4353
|
-
var init_pageResponseCache = () => {
|
|
4648
|
+
var init_pageResponseCache = __esm(() => {
|
|
4649
|
+
init_constants();
|
|
4650
|
+
});
|
|
4354
4651
|
|
|
4355
4652
|
// src/client/streamSwap.ts
|
|
4356
4653
|
var streamSwapRuntime = () => {
|
|
@@ -4802,9 +5099,9 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
4802
5099
|
tail: ""
|
|
4803
5100
|
};
|
|
4804
5101
|
};
|
|
4805
|
-
const handleBaseWinner = (controller, winner, baseRead, tail, footer) => {
|
|
5102
|
+
const handleBaseWinner = (controller, winner, baseRead, tail, footer, baseDone) => {
|
|
4806
5103
|
if (winner.kind !== "base") {
|
|
4807
|
-
return { baseDone
|
|
5104
|
+
return { baseDone, baseRead, footer, handled: false, tail };
|
|
4808
5105
|
}
|
|
4809
5106
|
if (winner.done) {
|
|
4810
5107
|
return finalizeCompletedBaseWinner(controller, tail + decoder.decode(), baseRead);
|
|
@@ -4847,7 +5144,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
4847
5144
|
return footer;
|
|
4848
5145
|
}
|
|
4849
5146
|
const winner = await Promise.race(racers);
|
|
4850
|
-
const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer), winner, (slotWinner) => {
|
|
5147
|
+
const baseWinnerState = applyBaseWinnerState(handleBaseWinner(controller, winner, baseRead, tail, footer, baseDone), winner, (slotWinner) => {
|
|
4851
5148
|
handleResolvedSlot(controller, slotWinner);
|
|
4852
5149
|
});
|
|
4853
5150
|
({ baseDone, baseRead, footer, tail } = baseWinnerState);
|
|
@@ -5210,10 +5507,10 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
5210
5507
|
}
|
|
5211
5508
|
return {
|
|
5212
5509
|
content: parsedBlock.content.trim(),
|
|
5213
|
-
nextIndex: input.keyword === "@placeholder" ?
|
|
5510
|
+
nextIndex: input.keyword === "@placeholder" ? skipWhitespace2(input.template, parsedBlock.nextIndex) : parsedBlock.nextIndex
|
|
5214
5511
|
};
|
|
5215
5512
|
}, resolveDeferSlotStart = (template, deferIndex, markerCursor) => {
|
|
5216
|
-
const nextMarkerCursor =
|
|
5513
|
+
const nextMarkerCursor = skipWhitespace2(template, markerCursor);
|
|
5217
5514
|
if (template[nextMarkerCursor] === "{") {
|
|
5218
5515
|
return {
|
|
5219
5516
|
changed: false,
|
|
@@ -5438,7 +5735,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
5438
5735
|
template: resolvedBlockState.template
|
|
5439
5736
|
};
|
|
5440
5737
|
}
|
|
5441
|
-
const blockContent = parsePlaceholderAndErrorBlocks(template,
|
|
5738
|
+
const blockContent = parsePlaceholderAndErrorBlocks(template, skipWhitespace2(template, resolvedBlock.nextIndex));
|
|
5442
5739
|
const builtSlot = buildDeferredSlot({
|
|
5443
5740
|
cursorAfterResolved: blockContent.cursorAfterResolved,
|
|
5444
5741
|
errorHtml: blockContent.errorHtml,
|
|
@@ -5468,14 +5765,14 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
5468
5765
|
({ cursor, depth } = consumed);
|
|
5469
5766
|
}
|
|
5470
5767
|
return { content: value.slice(start + 1), nextIndex: value.length };
|
|
5471
|
-
},
|
|
5768
|
+
}, skipWhitespace2 = (value, index) => {
|
|
5472
5769
|
let cursor = index;
|
|
5473
5770
|
while (cursor < value.length && /\s/.test(value[cursor] ?? "")) {
|
|
5474
5771
|
cursor += 1;
|
|
5475
5772
|
}
|
|
5476
5773
|
return cursor;
|
|
5477
5774
|
}, parseOptionalParenthesizedBlock = (value, index) => {
|
|
5478
|
-
let cursor =
|
|
5775
|
+
let cursor = skipWhitespace2(value, index);
|
|
5479
5776
|
if (value[cursor] !== "(") {
|
|
5480
5777
|
return null;
|
|
5481
5778
|
}
|
|
@@ -5539,7 +5836,7 @@ var isInterpolatedExpressionStart = (value, index) => value[index] === "{" && va
|
|
|
5539
5836
|
return null;
|
|
5540
5837
|
}
|
|
5541
5838
|
const blockKeywordCursor = cursorAfterResolved + keyword.length;
|
|
5542
|
-
const blockStart =
|
|
5839
|
+
const blockStart = skipWhitespace2(template, blockKeywordCursor);
|
|
5543
5840
|
if (template[blockStart] !== "{") {
|
|
5544
5841
|
return null;
|
|
5545
5842
|
}
|
|
@@ -6211,7 +6508,7 @@ ${importLine}${source.slice(insertAt)}`;
|
|
|
6211
6508
|
const rawExpression = value.slice(interpolationStart + 2, nextCursor - 2).trim();
|
|
6212
6509
|
const expression = rawExpression.length === 0 ? "''" : rawExpression;
|
|
6213
6510
|
const expressionLiteral = JSON.stringify(expression);
|
|
6214
|
-
parts.push(`\${this.__absoluteDeferResolveTemplateExpression(${expressionLiteral})}`);
|
|
6511
|
+
parts.push(`\${this.__absoluteDeferEscapeHtml(this.__absoluteDeferResolveTemplateExpression(${expressionLiteral}))}`);
|
|
6215
6512
|
cursor = nextCursor;
|
|
6216
6513
|
}
|
|
6217
6514
|
return parts.join("");
|
|
@@ -6242,6 +6539,10 @@ ${importLine}${source.slice(insertAt)}`;
|
|
|
6242
6539
|
` + ` return value;
|
|
6243
6540
|
` + ` }
|
|
6244
6541
|
|
|
6542
|
+
` + ` __absoluteDeferEscapeHtml(value: string) {
|
|
6543
|
+
` + ` return value.replace(/[&<>"']/g, (char) => char === '&' ? '&' : char === '<' ? '<' : char === '>' ? '>' : char === '"' ? '"' : ''');
|
|
6544
|
+
` + ` }
|
|
6545
|
+
|
|
6245
6546
|
`, buildDeferSlotFields = (slots) => [
|
|
6246
6547
|
buildDeferSlotTemplateResolver(),
|
|
6247
6548
|
...slots.map((slot, index) => {
|
|
@@ -7814,7 +8115,7 @@ var buildRuntimeModuleSpecifier = (modulePath, cacheBuster) => {
|
|
|
7814
8115
|
var withHtmlContentType = (responseInit = {}) => {
|
|
7815
8116
|
const headers = new Headers(responseInit.headers);
|
|
7816
8117
|
if (!headers.has("Content-Type")) {
|
|
7817
|
-
headers.set("Content-Type",
|
|
8118
|
+
headers.set("Content-Type", HTML_CONTENT_TYPE);
|
|
7818
8119
|
}
|
|
7819
8120
|
return { ...responseInit, headers };
|
|
7820
8121
|
};
|
|
@@ -7935,7 +8236,7 @@ var handleAngularPageRequest = async (input) => {
|
|
|
7935
8236
|
return withPageCacheHeaders(conventionResponse, request);
|
|
7936
8237
|
}
|
|
7937
8238
|
return withPageCacheHeaders(new Response(ssrErrorPage("angular", error), {
|
|
7938
|
-
headers: { "Content-Type":
|
|
8239
|
+
headers: { "Content-Type": HTML_CONTENT_TYPE },
|
|
7939
8240
|
status: 500
|
|
7940
8241
|
}), request);
|
|
7941
8242
|
}
|
|
@@ -7963,5 +8264,5 @@ export {
|
|
|
7963
8264
|
withPendingTask
|
|
7964
8265
|
};
|
|
7965
8266
|
|
|
7966
|
-
//# debugId=
|
|
8267
|
+
//# debugId=5A89E04D00718BF264756E2164756E21
|
|
7967
8268
|
//# sourceMappingURL=server.js.map
|