@absolutejs/absolute 0.19.0-beta.707 → 0.19.0-beta.708
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 +1 -19
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/index.js +85 -28
- package/dist/angular/index.js.map +4 -4
- package/dist/angular/server.js +85 -28
- package/dist/angular/server.js.map +4 -4
- package/dist/build.js +224 -137
- package/dist/build.js.map +10 -10
- package/dist/cli/index.js +44 -25
- package/dist/client/index.js +85 -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/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/index.js +254 -155
- package/dist/index.js.map +13 -13
- package/dist/islands/browser.js +1 -19
- package/dist/islands/browser.js.map +2 -2
- package/dist/islands/index.js +75 -19
- package/dist/islands/index.js.map +3 -3
- package/dist/react/browser.js +1 -19
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/index.js +1 -19
- package/dist/react/components/index.js.map +3 -3
- package/dist/react/hooks/index.js +1 -19
- package/dist/react/hooks/index.js.map +2 -2
- package/dist/react/index.js +85 -28
- package/dist/react/index.js.map +4 -4
- package/dist/react/jsxDevRuntimeCompat.js +1 -19
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/server.js +11 -28
- package/dist/react/server.js.map +3 -3
- package/dist/src/client/streamSwap.d.ts +0 -10
- 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 +87 -29
- package/dist/svelte/index.js.map +5 -5
- package/dist/svelte/server.js +13 -29
- package/dist/svelte/server.js.map +4 -4
- 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 +1 -19
- package/dist/vue/components/Image.js.map +3 -3
- package/dist/vue/components/index.js +1 -19
- package/dist/vue/components/index.js.map +3 -3
- package/dist/vue/index.js +85 -28
- package/dist/vue/index.js.map +5 -5
- package/dist/vue/server.js +11 -28
- package/dist/vue/server.js.map +3 -3
- 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) {
|
|
@@ -1037,14 +1019,15 @@ var init_htmlScriptHMRPlugin = __esm(() => {
|
|
|
1037
1019
|
|
|
1038
1020
|
// src/client/streamSwap.ts
|
|
1039
1021
|
var streamSwapRuntime = () => {
|
|
1022
|
+
const absoluteWindow = window;
|
|
1040
1023
|
const SLOT_PATCH_EVENT = "absolutejs:slot-patch";
|
|
1041
|
-
if (
|
|
1024
|
+
if (absoluteWindow.__ABS_SLOT_RUNTIME__ === true)
|
|
1042
1025
|
return;
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
const consumers =
|
|
1047
|
-
const pending =
|
|
1026
|
+
absoluteWindow.__ABS_SLOT_RUNTIME__ = true;
|
|
1027
|
+
absoluteWindow.__ABS_SLOT_CONSUMERS__ = absoluteWindow.__ABS_SLOT_CONSUMERS__ ?? {};
|
|
1028
|
+
absoluteWindow.__ABS_SLOT_PENDING__ = absoluteWindow.__ABS_SLOT_PENDING__ ?? {};
|
|
1029
|
+
const consumers = absoluteWindow.__ABS_SLOT_CONSUMERS__;
|
|
1030
|
+
const pending = absoluteWindow.__ABS_SLOT_PENDING__;
|
|
1048
1031
|
const isObjectRecord = (value) => Boolean(value) && typeof value === "object";
|
|
1049
1032
|
const isPatchedPendingEntry = (value) => {
|
|
1050
1033
|
if (!isObjectRecord(value))
|
|
@@ -1052,7 +1035,7 @@ var streamSwapRuntime = () => {
|
|
|
1052
1035
|
return value.domPatched === true && "payload" in value;
|
|
1053
1036
|
};
|
|
1054
1037
|
const unwrapPendingPayload = (value) => isPatchedPendingEntry(value) ? value.payload : value;
|
|
1055
|
-
const canApplyImmediately = () =>
|
|
1038
|
+
const canApplyImmediately = () => absoluteWindow.__ABS_SLOT_HYDRATION_PENDING__ !== true;
|
|
1056
1039
|
const isAngularDeferPayload = (payload) => {
|
|
1057
1040
|
if (!isObjectRecord(payload))
|
|
1058
1041
|
return false;
|
|
@@ -1122,8 +1105,8 @@ var streamSwapRuntime = () => {
|
|
|
1122
1105
|
apply(id, pending[id] ?? "");
|
|
1123
1106
|
}
|
|
1124
1107
|
};
|
|
1125
|
-
|
|
1126
|
-
|
|
1108
|
+
absoluteWindow.__ABS_SLOT_FLUSH__ = flush;
|
|
1109
|
+
absoluteWindow.__ABS_SLOT_ENQUEUE__ = (id, payload) => {
|
|
1127
1110
|
apply(id, payload);
|
|
1128
1111
|
};
|
|
1129
1112
|
if (typeof MutationObserver === "function") {
|
|
@@ -1789,6 +1772,65 @@ var ensureHead = (doc) => {
|
|
|
1789
1772
|
}
|
|
1790
1773
|
const head = doc.createElement("head");
|
|
1791
1774
|
doc.documentElement.insertBefore(head, doc.documentElement.firstChild);
|
|
1775
|
+
}, SSR_LAYOUT_RECT, layoutPatchApplied = false, patchElementLayout = (doc) => {
|
|
1776
|
+
if (layoutPatchApplied || !doc) {
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1779
|
+
let element;
|
|
1780
|
+
try {
|
|
1781
|
+
element = doc.createElement("div");
|
|
1782
|
+
} catch {
|
|
1783
|
+
return;
|
|
1784
|
+
}
|
|
1785
|
+
const proto = Object.getPrototypeOf(element);
|
|
1786
|
+
if (!proto)
|
|
1787
|
+
return;
|
|
1788
|
+
const define = (name, value) => {
|
|
1789
|
+
if (typeof proto[name] !== "function") {
|
|
1790
|
+
Object.defineProperty(proto, name, {
|
|
1791
|
+
configurable: true,
|
|
1792
|
+
value,
|
|
1793
|
+
writable: true
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
define("getBoundingClientRect", function() {
|
|
1798
|
+
return { ...SSR_LAYOUT_RECT };
|
|
1799
|
+
});
|
|
1800
|
+
define("getClientRects", function() {
|
|
1801
|
+
return [];
|
|
1802
|
+
});
|
|
1803
|
+
define("scrollTo", function() {});
|
|
1804
|
+
define("scrollBy", function() {});
|
|
1805
|
+
define("scrollIntoView", function() {});
|
|
1806
|
+
define("focus", function() {});
|
|
1807
|
+
define("blur", function() {});
|
|
1808
|
+
const numericProps = [
|
|
1809
|
+
"clientWidth",
|
|
1810
|
+
"clientHeight",
|
|
1811
|
+
"clientLeft",
|
|
1812
|
+
"clientTop",
|
|
1813
|
+
"offsetWidth",
|
|
1814
|
+
"offsetHeight",
|
|
1815
|
+
"offsetLeft",
|
|
1816
|
+
"offsetTop",
|
|
1817
|
+
"scrollWidth",
|
|
1818
|
+
"scrollHeight",
|
|
1819
|
+
"scrollLeft",
|
|
1820
|
+
"scrollTop"
|
|
1821
|
+
];
|
|
1822
|
+
for (const prop of numericProps) {
|
|
1823
|
+
const desc = Object.getOwnPropertyDescriptor(proto, prop);
|
|
1824
|
+
if (desc)
|
|
1825
|
+
continue;
|
|
1826
|
+
Object.defineProperty(proto, prop, {
|
|
1827
|
+
configurable: true,
|
|
1828
|
+
get() {
|
|
1829
|
+
return 0;
|
|
1830
|
+
}
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
layoutPatchApplied = true;
|
|
1792
1834
|
}, applyPatches = async () => {
|
|
1793
1835
|
const { \u{275}DominoAdapter } = await import(resolveAngularPackage("@angular/platform-server"));
|
|
1794
1836
|
if (!\u{275}DominoAdapter?.prototype) {
|
|
@@ -1807,18 +1849,33 @@ var ensureHead = (doc) => {
|
|
|
1807
1849
|
proto.createHtmlDocument = function() {
|
|
1808
1850
|
const doc = origCreateHtmlDocument.call(this);
|
|
1809
1851
|
ensureHead(doc);
|
|
1852
|
+
patchElementLayout(doc);
|
|
1810
1853
|
return doc;
|
|
1811
1854
|
};
|
|
1812
1855
|
const origGetDefaultDocument = proto.getDefaultDocument;
|
|
1813
1856
|
proto.getDefaultDocument = function() {
|
|
1814
1857
|
const doc = origGetDefaultDocument.call(this);
|
|
1815
1858
|
ensureHead(doc);
|
|
1859
|
+
patchElementLayout(doc);
|
|
1816
1860
|
return doc;
|
|
1817
1861
|
};
|
|
1818
1862
|
return true;
|
|
1819
1863
|
};
|
|
1820
1864
|
var init_angularPatch = __esm(() => {
|
|
1821
1865
|
init_resolveAngularPackage();
|
|
1866
|
+
SSR_LAYOUT_RECT = Object.freeze({
|
|
1867
|
+
bottom: 0,
|
|
1868
|
+
height: 0,
|
|
1869
|
+
left: 0,
|
|
1870
|
+
right: 0,
|
|
1871
|
+
top: 0,
|
|
1872
|
+
width: 0,
|
|
1873
|
+
x: 0,
|
|
1874
|
+
y: 0,
|
|
1875
|
+
toJSON() {
|
|
1876
|
+
return this;
|
|
1877
|
+
}
|
|
1878
|
+
});
|
|
1822
1879
|
});
|
|
1823
1880
|
|
|
1824
1881
|
// src/angular/angularDeps.ts
|
|
@@ -22548,7 +22605,7 @@ function isPotentialCssRootFile(id) {
|
|
|
22548
22605
|
function idToPath(id) {
|
|
22549
22606
|
return path.resolve(id.replace(/\?.*$/, ""));
|
|
22550
22607
|
}
|
|
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,
|
|
22608
|
+
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
22609
|
throw TypeError(msg);
|
|
22553
22610
|
}, __require2, __esm2 = (fn, res) => function __init() {
|
|
22554
22611
|
return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
|
|
@@ -22561,10 +22618,10 @@ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind"
|
|
|
22561
22618
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
22562
22619
|
for (let key of __getOwnPropNames2(from))
|
|
22563
22620
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
22564
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc =
|
|
22621
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22565
22622
|
}
|
|
22566
22623
|
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)),
|
|
22624
|
+
}, __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
22625
|
if (value2 != null) {
|
|
22569
22626
|
if (typeof value2 !== "object" && typeof value2 !== "function")
|
|
22570
22627
|
__typeError("Object expected");
|
|
@@ -23151,7 +23208,7 @@ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/bun-plugin-tailwind"
|
|
|
23151
23208
|
var init_bun_plugin_tailwind = __esm(() => {
|
|
23152
23209
|
__create2 = Object.create;
|
|
23153
23210
|
__defProp2 = Object.defineProperty;
|
|
23154
|
-
|
|
23211
|
+
__getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
23155
23212
|
__getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
23156
23213
|
__getProtoOf2 = Object.getPrototypeOf;
|
|
23157
23214
|
__hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
@@ -38072,9 +38129,9 @@ It schedules the call as a new task in the event loop.`);
|
|
|
38072
38129
|
});
|
|
38073
38130
|
require_runtime = __commonJS2({
|
|
38074
38131
|
"../../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(),
|
|
38132
|
+
var { MessageHandler: MessageHandler2, instantiateNapiModuleSync: instantiateNapiModuleSync2, instantiateNapiModule: instantiateNapiModule2 } = (init_emnapi_core_esm_bundler(), __toCommonJS(emnapi_core_esm_bundler_exports));
|
|
38133
|
+
var { getDefaultContext: getDefaultContext2 } = (init_emnapi_esm_bundler(), __toCommonJS(emnapi_esm_bundler_exports));
|
|
38134
|
+
var { WASI: WASI2 } = (init_wasm_util_esm_bundler(), __toCommonJS(wasm_util_esm_bundler_exports));
|
|
38078
38135
|
var { createFsProxy, createOnMessage } = require_fs_proxy();
|
|
38079
38136
|
module.exports = {
|
|
38080
38137
|
MessageHandler: MessageHandler2,
|
|
@@ -42097,7 +42154,8 @@ var SVELTE_PAGE_ROOT_ID = "__absolute_svelte_root__", renderToReadableStream = a
|
|
|
42097
42154
|
} = {}) => {
|
|
42098
42155
|
try {
|
|
42099
42156
|
const { render } = await import("svelte/server");
|
|
42100
|
-
const
|
|
42157
|
+
const renderComponent = render;
|
|
42158
|
+
const rendered = typeof props === "undefined" ? await renderComponent(component) : await renderComponent(component, { props });
|
|
42101
42159
|
const { head, body } = rendered;
|
|
42102
42160
|
const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
|
|
42103
42161
|
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 +46534,68 @@ var init_fileHashTracker = __esm(() => {
|
|
|
46476
46534
|
init_constants();
|
|
46477
46535
|
});
|
|
46478
46536
|
|
|
46537
|
+
// src/dev/transformCache.ts
|
|
46538
|
+
var exports_transformCache = {};
|
|
46539
|
+
__export(exports_transformCache, {
|
|
46540
|
+
setTransformed: () => setTransformed,
|
|
46541
|
+
invalidateAll: () => invalidateAll,
|
|
46542
|
+
invalidate: () => invalidate,
|
|
46543
|
+
getTransformed: () => getTransformed,
|
|
46544
|
+
getInvalidationVersion: () => getInvalidationVersion,
|
|
46545
|
+
findNearestComponent: () => findNearestComponent
|
|
46546
|
+
});
|
|
46547
|
+
var cache, importers, getTransformed = (filePath) => cache.get(filePath)?.content, setTransformed = (filePath, content, mtime, imports) => {
|
|
46548
|
+
const resolvedImports = imports ?? [];
|
|
46549
|
+
cache.set(filePath, { content, imports: resolvedImports, mtime });
|
|
46550
|
+
for (const imp of resolvedImports) {
|
|
46551
|
+
const set2 = importers.get(imp) ?? new Set;
|
|
46552
|
+
importers.set(imp, set2);
|
|
46553
|
+
set2.add(filePath);
|
|
46554
|
+
}
|
|
46555
|
+
}, invalidationVersions, isComponentFile = (filePath) => filePath.endsWith(".tsx") || filePath.endsWith(".jsx"), processParents = (parents, queue) => {
|
|
46556
|
+
const component = [...parents].find(isComponentFile);
|
|
46557
|
+
if (component !== undefined)
|
|
46558
|
+
return component;
|
|
46559
|
+
for (const parent of parents)
|
|
46560
|
+
queue.push(parent);
|
|
46561
|
+
return;
|
|
46562
|
+
}, findNearestComponent = (filePath) => {
|
|
46563
|
+
const visited = new Set;
|
|
46564
|
+
const queue = [filePath];
|
|
46565
|
+
while (queue.length > 0) {
|
|
46566
|
+
const current = queue.shift();
|
|
46567
|
+
if (!current)
|
|
46568
|
+
break;
|
|
46569
|
+
if (visited.has(current))
|
|
46570
|
+
continue;
|
|
46571
|
+
visited.add(current);
|
|
46572
|
+
const parents = importers.get(current);
|
|
46573
|
+
if (!parents)
|
|
46574
|
+
continue;
|
|
46575
|
+
const found = processParents(parents, queue);
|
|
46576
|
+
if (found !== undefined)
|
|
46577
|
+
return found;
|
|
46578
|
+
}
|
|
46579
|
+
return;
|
|
46580
|
+
}, getInvalidationVersion = (filePath) => invalidationVersions.get(filePath) ?? 0, invalidate = (filePath) => {
|
|
46581
|
+
cache.delete(filePath);
|
|
46582
|
+
invalidationVersions.set(filePath, (invalidationVersions.get(filePath) ?? 0) + 1);
|
|
46583
|
+
for (const parent of importers.get(filePath) ?? []) {
|
|
46584
|
+
cache.delete(parent);
|
|
46585
|
+
}
|
|
46586
|
+
}, invalidateAll = () => {
|
|
46587
|
+
cache.clear();
|
|
46588
|
+
importers.clear();
|
|
46589
|
+
};
|
|
46590
|
+
var init_transformCache = __esm(() => {
|
|
46591
|
+
cache = globalThis.__transformCache ?? new Map;
|
|
46592
|
+
globalThis.__transformCache = cache;
|
|
46593
|
+
importers = globalThis.__transformImporters ?? new Map;
|
|
46594
|
+
globalThis.__transformImporters = importers;
|
|
46595
|
+
invalidationVersions = globalThis.__transformInvalidationVersions ?? new Map;
|
|
46596
|
+
globalThis.__transformInvalidationVersions = invalidationVersions;
|
|
46597
|
+
});
|
|
46598
|
+
|
|
46479
46599
|
// src/dev/reactComponentClassifier.ts
|
|
46480
46600
|
import { resolve as resolve26 } from "path";
|
|
46481
46601
|
var classifyComponent = (filePath) => {
|
|
@@ -46719,68 +46839,6 @@ var init_ssrCache = __esm(() => {
|
|
|
46719
46839
|
dirtyFrameworks = new Set;
|
|
46720
46840
|
});
|
|
46721
46841
|
|
|
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
46842
|
// src/dev/moduleServer.ts
|
|
46785
46843
|
var exports_moduleServer = {};
|
|
46786
46844
|
__export(exports_moduleServer, {
|
|
@@ -47038,7 +47096,15 @@ ${code}`;
|
|
|
47038
47096
|
const endPos = findFunctionEnd(source, insertPos);
|
|
47039
47097
|
const funcBody = source.slice(insertPos, endPos);
|
|
47040
47098
|
return `${source.slice(0, insertPos)}__hmr_wrap(${JSON.stringify(name)}, ${funcBody})${source.slice(endPos)}`;
|
|
47041
|
-
}, svelteExternalCss, svelteCompiler = null, vueCompiler = null,
|
|
47099
|
+
}, svelteExternalCss, svelteCompiler = null, vueCompiler = null, getLoadedSvelteCompiler = () => {
|
|
47100
|
+
if (!svelteCompiler)
|
|
47101
|
+
throw new Error("Svelte compiler is not loaded.");
|
|
47102
|
+
return svelteCompiler;
|
|
47103
|
+
}, getLoadedVueCompiler = () => {
|
|
47104
|
+
if (!vueCompiler)
|
|
47105
|
+
throw new Error("Vue compiler is not loaded.");
|
|
47106
|
+
return vueCompiler;
|
|
47107
|
+
}, warmCompilers = async (frameworks2) => {
|
|
47042
47108
|
const [svelteModule, vueModule] = await Promise.all([
|
|
47043
47109
|
frameworks2.svelte ? import("svelte/compiler") : undefined,
|
|
47044
47110
|
frameworks2.vue ? import("@vue/compiler-sfc") : undefined
|
|
@@ -47066,13 +47132,15 @@ ${code}`;
|
|
|
47066
47132
|
source: descriptor.template.content
|
|
47067
47133
|
});
|
|
47068
47134
|
}, compileSvelteModule = (raw, filePath) => {
|
|
47135
|
+
const compiler = getLoadedSvelteCompiler();
|
|
47069
47136
|
const source = tsTranspiler2.transformSync(raw);
|
|
47070
|
-
return
|
|
47137
|
+
return compiler.compileModule(source, {
|
|
47071
47138
|
dev: true,
|
|
47072
47139
|
filename: filePath
|
|
47073
47140
|
}).js.code;
|
|
47074
47141
|
}, compileSvelteComponent = (raw, filePath, projectRoot, enableAsync = false) => {
|
|
47075
|
-
const
|
|
47142
|
+
const compiler = getLoadedSvelteCompiler();
|
|
47143
|
+
const compiled = compiler.compile(raw, {
|
|
47076
47144
|
css: "external",
|
|
47077
47145
|
dev: true,
|
|
47078
47146
|
experimental: {
|
|
@@ -47108,11 +47176,12 @@ ${code}`;
|
|
|
47108
47176
|
const code = isModule ? compileSvelteModule(source, filePath) : compileSvelteComponent(source, filePath, projectRoot, enableAsync);
|
|
47109
47177
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
47110
47178
|
}, compileVueTemplate = (descriptor, compiledScript, filePath, componentId) => {
|
|
47179
|
+
const compiler = getLoadedVueCompiler();
|
|
47111
47180
|
const scriptContent = compiledScript.content;
|
|
47112
47181
|
if (!descriptor.template)
|
|
47113
47182
|
return scriptContent;
|
|
47114
47183
|
const isScoped = descriptor.styles.some((style) => style.scoped);
|
|
47115
|
-
const templateResult =
|
|
47184
|
+
const templateResult = compiler.compileTemplate({
|
|
47116
47185
|
compilerOptions: {
|
|
47117
47186
|
bindingMetadata: compiledScript.bindings,
|
|
47118
47187
|
prefixIdentifiers: true
|
|
@@ -47133,10 +47202,11 @@ export default __script__;`;
|
|
|
47133
47202
|
}, compileVueStyles = async (descriptor, filePath, componentId, code, stylePreprocessors) => {
|
|
47134
47203
|
if (descriptor.styles.length === 0)
|
|
47135
47204
|
return code;
|
|
47136
|
-
const
|
|
47205
|
+
const compiler = getLoadedVueCompiler();
|
|
47206
|
+
const cssCode = (await Promise.all(descriptor.styles.map(async (style) => compiler.compileStyle({
|
|
47137
47207
|
filename: filePath,
|
|
47138
47208
|
id: `data-v-${componentId}`,
|
|
47139
|
-
scoped: style.scoped,
|
|
47209
|
+
scoped: Boolean(style.scoped),
|
|
47140
47210
|
source: style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content,
|
|
47141
47211
|
trim: true
|
|
47142
47212
|
}).code))).join(`
|
|
@@ -47165,7 +47235,11 @@ ${code}`;
|
|
|
47165
47235
|
id: componentId,
|
|
47166
47236
|
inlineTemplate: false
|
|
47167
47237
|
});
|
|
47168
|
-
|
|
47238
|
+
const compiledSfcScript = {
|
|
47239
|
+
bindings: compiledScript.bindings ?? {},
|
|
47240
|
+
content: compiledScript.content
|
|
47241
|
+
};
|
|
47242
|
+
let code = compileVueTemplate(descriptor, compiledSfcScript, filePath, componentId);
|
|
47169
47243
|
code = await compileVueStyles(descriptor, filePath, componentId, code, stylePreprocessors);
|
|
47170
47244
|
code = tsTranspiler2.transformSync(code);
|
|
47171
47245
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
@@ -47543,7 +47617,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
47543
47617
|
// src/dev/rebuildTrigger.ts
|
|
47544
47618
|
import { existsSync as existsSync22 } from "fs";
|
|
47545
47619
|
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) => {
|
|
47620
|
+
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
47621
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
47548
47622
|
if (pathLineCol) {
|
|
47549
47623
|
const [, file3, lineStr, colStr] = pathLineCol;
|
|
@@ -47713,19 +47787,31 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
47713
47787
|
return allFiles;
|
|
47714
47788
|
}, areAllQueuedFilesStable = async (fileChangeQueue) => {
|
|
47715
47789
|
const allFiles = collectAllQueuedFiles(fileChangeQueue);
|
|
47716
|
-
|
|
47790
|
+
const checkFile = async (files) => {
|
|
47791
|
+
const [file3, ...remaining] = files;
|
|
47792
|
+
if (!file3) {
|
|
47793
|
+
return true;
|
|
47794
|
+
}
|
|
47717
47795
|
const stable = await isFileStable(file3);
|
|
47718
|
-
if (!stable)
|
|
47796
|
+
if (!stable) {
|
|
47719
47797
|
return false;
|
|
47720
|
-
|
|
47721
|
-
|
|
47798
|
+
}
|
|
47799
|
+
return checkFile(remaining);
|
|
47800
|
+
};
|
|
47801
|
+
return checkFile(allFiles);
|
|
47722
47802
|
}, waitForStableWrites = async (state) => {
|
|
47723
|
-
|
|
47803
|
+
const waitRound = async (round) => {
|
|
47804
|
+
if (round >= STABILITY_CHECK_ROUNDS) {
|
|
47805
|
+
return;
|
|
47806
|
+
}
|
|
47724
47807
|
const stable = await areAllQueuedFilesStable(state.fileChangeQueue);
|
|
47725
|
-
if (stable)
|
|
47726
|
-
|
|
47727
|
-
|
|
47728
|
-
|
|
47808
|
+
if (stable) {
|
|
47809
|
+
return;
|
|
47810
|
+
}
|
|
47811
|
+
await waitRound(round + 1);
|
|
47812
|
+
};
|
|
47813
|
+
await waitRound(0);
|
|
47814
|
+
}, queueFileChange = async (state, filePath, config, onRebuildComplete) => {
|
|
47729
47815
|
const framework = detectFramework(filePath, state.resolvedPaths);
|
|
47730
47816
|
if (framework === "ignored") {
|
|
47731
47817
|
return;
|
|
@@ -47735,8 +47821,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
47735
47821
|
return;
|
|
47736
47822
|
}
|
|
47737
47823
|
if (framework === "unknown") {
|
|
47738
|
-
|
|
47739
|
-
invalidate2(resolve31(filePath));
|
|
47824
|
+
invalidate(resolve31(filePath));
|
|
47740
47825
|
const relPath = relative12(process.cwd(), filePath);
|
|
47741
47826
|
logHmrUpdate(relPath);
|
|
47742
47827
|
return;
|
|
@@ -48141,9 +48226,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48141
48226
|
}
|
|
48142
48227
|
markSsrCacheDirty("svelte");
|
|
48143
48228
|
const serverDuration = Date.now() - startTime;
|
|
48144
|
-
|
|
48145
|
-
await broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration);
|
|
48146
|
-
}
|
|
48229
|
+
await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
|
|
48147
48230
|
onRebuildComplete({
|
|
48148
48231
|
hmrState: state,
|
|
48149
48232
|
manifest: state.manifest
|
|
@@ -48267,9 +48350,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48267
48350
|
await invalidateNonVueModules(nonVueFiles);
|
|
48268
48351
|
const serverDuration = Date.now() - startTime;
|
|
48269
48352
|
const forceReload = nonVueFiles.length > 0;
|
|
48270
|
-
|
|
48271
|
-
await broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration);
|
|
48272
|
-
}
|
|
48353
|
+
await runSequentially(vueFiles, (changedFile) => broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration));
|
|
48273
48354
|
onRebuildComplete({
|
|
48274
48355
|
hmrState: state,
|
|
48275
48356
|
manifest: state.manifest
|
|
@@ -48451,11 +48532,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48451
48532
|
const outputHtmlPages = computeOutputPagesDir(state, config, "html");
|
|
48452
48533
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
48453
48534
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
48454
|
-
|
|
48535
|
+
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
48455
48536
|
const htmlPageName = basename10(pageFile);
|
|
48456
48537
|
const builtHtmlPagePath = resolve31(outputHtmlPages, htmlPageName);
|
|
48457
48538
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
48458
|
-
}
|
|
48539
|
+
});
|
|
48459
48540
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
48460
48541
|
const [cssFile] = vueCssFiles;
|
|
48461
48542
|
if (!cssFile) {
|
|
@@ -48550,9 +48631,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48550
48631
|
if (isCssOnlyChange && vueCssFiles.length > 0) {
|
|
48551
48632
|
handleVueCssOnlyUpdate(state, vueCssFiles, manifest, duration);
|
|
48552
48633
|
}
|
|
48553
|
-
|
|
48554
|
-
await processVuePageUpdate(state, config, vuePagePath, manifest, duration);
|
|
48555
|
-
}
|
|
48634
|
+
await runSequentially(pagesToUpdate, (vuePagePath) => processVuePageUpdate(state, config, vuePagePath, manifest, duration));
|
|
48556
48635
|
}, handleSvelteCssOnlyUpdate = (state, svelteCssFiles, manifest, duration) => {
|
|
48557
48636
|
const [cssFile] = svelteCssFiles;
|
|
48558
48637
|
if (!cssFile) {
|
|
@@ -48753,11 +48832,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48753
48832
|
const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
|
|
48754
48833
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
48755
48834
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
48756
|
-
|
|
48835
|
+
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
48757
48836
|
const htmxPageName = basename10(htmxPageFile);
|
|
48758
48837
|
const builtHtmxPagePath = resolve31(outputHtmxPages, htmxPageName);
|
|
48759
48838
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
48760
|
-
}
|
|
48839
|
+
});
|
|
48761
48840
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
48762
48841
|
const paths = [];
|
|
48763
48842
|
allModuleUpdates.forEach((update) => {
|
|
@@ -48901,11 +48980,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48901
48980
|
const { updateAssetPaths: updateAssetPaths2 } = await Promise.resolve().then(() => (init_updateAssetPaths(), exports_updateAssetPaths));
|
|
48902
48981
|
const handleUpdate = framework === "html" ? (await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR))).handleHTMLUpdate : (await Promise.resolve().then(() => (init_simpleHTMXHMR(), exports_simpleHTMXHMR))).handleHTMXUpdate;
|
|
48903
48982
|
const { readFileSync: readFs, writeFileSync: writeFs } = await import("fs");
|
|
48904
|
-
|
|
48983
|
+
const processMarkupFiles = async (files) => {
|
|
48984
|
+
const [markupFile, ...remaining] = files;
|
|
48985
|
+
if (!markupFile) {
|
|
48986
|
+
return;
|
|
48987
|
+
}
|
|
48905
48988
|
const success = await tryProcessMarkupFile(state, markupFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs);
|
|
48906
|
-
if (!success)
|
|
48907
|
-
|
|
48908
|
-
|
|
48989
|
+
if (!success) {
|
|
48990
|
+
return;
|
|
48991
|
+
}
|
|
48992
|
+
await processMarkupFiles(remaining);
|
|
48993
|
+
};
|
|
48994
|
+
await processMarkupFiles(markupFiles);
|
|
48909
48995
|
}, 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
48996
|
files.filter((f) => detectFramework(f, resolvedPaths) === framework).forEach((f) => handled.add(f));
|
|
48911
48997
|
}, runFrameworkFastPaths = async (state, config, affectedFrameworks, files, startTime, onRebuildComplete) => {
|
|
@@ -48932,12 +49018,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, getStyleTr
|
|
|
48932
49018
|
handler: handleVueFastPath
|
|
48933
49019
|
}
|
|
48934
49020
|
];
|
|
48935
|
-
|
|
49021
|
+
await runSequentially(fastPaths, async (fastPath) => {
|
|
48936
49022
|
if (!fastPath.directory || !affectedFrameworks.includes(fastPath.framework))
|
|
48937
|
-
|
|
49023
|
+
return;
|
|
48938
49024
|
await fastPath.handler(state, config, files, startTime, onRebuildComplete);
|
|
48939
49025
|
markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
|
|
48940
|
-
}
|
|
49026
|
+
});
|
|
48941
49027
|
return files.every((f) => handled.has(f));
|
|
48942
49028
|
}, performFullRebuild = async (state, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete) => {
|
|
48943
49029
|
const hasManifest = Object.keys(state.manifest).length > 0;
|
|
@@ -49080,6 +49166,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
49080
49166
|
init_dependencyGraph();
|
|
49081
49167
|
init_constants();
|
|
49082
49168
|
init_fileHashTracker();
|
|
49169
|
+
init_transformCache();
|
|
49083
49170
|
init_moduleMapper();
|
|
49084
49171
|
init_telemetryEvent();
|
|
49085
49172
|
init_assetStore();
|
|
@@ -49585,5 +49672,5 @@ export {
|
|
|
49585
49672
|
build
|
|
49586
49673
|
};
|
|
49587
49674
|
|
|
49588
|
-
//# debugId=
|
|
49675
|
+
//# debugId=D6976064B88BE2E464756E2164756E21
|
|
49589
49676
|
//# sourceMappingURL=build.js.map
|