@absolutejs/absolute 0.20.0-beta.174 → 0.20.0-beta.175
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 +23 -0
- package/changelog.json +60 -0
- package/dist/angular/browser.js +13 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +67 -8
- package/dist/angular/index.js.map +10 -8
- package/dist/angular/server.js +67 -8
- package/dist/angular/server.js.map +10 -8
- package/dist/build.js +312 -119
- package/dist/build.js.map +20 -18
- package/dist/cli/{compile-n6fs2vmx.js → compile-w2z6c9vt.js} +1 -1
- package/dist/cli/{dev-6h1f0mzq.js → dev-8br5mr7t.js} +16 -2
- package/dist/cli/{index-mqevg32w.js → index-6522t968.js} +21 -2
- package/dist/cli/{index-bhyd3ejc.js → index-7z1hh3fg.js} +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{islands-vk05sj6v.js → islands-bx67g15t.js} +4 -4
- package/dist/cli/{mobile-62b6j3j7.js → mobile-we5q51ey.js} +2 -2
- package/dist/cli/{start-jh6kyp92.js → start-srs11bm8.js} +2 -2
- package/dist/client/chunks/index-4j1snyh2.js +18 -0
- package/dist/client/chunks/index-4j1snyh2.js.map +10 -0
- package/dist/client/chunks/{index-6b66nzyf.js → index-a3rpg5kw.js} +6 -16
- package/dist/client/chunks/{index-6b66nzyf.js.map → index-a3rpg5kw.js.map} +3 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js → islands-mfjmdwnb.js} +11 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js.map → islands-mfjmdwnb.js.map} +3 -3
- package/dist/client/chunks/{react-dcvkaba2.js → react-sprprqzs.js} +20 -4
- package/dist/client/chunks/react-sprprqzs.js.map +10 -0
- package/dist/client/chunks/svelte-6ewphsvj.js +30 -0
- package/dist/client/chunks/svelte-6ewphsvj.js.map +10 -0
- package/dist/client/chunks/{vue-a84fzp3v.js → vue-db6ppn1f.js} +14 -4
- package/dist/client/chunks/vue-db6ppn1f.js.map +10 -0
- package/dist/client/index.js +65 -8
- package/dist/client/index.js.map +4 -4
- package/dist/client/navigation.js +5 -3
- package/dist/client/navigation.js.map +2 -2
- package/dist/client/prefetch.js +1 -1
- package/dist/dev/client/handlers/islands.ts +85 -0
- package/dist/dev/client/hmrClient.ts +6 -0
- package/dist/index.js +448 -242
- package/dist/index.js.map +21 -19
- package/dist/islands/index.js +57 -10
- package/dist/islands/index.js.map +9 -7
- package/dist/react/browser.js +15 -4
- package/dist/react/browser.js.map +5 -5
- package/dist/react/components/client.js +506 -0
- package/dist/react/components/index.js +14 -15
- package/dist/react/components/index.js.map +4 -4
- package/dist/react/components/server/index.js +728 -0
- package/dist/react/hooks/index.js +14 -15
- package/dist/react/hooks/index.js.map +4 -4
- package/dist/react/index.js +66 -6
- package/dist/react/index.js.map +11 -9
- package/dist/react/router/browser.js +7 -8
- package/dist/react/router/browser.js.map +4 -4
- package/dist/react/router/index.js +7 -8
- package/dist/react/router/index.js.map +4 -4
- package/dist/react/server.js +14 -1
- package/dist/react/server.js.map +4 -4
- package/dist/src/build/buildReactServerComponents.d.ts +4 -0
- package/dist/src/build/islandEntries.d.ts +5 -0
- package/dist/src/client/hydrators/react.d.ts +7 -0
- package/dist/src/client/hydrators/svelte.d.ts +3 -0
- package/dist/src/client/hydrators/vue.d.ts +3 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +5 -0
- package/dist/src/core/islandServerGeneration.d.ts +3 -0
- package/dist/src/react/components/client.d.ts +4 -0
- package/dist/src/react/components/server/index.d.ts +8 -0
- package/dist/src/react/serverComponents/constants.d.ts +2 -1
- package/dist/svelte/index.js +66 -6
- package/dist/svelte/index.js.map +10 -8
- package/dist/svelte/server.js +38 -3
- package/dist/svelte/server.js.map +6 -5
- package/dist/types/build.d.ts +3 -2
- package/dist/types/globals.d.ts +15 -0
- package/dist/vue/browser.js +26 -16
- package/dist/vue/browser.js.map +5 -5
- package/dist/vue/index.js +65 -21
- package/dist/vue/index.js.map +10 -9
- package/package.json +1 -1
- package/dist/client/chunks/react-dcvkaba2.js.map +0 -10
- package/dist/client/chunks/svelte-4yfa5bxa.js +0 -17
- package/dist/client/chunks/svelte-4yfa5bxa.js.map +0 -10
- package/dist/client/chunks/vue-a84fzp3v.js.map +0 -10
package/dist/islands/index.js
CHANGED
|
@@ -647,12 +647,12 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
647
647
|
result = injectBeforeClose(result, `<script${nonceAttr()}>import(${escapeScriptContent(escapedIndexPath)});</script>`);
|
|
648
648
|
}
|
|
649
649
|
return result;
|
|
650
|
-
}, renderAngularApp = async (deps, PageComponent, providers,
|
|
650
|
+
}, renderAngularApp = async (deps, PageComponent, providers, document2, url = "/") => {
|
|
651
651
|
const nonce = readCspNonce();
|
|
652
652
|
const cspProviders = nonce ? [{ provide: deps.CSP_NONCE, useValue: nonce }] : [];
|
|
653
653
|
const bootstrap = (context) => deps.bootstrapApplication(PageComponent, { providers: [...providers, ...cspProviders] }, context);
|
|
654
654
|
return withSuppressedAngularDevLogs(() => deps.renderApplication(bootstrap, {
|
|
655
|
-
document,
|
|
655
|
+
document: document2,
|
|
656
656
|
platformProviders: [],
|
|
657
657
|
url
|
|
658
658
|
}));
|
|
@@ -679,6 +679,19 @@ var init_ssrRender = __esm(() => {
|
|
|
679
679
|
selectorCache = new Map;
|
|
680
680
|
});
|
|
681
681
|
|
|
682
|
+
// src/dev/client/cspNonce.ts
|
|
683
|
+
var applyPageNonce = (element) => {
|
|
684
|
+
const nonce = readPageNonce();
|
|
685
|
+
if (nonce)
|
|
686
|
+
element.nonce = nonce;
|
|
687
|
+
return element;
|
|
688
|
+
}, readPageNonce = () => {
|
|
689
|
+
if (typeof document === "undefined")
|
|
690
|
+
return;
|
|
691
|
+
const carrier = document.querySelector("script[nonce], style[nonce]");
|
|
692
|
+
return carrier?.nonce || undefined;
|
|
693
|
+
};
|
|
694
|
+
|
|
682
695
|
// src/angular/islands.ts
|
|
683
696
|
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
|
|
684
697
|
const requestId = getSsrContextId();
|
|
@@ -756,9 +769,9 @@ var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_i
|
|
|
756
769
|
{ provide: deps.APP_BASE_HREF, useValue: "/" },
|
|
757
770
|
{ provide: propsToken, useValue: props }
|
|
758
771
|
];
|
|
759
|
-
const
|
|
772
|
+
const document2 = `<!DOCTYPE html><html><body><${selector}></${selector}></body></html>`;
|
|
760
773
|
const html = await withSuppressedAngularDevLogs(() => deps.renderApplication((context) => deps.bootstrapApplication(WrapperComponent, { providers }, context), {
|
|
761
|
-
document,
|
|
774
|
+
document: document2,
|
|
762
775
|
platformProviders: [],
|
|
763
776
|
url: "/"
|
|
764
777
|
}));
|
|
@@ -2192,10 +2205,25 @@ var init_lazyModule = __esm(() => {
|
|
|
2192
2205
|
LAZY_RESOLVED_KEY = Symbol.for("absolutejs.svelte.lazy-resolved");
|
|
2193
2206
|
});
|
|
2194
2207
|
|
|
2208
|
+
// src/core/islandServerGeneration.ts
|
|
2209
|
+
var readGeneration = () => globalThis.__absoluteIslandServerGeneration ?? 0, bumpIslandServerGeneration = () => {
|
|
2210
|
+
globalThis.__absoluteIslandServerGeneration = readGeneration() + 1;
|
|
2211
|
+
}, createIslandGenerationGuard = (reset) => {
|
|
2212
|
+
let seen = readGeneration();
|
|
2213
|
+
return () => {
|
|
2214
|
+
const current = readGeneration();
|
|
2215
|
+
if (current === seen)
|
|
2216
|
+
return current;
|
|
2217
|
+
seen = current;
|
|
2218
|
+
reset();
|
|
2219
|
+
return current;
|
|
2220
|
+
};
|
|
2221
|
+
};
|
|
2222
|
+
|
|
2195
2223
|
// src/core/svelteServerModule.ts
|
|
2196
2224
|
import { mkdir as mkdir2, readdir as readdir2 } from "fs/promises";
|
|
2197
2225
|
import { basename, dirname as dirname3, extname as extname2, join as join6, relative as relative3, resolve as resolve4 } from "path";
|
|
2198
|
-
var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
2226
|
+
var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
2199
2227
|
const importPath = relative3(dirname3(from), target).replace(/\\/g, "/");
|
|
2200
2228
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
2201
2229
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
@@ -2262,7 +2290,9 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
|
|
|
2262
2290
|
}, getCachedModulePath2 = (sourcePath) => {
|
|
2263
2291
|
const relativeSourcePath = relative3(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
2264
2292
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
2265
|
-
|
|
2293
|
+
const generation = syncIslandGeneration();
|
|
2294
|
+
const generationSuffix = generation > 0 ? `.g${generation}` : "";
|
|
2295
|
+
return join6(serverCacheRoot2, `${normalizedSourcePath}${generationSuffix}.server.js`);
|
|
2266
2296
|
}, resolveSvelteImport = async (spec, from) => {
|
|
2267
2297
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
2268
2298
|
const resolved = resolvePackageImport(spec);
|
|
@@ -2294,6 +2324,7 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
|
|
|
2294
2324
|
}
|
|
2295
2325
|
await Bun.write(path, content);
|
|
2296
2326
|
}, compileSvelteServerModule = async (sourcePath) => {
|
|
2327
|
+
syncIslandGeneration();
|
|
2297
2328
|
const cachedModulePath = compiledModuleCache2.get(sourcePath);
|
|
2298
2329
|
if (cachedModulePath) {
|
|
2299
2330
|
return cachedModulePath;
|
|
@@ -2376,6 +2407,10 @@ var init_svelteServerModule = __esm(() => {
|
|
|
2376
2407
|
serverCacheRoot2 = join6(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
2377
2408
|
compiledModuleCache2 = new Map;
|
|
2378
2409
|
originalSourcePathCache = new Map;
|
|
2410
|
+
syncIslandGeneration = createIslandGenerationGuard(() => {
|
|
2411
|
+
compiledModuleCache2.clear();
|
|
2412
|
+
originalSourcePathCache.clear();
|
|
2413
|
+
});
|
|
2379
2414
|
transpiler = new Bun.Transpiler({
|
|
2380
2415
|
loader: "ts",
|
|
2381
2416
|
target: "browser"
|
|
@@ -2409,13 +2444,15 @@ import { readFileSync as readFileSync4, realpathSync } from "fs";
|
|
|
2409
2444
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
2410
2445
|
import { dirname as dirname4, join as join7, relative as relative4, resolve as resolve5 } from "path";
|
|
2411
2446
|
var {Transpiler } = globalThis.Bun;
|
|
2412
|
-
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
2447
|
+
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
2413
2448
|
const importPath = relative4(dirname4(from), target).replace(/\\/g, "/");
|
|
2414
2449
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
2415
2450
|
}, getCachedModulePath3 = (sourcePath) => {
|
|
2416
2451
|
const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
2417
2452
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
2418
|
-
|
|
2453
|
+
const generation = syncIslandGeneration2();
|
|
2454
|
+
const generationSuffix = generation > 0 ? `.g${generation}` : "";
|
|
2455
|
+
return join7(serverCacheRoot3, `${normalizedSourcePath}${generationSuffix}.server.js`);
|
|
2419
2456
|
}, writeIfChanged2 = async (path, content) => {
|
|
2420
2457
|
const targetFile = Bun.file(path);
|
|
2421
2458
|
if (await targetFile.exists()) {
|
|
@@ -2442,6 +2479,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
|
|
|
2442
2479
|
`) : nonVueLines.join(`
|
|
2443
2480
|
`);
|
|
2444
2481
|
}, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
|
|
2482
|
+
syncIslandGeneration2();
|
|
2445
2483
|
const cachedModulePath = compiledModuleCache3.get(sourcePath);
|
|
2446
2484
|
if (cachedModulePath)
|
|
2447
2485
|
return cachedModulePath;
|
|
@@ -2502,6 +2540,9 @@ var init_vueServerModule = __esm(() => {
|
|
|
2502
2540
|
init_isFile();
|
|
2503
2541
|
serverCacheRoot3 = join7(process.cwd(), ".absolutejs", "islands", "vue");
|
|
2504
2542
|
compiledModuleCache3 = new Map;
|
|
2543
|
+
syncIslandGeneration2 = createIslandGenerationGuard(() => {
|
|
2544
|
+
compiledModuleCache3.clear();
|
|
2545
|
+
});
|
|
2505
2546
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
2506
2547
|
});
|
|
2507
2548
|
|
|
@@ -2519,7 +2560,7 @@ var init_islandMarkupAttributes = __esm(() => {
|
|
|
2519
2560
|
});
|
|
2520
2561
|
|
|
2521
2562
|
// src/core/renderIslandMarkup.ts
|
|
2522
|
-
var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
|
|
2563
|
+
var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, syncIslandGeneration3, nextIslandId = () => {
|
|
2523
2564
|
islandSequence += 1;
|
|
2524
2565
|
return `island-${islandSequence}`;
|
|
2525
2566
|
}, isRecord4 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord4(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
|
|
@@ -2533,6 +2574,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
2533
2574
|
const loadedModule = await import(compiledModulePath);
|
|
2534
2575
|
return "default" in loadedModule ? loadedModule.default : loadedModule;
|
|
2535
2576
|
}, loadServerBuildComponent = async (buildReferencePath) => {
|
|
2577
|
+
syncIslandGeneration3();
|
|
2536
2578
|
const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
|
|
2537
2579
|
if (cachedBuildComponent) {
|
|
2538
2580
|
return cachedBuildComponent;
|
|
@@ -2571,6 +2613,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
2571
2613
|
}
|
|
2572
2614
|
return loadServerImportComponent(resolvedComponent);
|
|
2573
2615
|
}, resolveServerIslandComponent = async (component) => {
|
|
2616
|
+
syncIslandGeneration3();
|
|
2574
2617
|
const cachedResolvedComponent = resolvedServerComponentCache.get(component);
|
|
2575
2618
|
if (cachedResolvedComponent) {
|
|
2576
2619
|
return cachedResolvedComponent;
|
|
@@ -2669,6 +2712,10 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
2669
2712
|
init_islands();
|
|
2670
2713
|
resolvedServerComponentCache = new Map;
|
|
2671
2714
|
resolvedServerBuildComponentCache = new Map;
|
|
2715
|
+
syncIslandGeneration3 = createIslandGenerationGuard(() => {
|
|
2716
|
+
resolvedServerComponentCache.clear();
|
|
2717
|
+
resolvedServerBuildComponentCache.clear();
|
|
2718
|
+
});
|
|
2672
2719
|
});
|
|
2673
2720
|
|
|
2674
2721
|
// src/islands/index.ts
|
|
@@ -2777,5 +2824,5 @@ export {
|
|
|
2777
2824
|
renderIslandMarkup
|
|
2778
2825
|
};
|
|
2779
2826
|
|
|
2780
|
-
//# debugId=
|
|
2827
|
+
//# debugId=2FF60ED2FCC99C4E64756E2164756E21
|
|
2781
2828
|
//# sourceMappingURL=index.js.map
|