@absolutejs/absolute 0.19.0-beta.707 → 0.19.0-beta.709
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/dist/angular/browser.js +26 -32
- package/dist/angular/browser.js.map +5 -4
- package/dist/angular/components/constants.js +6 -0
- package/dist/angular/index.js +117 -29
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +117 -29
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +264 -152
- package/dist/build.js.map +12 -12
- package/dist/cli/index.js +44 -25
- package/dist/client/index.js +105 -28
- package/dist/client/index.js.map +4 -4
- package/dist/core/streamingSlotRegistrar.js +1 -19
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +1 -19
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/dev/client/cssUtils.ts +6 -2
- package/dist/dev/client/handlers/angular.ts +41 -35
- package/dist/dev/client/handlers/angularRuntime.ts +8 -3
- package/dist/dev/client/hmrClient.ts +1 -1
- package/dist/dev/client/reactRefreshSetup.ts +0 -1
- package/dist/image-client/imageClient.js +16 -4
- package/dist/index.js +298 -170
- package/dist/index.js.map +15 -15
- package/dist/islands/browser.js +1 -19
- package/dist/islands/browser.js.map +2 -2
- package/dist/islands/index.js +107 -20
- package/dist/islands/index.js.map +4 -4
- package/dist/react/browser.js +1 -19
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/browser/index.js +16 -4
- package/dist/react/components/index.js +24 -31
- package/dist/react/components/index.js.map +5 -4
- package/dist/react/hooks/index.js +1 -19
- package/dist/react/hooks/index.js.map +2 -2
- package/dist/react/index.js +117 -29
- package/dist/react/index.js.map +5 -5
- package/dist/react/jsxDevRuntimeCompat.js +1 -19
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/server.js +23 -29
- package/dist/react/server.js.map +4 -4
- package/dist/src/angular/components/constants.d.ts +4 -0
- package/dist/src/client/streamSwap.d.ts +0 -10
- package/dist/src/constants.d.ts +4 -0
- package/dist/src/dev/rebuildTrigger.d.ts +1 -1
- package/dist/src/svelte/renderToPipeableStream.d.ts +2 -2
- package/dist/src/svelte/renderToReadableStream.d.ts +2 -2
- package/dist/src/svelte/renderToString.d.ts +2 -2
- package/dist/src/vue/components/Image.d.ts +3 -3
- package/dist/svelte/browser.js +1 -19
- package/dist/svelte/browser.js.map +2 -2
- package/dist/svelte/index.js +119 -30
- package/dist/svelte/index.js.map +6 -6
- package/dist/svelte/server.js +25 -30
- package/dist/svelte/server.js.map +5 -5
- package/dist/types/globals.d.ts +10 -2
- package/dist/vue/browser.js +1 -19
- package/dist/vue/browser.js.map +2 -2
- package/dist/vue/components/Image.js +24 -31
- package/dist/vue/components/Image.js.map +5 -4
- package/dist/vue/components/index.js +24 -31
- package/dist/vue/components/index.js.map +5 -4
- package/dist/vue/index.js +121 -41
- package/dist/vue/index.js.map +6 -6
- package/dist/vue/server.js +23 -29
- package/dist/vue/server.js.map +4 -4
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -3,7 +3,6 @@ var __create = Object.create;
|
|
|
3
3
|
var __getProtoOf = Object.getPrototypeOf;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
7
|
function __accessProp(key) {
|
|
9
8
|
return this[key];
|
|
@@ -30,23 +29,6 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
30
29
|
cache.set(mod, to);
|
|
31
30
|
return to;
|
|
32
31
|
};
|
|
33
|
-
var __toCommonJS = (from) => {
|
|
34
|
-
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
35
|
-
if (entry)
|
|
36
|
-
return entry;
|
|
37
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
38
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
-
for (var key of __getOwnPropNames(from))
|
|
40
|
-
if (!__hasOwnProp.call(entry, key))
|
|
41
|
-
__defProp(entry, key, {
|
|
42
|
-
get: __accessProp.bind(from, key),
|
|
43
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
__moduleCache.set(from, entry);
|
|
47
|
-
return entry;
|
|
48
|
-
};
|
|
49
|
-
var __moduleCache;
|
|
50
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
51
33
|
var __returnValue = (v) => v;
|
|
52
34
|
function __exportSetter(name, newValue) {
|
|
@@ -79,8 +61,19 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
|
79
61
|
var __require = import.meta.require;
|
|
80
62
|
|
|
81
63
|
// src/constants.ts
|
|
82
|
-
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", BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, 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, 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, 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;
|
|
64
|
+
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", BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, 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, 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, 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;
|
|
83
65
|
var init_constants = __esm(() => {
|
|
66
|
+
IMAGE_DEFAULT_DEVICE_SIZES = [
|
|
67
|
+
640,
|
|
68
|
+
750,
|
|
69
|
+
828,
|
|
70
|
+
1080,
|
|
71
|
+
1200,
|
|
72
|
+
1920,
|
|
73
|
+
2048,
|
|
74
|
+
3840
|
|
75
|
+
];
|
|
76
|
+
IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
84
77
|
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
85
78
|
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
86
79
|
TWO_THIRDS = 2 / 3;
|
|
@@ -1037,14 +1030,15 @@ var init_htmlScriptHMRPlugin = __esm(() => {
|
|
|
1037
1030
|
|
|
1038
1031
|
// src/client/streamSwap.ts
|
|
1039
1032
|
var streamSwapRuntime = () => {
|
|
1033
|
+
const absoluteWindow = window;
|
|
1040
1034
|
const SLOT_PATCH_EVENT = "absolutejs:slot-patch";
|
|
1041
|
-
if (
|
|
1035
|
+
if (absoluteWindow.__ABS_SLOT_RUNTIME__ === true)
|
|
1042
1036
|
return;
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
const consumers =
|
|
1047
|
-
const pending =
|
|
1037
|
+
absoluteWindow.__ABS_SLOT_RUNTIME__ = true;
|
|
1038
|
+
absoluteWindow.__ABS_SLOT_CONSUMERS__ = absoluteWindow.__ABS_SLOT_CONSUMERS__ ?? {};
|
|
1039
|
+
absoluteWindow.__ABS_SLOT_PENDING__ = absoluteWindow.__ABS_SLOT_PENDING__ ?? {};
|
|
1040
|
+
const consumers = absoluteWindow.__ABS_SLOT_CONSUMERS__;
|
|
1041
|
+
const pending = absoluteWindow.__ABS_SLOT_PENDING__;
|
|
1048
1042
|
const isObjectRecord = (value) => Boolean(value) && typeof value === "object";
|
|
1049
1043
|
const isPatchedPendingEntry = (value) => {
|
|
1050
1044
|
if (!isObjectRecord(value))
|
|
@@ -1052,7 +1046,7 @@ var streamSwapRuntime = () => {
|
|
|
1052
1046
|
return value.domPatched === true && "payload" in value;
|
|
1053
1047
|
};
|
|
1054
1048
|
const unwrapPendingPayload = (value) => isPatchedPendingEntry(value) ? value.payload : value;
|
|
1055
|
-
const canApplyImmediately = () =>
|
|
1049
|
+
const canApplyImmediately = () => absoluteWindow.__ABS_SLOT_HYDRATION_PENDING__ !== true;
|
|
1056
1050
|
const isAngularDeferPayload = (payload) => {
|
|
1057
1051
|
if (!isObjectRecord(payload))
|
|
1058
1052
|
return false;
|
|
@@ -1122,8 +1116,8 @@ var streamSwapRuntime = () => {
|
|
|
1122
1116
|
apply(id, pending[id] ?? "");
|
|
1123
1117
|
}
|
|
1124
1118
|
};
|
|
1125
|
-
|
|
1126
|
-
|
|
1119
|
+
absoluteWindow.__ABS_SLOT_FLUSH__ = flush;
|
|
1120
|
+
absoluteWindow.__ABS_SLOT_ENQUEUE__ = (id, payload) => {
|
|
1127
1121
|
apply(id, payload);
|
|
1128
1122
|
};
|
|
1129
1123
|
if (typeof MutationObserver === "function") {
|
|
@@ -1789,12 +1783,91 @@ var ensureHead = (doc) => {
|
|
|
1789
1783
|
}
|
|
1790
1784
|
const head = doc.createElement("head");
|
|
1791
1785
|
doc.documentElement.insertBefore(head, doc.documentElement.firstChild);
|
|
1786
|
+
}, SSR_LAYOUT_RECT, layoutPatchApplied = false, collectPrototypeChain = (instance) => {
|
|
1787
|
+
const protos = [];
|
|
1788
|
+
let current = instance ? Object.getPrototypeOf(instance) : null;
|
|
1789
|
+
while (current && current !== Object.prototype) {
|
|
1790
|
+
protos.push(current);
|
|
1791
|
+
current = Object.getPrototypeOf(current);
|
|
1792
|
+
}
|
|
1793
|
+
return protos;
|
|
1794
|
+
}, patchElementLayout = (doc) => {
|
|
1795
|
+
if (layoutPatchApplied || !doc) {
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
let element;
|
|
1799
|
+
try {
|
|
1800
|
+
element = doc.createElement("div");
|
|
1801
|
+
} catch {
|
|
1802
|
+
return;
|
|
1803
|
+
}
|
|
1804
|
+
const protos = collectPrototypeChain(element);
|
|
1805
|
+
if (protos.length === 0)
|
|
1806
|
+
return;
|
|
1807
|
+
const copyLayoutRect = (rect) => ({ ...rect });
|
|
1808
|
+
const createLayoutRect = () => copyLayoutRect(SSR_LAYOUT_RECT);
|
|
1809
|
+
const getClientRects = () => [];
|
|
1810
|
+
const noop = () => {
|
|
1811
|
+
return;
|
|
1812
|
+
};
|
|
1813
|
+
const numericProps = [
|
|
1814
|
+
"clientWidth",
|
|
1815
|
+
"clientHeight",
|
|
1816
|
+
"clientLeft",
|
|
1817
|
+
"clientTop",
|
|
1818
|
+
"offsetWidth",
|
|
1819
|
+
"offsetHeight",
|
|
1820
|
+
"offsetLeft",
|
|
1821
|
+
"offsetTop",
|
|
1822
|
+
"scrollWidth",
|
|
1823
|
+
"scrollHeight",
|
|
1824
|
+
"scrollLeft",
|
|
1825
|
+
"scrollTop"
|
|
1826
|
+
];
|
|
1827
|
+
for (const proto of protos) {
|
|
1828
|
+
const define = (name, value) => {
|
|
1829
|
+
const descriptor = Object.getOwnPropertyDescriptor(proto, name);
|
|
1830
|
+
if (typeof descriptor?.value === "function")
|
|
1831
|
+
return;
|
|
1832
|
+
Object.defineProperty(proto, name, {
|
|
1833
|
+
configurable: true,
|
|
1834
|
+
value,
|
|
1835
|
+
writable: true
|
|
1836
|
+
});
|
|
1837
|
+
};
|
|
1838
|
+
define("getBoundingClientRect", createLayoutRect);
|
|
1839
|
+
define("getClientRects", getClientRects);
|
|
1840
|
+
define("scrollTo", noop);
|
|
1841
|
+
define("scrollBy", noop);
|
|
1842
|
+
define("scrollIntoView", noop);
|
|
1843
|
+
define("focus", noop);
|
|
1844
|
+
define("blur", noop);
|
|
1845
|
+
for (const prop of numericProps) {
|
|
1846
|
+
const desc = Object.getOwnPropertyDescriptor(proto, prop);
|
|
1847
|
+
if (desc)
|
|
1848
|
+
continue;
|
|
1849
|
+
Object.defineProperty(proto, prop, {
|
|
1850
|
+
configurable: true,
|
|
1851
|
+
get: () => 0
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
layoutPatchApplied = true;
|
|
1792
1856
|
}, applyPatches = async () => {
|
|
1793
1857
|
const { \u{275}DominoAdapter } = await import(resolveAngularPackage("@angular/platform-server"));
|
|
1794
1858
|
if (!\u{275}DominoAdapter?.prototype) {
|
|
1795
1859
|
console.warn("[Angular Patch] \u0275DominoAdapter not found, skipping patches");
|
|
1796
1860
|
return false;
|
|
1797
1861
|
}
|
|
1862
|
+
try {
|
|
1863
|
+
const adapter = new \u{275}DominoAdapter;
|
|
1864
|
+
const seedDoc = typeof adapter.createHtmlDocument === "function" ? adapter.createHtmlDocument() : typeof adapter.getDefaultDocument === "function" ? adapter.getDefaultDocument() : null;
|
|
1865
|
+
if (seedDoc) {
|
|
1866
|
+
patchElementLayout(seedDoc);
|
|
1867
|
+
}
|
|
1868
|
+
} catch (error) {
|
|
1869
|
+
console.warn("[Angular Patch] Could not eagerly patch Element prototypes:", error);
|
|
1870
|
+
}
|
|
1798
1871
|
const proto = \u{275}DominoAdapter.prototype;
|
|
1799
1872
|
const origGetBaseHref = proto.getBaseHref;
|
|
1800
1873
|
proto.getBaseHref = function(doc) {
|
|
@@ -1807,18 +1880,33 @@ var ensureHead = (doc) => {
|
|
|
1807
1880
|
proto.createHtmlDocument = function() {
|
|
1808
1881
|
const doc = origCreateHtmlDocument.call(this);
|
|
1809
1882
|
ensureHead(doc);
|
|
1883
|
+
patchElementLayout(doc);
|
|
1810
1884
|
return doc;
|
|
1811
1885
|
};
|
|
1812
1886
|
const origGetDefaultDocument = proto.getDefaultDocument;
|
|
1813
1887
|
proto.getDefaultDocument = function() {
|
|
1814
1888
|
const doc = origGetDefaultDocument.call(this);
|
|
1815
1889
|
ensureHead(doc);
|
|
1890
|
+
patchElementLayout(doc);
|
|
1816
1891
|
return doc;
|
|
1817
1892
|
};
|
|
1818
1893
|
return true;
|
|
1819
1894
|
};
|
|
1820
1895
|
var init_angularPatch = __esm(() => {
|
|
1821
1896
|
init_resolveAngularPackage();
|
|
1897
|
+
SSR_LAYOUT_RECT = Object.freeze({
|
|
1898
|
+
bottom: 0,
|
|
1899
|
+
height: 0,
|
|
1900
|
+
left: 0,
|
|
1901
|
+
right: 0,
|
|
1902
|
+
top: 0,
|
|
1903
|
+
width: 0,
|
|
1904
|
+
x: 0,
|
|
1905
|
+
y: 0,
|
|
1906
|
+
toJSON() {
|
|
1907
|
+
return this;
|
|
1908
|
+
}
|
|
1909
|
+
});
|
|
1822
1910
|
});
|
|
1823
1911
|
|
|
1824
1912
|
// src/angular/angularDeps.ts
|
|
@@ -22548,7 +22636,7 @@ function isPotentialCssRootFile(id) {
|
|
|
22548
22636
|
function idToPath(id) {
|
|
22549
22637
|
return path.resolve(id.replace(/\?.*$/, ""));
|
|
22550
22638
|
}
|
|
22551
|
-
var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind", __filename = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind/index.mjs", __create2, __defProp2,
|
|
22639
|
+
var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind", __filename = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind/index.mjs", __create2, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name), __typeError = (msg) => {
|
|
22552
22640
|
throw TypeError(msg);
|
|
22553
22641
|
}, __require2, __esm2 = (fn, res) => function __init() {
|
|
22554
22642
|
return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
|
|
@@ -22561,10 +22649,10 @@ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind"
|
|
|
22561
22649
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
22562
22650
|
for (let key of __getOwnPropNames2(from))
|
|
22563
22651
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
22564
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc =
|
|
22652
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22565
22653
|
}
|
|
22566
22654
|
return to;
|
|
22567
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)),
|
|
22655
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), __toCommonJS = (mod) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod), __using = (stack, value2, async) => {
|
|
22568
22656
|
if (value2 != null) {
|
|
22569
22657
|
if (typeof value2 !== "object" && typeof value2 !== "function")
|
|
22570
22658
|
__typeError("Object expected");
|
|
@@ -23151,7 +23239,7 @@ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind"
|
|
|
23151
23239
|
var init_bun_plugin_tailwind = __esm(() => {
|
|
23152
23240
|
__create2 = Object.create;
|
|
23153
23241
|
__defProp2 = Object.defineProperty;
|
|
23154
|
-
|
|
23242
|
+
__getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
23155
23243
|
__getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
23156
23244
|
__getProtoOf2 = Object.getPrototypeOf;
|
|
23157
23245
|
__hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
@@ -38072,9 +38160,9 @@ It schedules the call as a new task in the event loop.`);
|
|
|
38072
38160
|
});
|
|
38073
38161
|
require_runtime = __commonJS2({
|
|
38074
38162
|
"../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.5/node_modules/@napi-rs/wasm-runtime/runtime.cjs"(exports, module) {
|
|
38075
|
-
var { MessageHandler: MessageHandler2, instantiateNapiModuleSync: instantiateNapiModuleSync2, instantiateNapiModule: instantiateNapiModule2 } = (init_emnapi_core_esm_bundler(),
|
|
38076
|
-
var { getDefaultContext: getDefaultContext2 } = (init_emnapi_esm_bundler(),
|
|
38077
|
-
var { WASI: WASI2 } = (init_wasm_util_esm_bundler(),
|
|
38163
|
+
var { MessageHandler: MessageHandler2, instantiateNapiModuleSync: instantiateNapiModuleSync2, instantiateNapiModule: instantiateNapiModule2 } = (init_emnapi_core_esm_bundler(), __toCommonJS(emnapi_core_esm_bundler_exports));
|
|
38164
|
+
var { getDefaultContext: getDefaultContext2 } = (init_emnapi_esm_bundler(), __toCommonJS(emnapi_esm_bundler_exports));
|
|
38165
|
+
var { WASI: WASI2 } = (init_wasm_util_esm_bundler(), __toCommonJS(wasm_util_esm_bundler_exports));
|
|
38078
38166
|
var { createFsProxy, createOnMessage } = require_fs_proxy();
|
|
38079
38167
|
module.exports = {
|
|
38080
38168
|
MessageHandler: MessageHandler2,
|
|
@@ -41276,7 +41364,7 @@ var init_compileTailwind = __esm(() => {
|
|
|
41276
41364
|
// src/utils/imageProcessing.ts
|
|
41277
41365
|
import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
41278
41366
|
import { join as join8, resolve as resolve8 } from "path";
|
|
41279
|
-
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY
|
|
41367
|
+
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
41280
41368
|
for (const size of sizes) {
|
|
41281
41369
|
if (size >= target)
|
|
41282
41370
|
return size;
|
|
@@ -41292,7 +41380,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
41292
41380
|
return false;
|
|
41293
41381
|
}, matchPathname = (actual, pattern) => {
|
|
41294
41382
|
if (pattern.endsWith("/**")) {
|
|
41295
|
-
const prefix = pattern.slice(0, -
|
|
41383
|
+
const prefix = pattern.slice(0, -IMAGE_GLOB_SUFFIX_LENGTH);
|
|
41296
41384
|
return actual.startsWith(prefix);
|
|
41297
41385
|
}
|
|
41298
41386
|
return actual === pattern;
|
|
@@ -41421,17 +41509,10 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
41421
41509
|
writeFileSync4(metaPath, JSON.stringify(meta));
|
|
41422
41510
|
};
|
|
41423
41511
|
var init_imageProcessing = __esm(() => {
|
|
41424
|
-
|
|
41425
|
-
|
|
41426
|
-
|
|
41427
|
-
|
|
41428
|
-
1080,
|
|
41429
|
-
1200,
|
|
41430
|
-
1920,
|
|
41431
|
-
2048,
|
|
41432
|
-
3840
|
|
41433
|
-
];
|
|
41434
|
-
DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
41512
|
+
init_constants();
|
|
41513
|
+
DEFAULT_DEVICE_SIZES = IMAGE_DEFAULT_DEVICE_SIZES;
|
|
41514
|
+
DEFAULT_IMAGE_SIZES = IMAGE_DEFAULT_IMAGE_SIZES;
|
|
41515
|
+
DEFAULT_QUALITY = IMAGE_DEFAULT_QUALITY;
|
|
41435
41516
|
MIME_MAP = {
|
|
41436
41517
|
avif: "image/avif",
|
|
41437
41518
|
jpeg: "image/jpeg",
|
|
@@ -41471,7 +41552,7 @@ var IMG_REGEX, getAttr = (attrs, name) => {
|
|
|
41471
41552
|
const w2x = snapUp(width * 2, allSizes);
|
|
41472
41553
|
srcset = `${buildOptimizedUrl(src, w1x, quality, basePath)} 1x, ${buildOptimizedUrl(src, w2x, quality, basePath)} 2x`;
|
|
41473
41554
|
} else {
|
|
41474
|
-
const deviceSizes = config?.deviceSizes ??
|
|
41555
|
+
const deviceSizes = config?.deviceSizes ?? IMAGE_DEFAULT_DEVICE_SIZES;
|
|
41475
41556
|
srcset = deviceSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality, basePath)} ${sizeWidth}w`).join(", ");
|
|
41476
41557
|
}
|
|
41477
41558
|
let cleanAttrs = removeAttr(attrs, "data-optimized");
|
|
@@ -41504,6 +41585,7 @@ var IMG_REGEX, getAttr = (attrs, name) => {
|
|
|
41504
41585
|
var init_optimizeHtmlImages = __esm(() => {
|
|
41505
41586
|
init_imageProcessing();
|
|
41506
41587
|
init_scanEntryPoints();
|
|
41588
|
+
init_constants();
|
|
41507
41589
|
IMG_REGEX = /<img\s+([^>]*?)data-optimized([^>]*?)\/?>/gi;
|
|
41508
41590
|
});
|
|
41509
41591
|
|
|
@@ -42097,7 +42179,8 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
|
|
|
42097
42179
|
} = {}) => {
|
|
42098
42180
|
try {
|
|
42099
42181
|
const { render } = await import("svelte/server");
|
|
42100
|
-
const
|
|
42182
|
+
const renderComponent = render;
|
|
42183
|
+
const rendered = typeof props === "undefined" ? await renderComponent(component) : await renderComponent(component, { props });
|
|
42101
42184
|
const { head, body } = rendered;
|
|
42102
42185
|
const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
|
|
42103
42186
|
const scripts = (bootstrapScriptContent ? `<script${nonceAttr}>${escapeScriptContent(bootstrapScriptContent)}</script>` : "") + bootstrapScripts.map((src) => `<script${nonceAttr} src="${src}"></script>`).join("") + bootstrapModules.map((src) => `<script${nonceAttr} type="module" src="${src}"></script>`).join("");
|
|
@@ -46476,6 +46559,68 @@ var init_fileHashTracker = __esm(() => {
|
|
|
46476
46559
|
init_constants();
|
|
46477
46560
|
});
|
|
46478
46561
|
|
|
46562
|
+
// src/dev/transformCache.ts
|
|
46563
|
+
var exports_transformCache = {};
|
|
46564
|
+
__export(exports_transformCache, {
|
|
46565
|
+
setTransformed: () => setTransformed,
|
|
46566
|
+
invalidateAll: () => invalidateAll,
|
|
46567
|
+
invalidate: () => invalidate,
|
|
46568
|
+
getTransformed: () => getTransformed,
|
|
46569
|
+
getInvalidationVersion: () => getInvalidationVersion,
|
|
46570
|
+
findNearestComponent: () => findNearestComponent
|
|
46571
|
+
});
|
|
46572
|
+
var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.content, setTransformed = (filePath, content, mtime, imports) => {
|
|
46573
|
+
const resolvedImports = imports ?? [];
|
|
46574
|
+
cache.set(filePath, { content, imports: resolvedImports, mtime });
|
|
46575
|
+
for (const imp of resolvedImports) {
|
|
46576
|
+
const set2 = importers.get(imp) ?? new Set;
|
|
46577
|
+
importers.set(imp, set2);
|
|
46578
|
+
set2.add(filePath);
|
|
46579
|
+
}
|
|
46580
|
+
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
46581
|
+
const component = [...parents].find(isComponentFile);
|
|
46582
|
+
if (component !== undefined)
|
|
46583
|
+
return component;
|
|
46584
|
+
for (const parent of parents)
|
|
46585
|
+
queue.push(parent);
|
|
46586
|
+
return;
|
|
46587
|
+
}, findNearestComponent = (filePath) => {
|
|
46588
|
+
const visited = new Set;
|
|
46589
|
+
const queue = [filePath];
|
|
46590
|
+
while (queue.length > 0) {
|
|
46591
|
+
const current = queue.shift();
|
|
46592
|
+
if (!current)
|
|
46593
|
+
break;
|
|
46594
|
+
if (visited.has(current))
|
|
46595
|
+
continue;
|
|
46596
|
+
visited.add(current);
|
|
46597
|
+
const parents = importers.get(current);
|
|
46598
|
+
if (!parents)
|
|
46599
|
+
continue;
|
|
46600
|
+
const found = processParents(parents, queue);
|
|
46601
|
+
if (found !== undefined)
|
|
46602
|
+
return found;
|
|
46603
|
+
}
|
|
46604
|
+
return;
|
|
46605
|
+
}, getInvalidationVersion = (filePath) => invalidationVersions.get(filePath) ?? 0, invalidate = (filePath) => {
|
|
46606
|
+
cache.delete(filePath);
|
|
46607
|
+
invalidationVersions.set(filePath, (invalidationVersions.get(filePath) ?? 0) + 1);
|
|
46608
|
+
for (const parent of importers.get(filePath) ?? []) {
|
|
46609
|
+
cache.delete(parent);
|
|
46610
|
+
}
|
|
46611
|
+
}, invalidateAll = () => {
|
|
46612
|
+
cache.clear();
|
|
46613
|
+
importers.clear();
|
|
46614
|
+
};
|
|
46615
|
+
var init_transformCache = __esm(() => {
|
|
46616
|
+
cache = globalThis.__transformCache ?? new Map;
|
|
46617
|
+
globalThis.__transformCache = cache;
|
|
46618
|
+
importers = globalThis.__transformImporters ?? new Map;
|
|
46619
|
+
globalThis.__transformImporters = importers;
|
|
46620
|
+
invalidationVersions = globalThis.__transformInvalidationVersions ?? new Map;
|
|
46621
|
+
globalThis.__transformInvalidationVersions = invalidationVersions;
|
|
46622
|
+
});
|
|
46623
|
+
|
|
46479
46624
|
// src/dev/reactComponentClassifier.ts
|
|
46480
46625
|
import { resolve as resolve26 } from "path";
|
|
46481
46626
|
var classifyComponent = (filePath) => {
|
|
@@ -46719,68 +46864,6 @@ var init_ssrCache = __esm(() => {
|
|
|
46719
46864
|
dirtyFrameworks = new Set;
|
|
46720
46865
|
});
|
|
46721
46866
|
|
|
46722
|
-
// src/dev/transformCache.ts
|
|
46723
|
-
var exports_transformCache = {};
|
|
46724
|
-
__export(exports_transformCache, {
|
|
46725
|
-
setTransformed: () => setTransformed,
|
|
46726
|
-
invalidateAll: () => invalidateAll,
|
|
46727
|
-
invalidate: () => invalidate,
|
|
46728
|
-
getTransformed: () => getTransformed,
|
|
46729
|
-
getInvalidationVersion: () => getInvalidationVersion,
|
|
46730
|
-
findNearestComponent: () => findNearestComponent
|
|
46731
|
-
});
|
|
46732
|
-
var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.content, setTransformed = (filePath, content, mtime, imports) => {
|
|
46733
|
-
const resolvedImports = imports ?? [];
|
|
46734
|
-
cache.set(filePath, { content, imports: resolvedImports, mtime });
|
|
46735
|
-
for (const imp of resolvedImports) {
|
|
46736
|
-
const set2 = importers.get(imp) ?? new Set;
|
|
46737
|
-
importers.set(imp, set2);
|
|
46738
|
-
set2.add(filePath);
|
|
46739
|
-
}
|
|
46740
|
-
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
46741
|
-
const component = [...parents].find(isComponentFile);
|
|
46742
|
-
if (component !== undefined)
|
|
46743
|
-
return component;
|
|
46744
|
-
for (const parent of parents)
|
|
46745
|
-
queue.push(parent);
|
|
46746
|
-
return;
|
|
46747
|
-
}, findNearestComponent = (filePath) => {
|
|
46748
|
-
const visited = new Set;
|
|
46749
|
-
const queue = [filePath];
|
|
46750
|
-
while (queue.length > 0) {
|
|
46751
|
-
const current = queue.shift();
|
|
46752
|
-
if (!current)
|
|
46753
|
-
break;
|
|
46754
|
-
if (visited.has(current))
|
|
46755
|
-
continue;
|
|
46756
|
-
visited.add(current);
|
|
46757
|
-
const parents = importers.get(current);
|
|
46758
|
-
if (!parents)
|
|
46759
|
-
continue;
|
|
46760
|
-
const found = processParents(parents, queue);
|
|
46761
|
-
if (found !== undefined)
|
|
46762
|
-
return found;
|
|
46763
|
-
}
|
|
46764
|
-
return;
|
|
46765
|
-
}, getInvalidationVersion = (filePath) => invalidationVersions.get(filePath) ?? 0, invalidate = (filePath) => {
|
|
46766
|
-
cache.delete(filePath);
|
|
46767
|
-
invalidationVersions.set(filePath, (invalidationVersions.get(filePath) ?? 0) + 1);
|
|
46768
|
-
for (const parent of importers.get(filePath) ?? []) {
|
|
46769
|
-
cache.delete(parent);
|
|
46770
|
-
}
|
|
46771
|
-
}, invalidateAll = () => {
|
|
46772
|
-
cache.clear();
|
|
46773
|
-
importers.clear();
|
|
46774
|
-
};
|
|
46775
|
-
var init_transformCache = __esm(() => {
|
|
46776
|
-
cache = globalThis.__transformCache ?? new Map;
|
|
46777
|
-
globalThis.__transformCache = cache;
|
|
46778
|
-
importers = globalThis.__transformImporters ?? new Map;
|
|
46779
|
-
globalThis.__transformImporters = importers;
|
|
46780
|
-
invalidationVersions = globalThis.__transformInvalidationVersions ?? new Map;
|
|
46781
|
-
globalThis.__transformInvalidationVersions = invalidationVersions;
|
|
46782
|
-
});
|
|
46783
|
-
|
|
46784
46867
|
// src/dev/moduleServer.ts
|
|
46785
46868
|
var exports_moduleServer = {};
|
|
46786
46869
|
__export(exports_moduleServer, {
|
|
@@ -47038,7 +47121,15 @@ ${code}`;
|
|
|
47038
47121
|
const endPos = findFunctionEnd(source, insertPos);
|
|
47039
47122
|
const funcBody = source.slice(insertPos, endPos);
|
|
47040
47123
|
return `${source.slice(0, insertPos)}__hmr_wrap(${JSON.stringify(name)}, ${funcBody})${source.slice(endPos)}`;
|
|
47041
|
-
}, svelteExternalCss, svelteCompiler = null, vueCompiler = null,
|
|
47124
|
+
}, svelteExternalCss, svelteCompiler = null, vueCompiler = null, getLoadedSvelteCompiler = () => {
|
|
47125
|
+
if (!svelteCompiler)
|
|
47126
|
+
throw new Error("Svelte compiler is not loaded.");
|
|
47127
|
+
return svelteCompiler;
|
|
47128
|
+
}, getLoadedVueCompiler = () => {
|
|
47129
|
+
if (!vueCompiler)
|
|
47130
|
+
throw new Error("Vue compiler is not loaded.");
|
|
47131
|
+
return vueCompiler;
|
|
47132
|
+
}, warmCompilers = async (frameworks2) => {
|
|
47042
47133
|
const [svelteModule, vueModule] = await Promise.all([
|
|
47043
47134
|
frameworks2.svelte ? import("svelte/compiler") : undefined,
|
|
47044
47135
|
frameworks2.vue ? import("@vue/compiler-sfc") : undefined
|
|
@@ -47066,13 +47157,15 @@ ${code}`;
|
|
|
47066
47157
|
source: descriptor.template.content
|
|
47067
47158
|
});
|
|
47068
47159
|
}, compileSvelteModule = (raw, filePath) => {
|
|
47160
|
+
const compiler = getLoadedSvelteCompiler();
|
|
47069
47161
|
const source = tsTranspiler2.transformSync(raw);
|
|
47070
|
-
return
|
|
47162
|
+
return compiler.compileModule(source, {
|
|
47071
47163
|
dev: true,
|
|
47072
47164
|
filename: filePath
|
|
47073
47165
|
}).js.code;
|
|
47074
47166
|
}, compileSvelteComponent = (raw, filePath, projectRoot, enableAsync = false) => {
|
|
47075
|
-
const
|
|
47167
|
+
const compiler = getLoadedSvelteCompiler();
|
|
47168
|
+
const compiled = compiler.compile(raw, {
|
|
47076
47169
|
css: "external",
|
|
47077
47170
|
dev: true,
|
|
47078
47171
|
experimental: {
|
|
@@ -47108,11 +47201,12 @@ ${code}`;
|
|
|
47108
47201
|
const code = isModule ? compileSvelteModule(source, filePath) : compileSvelteComponent(source, filePath, projectRoot, enableAsync);
|
|
47109
47202
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
47110
47203
|
}, compileVueTemplate = (descriptor, compiledScript, filePath, componentId) => {
|
|
47204
|
+
const compiler = getLoadedVueCompiler();
|
|
47111
47205
|
const scriptContent = compiledScript.content;
|
|
47112
47206
|
if (!descriptor.template)
|
|
47113
47207
|
return scriptContent;
|
|
47114
47208
|
const isScoped = descriptor.styles.some((style) => style.scoped);
|
|
47115
|
-
const templateResult =
|
|
47209
|
+
const templateResult = compiler.compileTemplate({
|
|
47116
47210
|
compilerOptions: {
|
|
47117
47211
|
bindingMetadata: compiledScript.bindings,
|
|
47118
47212
|
prefixIdentifiers: true
|
|
@@ -47133,10 +47227,11 @@ export default __script__;`;
|
|
|
47133
47227
|
}, compileVueStyles = async (descriptor, filePath, componentId, code, stylePreprocessors) => {
|
|
47134
47228
|
if (descriptor.styles.length === 0)
|
|
47135
47229
|
return code;
|
|
47136
|
-
const
|
|
47230
|
+
const compiler = getLoadedVueCompiler();
|
|
47231
|
+
const cssCode = (await Promise.all(descriptor.styles.map(async (style) => compiler.compileStyle({
|
|
47137
47232
|
filename: filePath,
|
|
47138
47233
|
id: `data-v-${componentId}`,
|
|
47139
|
-
scoped: style.scoped,
|
|
47234
|
+
scoped: Boolean(style.scoped),
|
|
47140
47235
|
source: style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content,
|
|
47141
47236
|
trim: true
|
|
47142
47237
|
}).code))).join(`
|
|
@@ -47165,7 +47260,11 @@ ${code}`;
|
|
|
47165
47260
|
id: componentId,
|
|
47166
47261
|
inlineTemplate: false
|
|
47167
47262
|
});
|
|
47168
|
-
|
|
47263
|
+
const compiledSfcScript = {
|
|
47264
|
+
bindings: compiledScript.bindings ?? {},
|
|
47265
|
+
content: compiledScript.content
|
|
47266
|
+
};
|
|
47267
|
+
let code = compileVueTemplate(descriptor, compiledSfcScript, filePath, componentId);
|
|
47169
47268
|
code = await compileVueStyles(descriptor, filePath, componentId, code, stylePreprocessors);
|
|
47170
47269
|
code = tsTranspiler2.transformSync(code);
|
|
47171
47270
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
@@ -47543,7 +47642,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
47543
47642
|
// src/dev/rebuildTrigger.ts
|
|
47544
47643
|
import { existsSync as existsSync22 } from "fs";
|
|
47545
47644
|
import { basename as basename10, dirname as dirname14, relative as relative12, resolve as resolve31 } from "path";
|
|
47546
|
-
var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), parseErrorLocationFromMessage = (msg) => {
|
|
47645
|
+
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), parseErrorLocationFromMessage = (msg) => {
|
|
47547
47646
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
47548
47647
|
if (pathLineCol) {
|
|
47549
47648
|
const [, file3, lineStr, colStr] = pathLineCol;
|
|
@@ -47713,19 +47812,31 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
47713
47812
|
return allFiles;
|
|
47714
47813
|
}, areAllQueuedFilesStable = async (fileChangeQueue) => {
|
|
47715
47814
|
const allFiles = collectAllQueuedFiles(fileChangeQueue);
|
|
47716
|
-
|
|
47815
|
+
const checkFile = async (files) => {
|
|
47816
|
+
const [file3, ...remaining] = files;
|
|
47817
|
+
if (!file3) {
|
|
47818
|
+
return true;
|
|
47819
|
+
}
|
|
47717
47820
|
const stable = await isFileStable(file3);
|
|
47718
|
-
if (!stable)
|
|
47821
|
+
if (!stable) {
|
|
47719
47822
|
return false;
|
|
47720
|
-
|
|
47721
|
-
|
|
47823
|
+
}
|
|
47824
|
+
return checkFile(remaining);
|
|
47825
|
+
};
|
|
47826
|
+
return checkFile(allFiles);
|
|
47722
47827
|
}, waitForStableWrites = async (state) => {
|
|
47723
|
-
|
|
47828
|
+
const waitRound = async (round) => {
|
|
47829
|
+
if (round >= STABILITY_CHECK_ROUNDS) {
|
|
47830
|
+
return;
|
|
47831
|
+
}
|
|
47724
47832
|
const stable = await areAllQueuedFilesStable(state.fileChangeQueue);
|
|
47725
|
-
if (stable)
|
|
47726
|
-
|
|
47727
|
-
|
|
47728
|
-
|
|
47833
|
+
if (stable) {
|
|
47834
|
+
return;
|
|
47835
|
+
}
|
|
47836
|
+
await waitRound(round + 1);
|
|
47837
|
+
};
|
|
47838
|
+
await waitRound(0);
|
|
47839
|
+
}, queueFileChange = async (state, filePath, config, onRebuildComplete) => {
|
|
47729
47840
|
const framework = detectFramework(filePath, state.resolvedPaths);
|
|
47730
47841
|
if (framework === "ignored") {
|
|
47731
47842
|
return;
|
|
@@ -47735,8 +47846,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
47735
47846
|
return;
|
|
47736
47847
|
}
|
|
47737
47848
|
if (framework === "unknown") {
|
|
47738
|
-
|
|
47739
|
-
invalidate2(resolve31(filePath));
|
|
47849
|
+
invalidate(resolve31(filePath));
|
|
47740
47850
|
const relPath = relative12(process.cwd(), filePath);
|
|
47741
47851
|
logHmrUpdate(relPath);
|
|
47742
47852
|
return;
|
|
@@ -48141,9 +48251,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48141
48251
|
}
|
|
48142
48252
|
markSsrCacheDirty("svelte");
|
|
48143
48253
|
const serverDuration = Date.now() - startTime;
|
|
48144
|
-
|
|
48145
|
-
await broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration);
|
|
48146
|
-
}
|
|
48254
|
+
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
48147
48255
|
onRebuildComplete({
|
|
48148
48256
|
hmrState: state,
|
|
48149
48257
|
manifest: state.manifest
|
|
@@ -48267,9 +48375,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48267
48375
|
await invalidateNonVueModules(nonVueFiles);
|
|
48268
48376
|
const serverDuration = Date.now() - startTime;
|
|
48269
48377
|
const forceReload = nonVueFiles.length > 0;
|
|
48270
|
-
|
|
48271
|
-
await broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration);
|
|
48272
|
-
}
|
|
48378
|
+
await runSequentially(vueFiles, (changedFile) => broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration));
|
|
48273
48379
|
onRebuildComplete({
|
|
48274
48380
|
hmrState: state,
|
|
48275
48381
|
manifest: state.manifest
|
|
@@ -48451,11 +48557,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48451
48557
|
const outputHtmlPages = computeOutputPagesDir(state, config, "html");
|
|
48452
48558
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
48453
48559
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
48454
|
-
|
|
48560
|
+
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
48455
48561
|
const htmlPageName = basename10(pageFile);
|
|
48456
48562
|
const builtHtmlPagePath = resolve31(outputHtmlPages, htmlPageName);
|
|
48457
48563
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
48458
|
-
}
|
|
48564
|
+
});
|
|
48459
48565
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
48460
48566
|
const [cssFile] = vueCssFiles;
|
|
48461
48567
|
if (!cssFile) {
|
|
@@ -48550,9 +48656,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48550
48656
|
if (isCssOnlyChange && vueCssFiles.length > 0) {
|
|
48551
48657
|
handleVueCssOnlyUpdate(state, vueCssFiles, manifest, duration);
|
|
48552
48658
|
}
|
|
48553
|
-
|
|
48554
|
-
await processVuePageUpdate(state, config, vuePagePath, manifest, duration);
|
|
48555
|
-
}
|
|
48659
|
+
await runSequentially(pagesToUpdate, (vuePagePath) => processVuePageUpdate(state, config, vuePagePath, manifest, duration));
|
|
48556
48660
|
}, handleSvelteCssOnlyUpdate = (state, svelteCssFiles, manifest, duration) => {
|
|
48557
48661
|
const [cssFile] = svelteCssFiles;
|
|
48558
48662
|
if (!cssFile) {
|
|
@@ -48753,11 +48857,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48753
48857
|
const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
|
|
48754
48858
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
48755
48859
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
48756
|
-
|
|
48860
|
+
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
48757
48861
|
const htmxPageName = basename10(htmxPageFile);
|
|
48758
48862
|
const builtHtmxPagePath = resolve31(outputHtmxPages, htmxPageName);
|
|
48759
48863
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
48760
|
-
}
|
|
48864
|
+
});
|
|
48761
48865
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
48762
48866
|
const paths = [];
|
|
48763
48867
|
allModuleUpdates.forEach((update) => {
|
|
@@ -48901,11 +49005,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48901
49005
|
const { updateAssetPaths: updateAssetPaths2 } = await Promise.resolve().then(() => (init_updateAssetPaths(), exports_updateAssetPaths));
|
|
48902
49006
|
const handleUpdate = framework === "html" ? (await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR))).handleHTMLUpdate : (await Promise.resolve().then(() => (init_simpleHTMXHMR(), exports_simpleHTMXHMR))).handleHTMXUpdate;
|
|
48903
49007
|
const { readFileSync: readFs, writeFileSync: writeFs } = await import("fs");
|
|
48904
|
-
|
|
49008
|
+
const processMarkupFiles = async (files) => {
|
|
49009
|
+
const [markupFile, ...remaining] = files;
|
|
49010
|
+
if (!markupFile) {
|
|
49011
|
+
return;
|
|
49012
|
+
}
|
|
48905
49013
|
const success = await tryProcessMarkupFile(state, markupFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs);
|
|
48906
|
-
if (!success)
|
|
48907
|
-
|
|
48908
|
-
|
|
49014
|
+
if (!success) {
|
|
49015
|
+
return;
|
|
49016
|
+
}
|
|
49017
|
+
await processMarkupFiles(remaining);
|
|
49018
|
+
};
|
|
49019
|
+
await processMarkupFiles(markupFiles);
|
|
48909
49020
|
}, 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) => {
|
|
48910
49021
|
files.filter((f) => detectFramework(f, resolvedPaths) === framework).forEach((f) => handled.add(f));
|
|
48911
49022
|
}, runFrameworkFastPaths = async (state, config, affectedFrameworks, files, startTime, onRebuildComplete) => {
|
|
@@ -48932,12 +49043,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48932
49043
|
handler: handleVueFastPath
|
|
48933
49044
|
}
|
|
48934
49045
|
];
|
|
48935
|
-
|
|
49046
|
+
await runSequentially(fastPaths, async (fastPath) => {
|
|
48936
49047
|
if (!fastPath.directory || !affectedFrameworks.includes(fastPath.framework))
|
|
48937
|
-
|
|
49048
|
+
return;
|
|
48938
49049
|
await fastPath.handler(state, config, files, startTime, onRebuildComplete);
|
|
48939
49050
|
markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
|
|
48940
|
-
}
|
|
49051
|
+
});
|
|
48941
49052
|
return files.every((f) => handled.has(f));
|
|
48942
49053
|
}, performFullRebuild = async (state, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete) => {
|
|
48943
49054
|
const hasManifest = Object.keys(state.manifest).length > 0;
|
|
@@ -49080,6 +49191,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
49080
49191
|
init_dependencyGraph();
|
|
49081
49192
|
init_constants();
|
|
49082
49193
|
init_fileHashTracker();
|
|
49194
|
+
init_transformCache();
|
|
49083
49195
|
init_moduleMapper();
|
|
49084
49196
|
init_telemetryEvent();
|
|
49085
49197
|
init_assetStore();
|
|
@@ -49585,5 +49697,5 @@ export {
|
|
|
49585
49697
|
build
|
|
49586
49698
|
};
|
|
49587
49699
|
|
|
49588
|
-
//# debugId=
|
|
49700
|
+
//# debugId=7CA9E0309BD0194E64756E2164756E21
|
|
49589
49701
|
//# sourceMappingURL=build.js.map
|