@absolutejs/absolute 0.19.0-beta.395 → 0.19.0-beta.397
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/build.js +22 -11
- package/dist/build.js.map +3 -3
- package/dist/index.js +22 -11
- package/dist/index.js.map +3 -3
- package/dist/src/build/compileSvelte.d.ts +1 -0
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -171934,7 +171934,8 @@ var resolveDevClientDir2 = () => {
|
|
|
171934
171934
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
171935
171935
|
const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
|
|
171936
171936
|
const childSources = resolvedImports.filter((path) => path !== null);
|
|
171937
|
-
await Promise.all(childSources.map((child) => build(child)));
|
|
171937
|
+
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
171938
|
+
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
171938
171939
|
const externalRewrites = new Map;
|
|
171939
171940
|
const ssrOutputDir = dirname6(join11(serverDir, relDir, `${baseName}.js`));
|
|
171940
171941
|
const clientOutputDir = dirname6(join11(clientDir, relDir, `${baseName}.js`));
|
|
@@ -171951,12 +171952,12 @@ var resolveDevClientDir2 = () => {
|
|
|
171951
171952
|
const childRel = relative6(svelteRoot, resolved).replace(/\\/g, "/");
|
|
171952
171953
|
if (!childRel.startsWith(".."))
|
|
171953
171954
|
continue;
|
|
171954
|
-
const
|
|
171955
|
-
if (!
|
|
171955
|
+
const childBuilt2 = cache.get(resolved);
|
|
171956
|
+
if (!childBuilt2)
|
|
171956
171957
|
continue;
|
|
171957
171958
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
171958
|
-
const toServer = relative6(ssrOutputDir,
|
|
171959
|
-
const toClient = relative6(clientOutputDir,
|
|
171959
|
+
const toServer = relative6(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
171960
|
+
const toClient = relative6(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
171960
171961
|
externalRewrites.set(origSpec, {
|
|
171961
171962
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
171962
171963
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -172023,13 +172024,17 @@ var resolveDevClientDir2 = () => {
|
|
|
172023
172024
|
write(clientPath, clientBundle)
|
|
172024
172025
|
]);
|
|
172025
172026
|
}
|
|
172026
|
-
const built = {
|
|
172027
|
+
const built = {
|
|
172028
|
+
client: clientPath,
|
|
172029
|
+
ssr: ssrPath,
|
|
172030
|
+
hasAwaitSlot: loweredAwaitServerSource.transformed || loweredAwaitClientSource.transformed || loweredServerSource.transformed || loweredClientSource.transformed || hasAwaitSlotFromChildren
|
|
172031
|
+
};
|
|
172027
172032
|
cache.set(src, built);
|
|
172028
172033
|
persistentCache.set(src, built);
|
|
172029
172034
|
return built;
|
|
172030
172035
|
};
|
|
172031
172036
|
const roots = await Promise.all(entryPoints.map(build));
|
|
172032
|
-
await Promise.all(roots.map(async ({ client }) => {
|
|
172037
|
+
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
172033
172038
|
const relClientDir = dirname6(relative6(clientDir, client));
|
|
172034
172039
|
const name = basename4(client, extname4(client));
|
|
172035
172040
|
const indexPath = join11(indexDir, relClientDir, `${name}.js`);
|
|
@@ -172045,6 +172050,7 @@ var initialProps = (typeof window !== "undefined" && window.__INITIAL_PROPS__) ?
|
|
|
172045
172050
|
var isHMR = typeof window !== "undefined" && window.__SVELTE_COMPONENT__ !== undefined;
|
|
172046
172051
|
var isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;
|
|
172047
172052
|
var hasIslandHtml = false;
|
|
172053
|
+
var shouldHydrate = typeof window === "undefined" ? false : ${hasAwaitSlot ? "false" : "true"};
|
|
172048
172054
|
var component;
|
|
172049
172055
|
var target = document.getElementById(${JSON.stringify(SVELTE_PAGE_ROOT_ID)}) || document.body;
|
|
172050
172056
|
|
|
@@ -172075,6 +172081,8 @@ if (isHMR) {
|
|
|
172075
172081
|
}
|
|
172076
172082
|
component = mount(Component, { target, props: mergedProps });
|
|
172077
172083
|
window.__HMR_PRESERVED_STATE__ = undefined;
|
|
172084
|
+
} else if (!shouldHydrate) {
|
|
172085
|
+
component = undefined;
|
|
172078
172086
|
} else if (isSsrDirty || hasIslandHtml) {
|
|
172079
172087
|
component = mount(Component, { target, props: initialProps });
|
|
172080
172088
|
} else {
|
|
@@ -172083,18 +172091,21 @@ if (isHMR) {
|
|
|
172083
172091
|
|
|
172084
172092
|
if (typeof window !== "undefined") {
|
|
172085
172093
|
window.__SVELTE_COMPONENT__ = component;
|
|
172086
|
-
window.__SVELTE_UNMOUNT__ = function() { unmount(component); };
|
|
172094
|
+
window.__SVELTE_UNMOUNT__ = function() { if (component) { unmount(component); } };
|
|
172095
|
+
window.__ABS_SLOT_HYDRATION_PENDING__ = shouldHydrate;
|
|
172087
172096
|
var releaseStreamingSlots = function() {
|
|
172088
172097
|
window.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
172089
172098
|
if (typeof window.__ABS_SLOT_FLUSH__ === "function") {
|
|
172090
172099
|
window.__ABS_SLOT_FLUSH__();
|
|
172091
172100
|
}
|
|
172092
172101
|
};
|
|
172093
|
-
if (typeof requestAnimationFrame === "function") {
|
|
172102
|
+
if (shouldHydrate && typeof requestAnimationFrame === "function") {
|
|
172094
172103
|
requestAnimationFrame(function() {
|
|
172095
172104
|
requestAnimationFrame(releaseStreamingSlots);
|
|
172096
172105
|
});
|
|
172097
|
-
} else {
|
|
172106
|
+
} else if (typeof window.__ABS_SLOT_FLUSH__ === "function") {
|
|
172107
|
+
window.__ABS_SLOT_FLUSH__();
|
|
172108
|
+
} else if (typeof setTimeout === "function") {
|
|
172098
172109
|
setTimeout(releaseStreamingSlots, 0);
|
|
172099
172110
|
}
|
|
172100
172111
|
}`;
|
|
@@ -179208,5 +179219,5 @@ export {
|
|
|
179208
179219
|
build
|
|
179209
179220
|
};
|
|
179210
179221
|
|
|
179211
|
-
//# debugId=
|
|
179222
|
+
//# debugId=3B6CA0D01FB2BA8B64756E2164756E21
|
|
179212
179223
|
//# sourceMappingURL=build.js.map
|