@absolutejs/absolute 0.20.0-beta.172 → 0.20.0-beta.173
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 +32 -0
- package/README.md +3 -2
- package/changelog.json +57 -0
- package/dist/angular/browser.js +12 -12
- package/dist/angular/browser.js.map +6 -7
- package/dist/angular/components/core/streamingSlotRegistrar.js +2 -6
- package/dist/angular/components/core/streamingSlotRegistry.js +3 -7
- package/dist/angular/components/defer-slot.component.js +12 -7
- package/dist/angular/components/stream-slot.component.js +3 -1
- package/dist/angular/index.js +40 -13
- package/dist/angular/index.js.map +7 -7
- package/dist/angular/server.js +39 -12
- package/dist/angular/server.js.map +6 -6
- package/dist/build/buildWorker.js +135 -57
- package/dist/build.js +1183 -1011
- package/dist/build.js.map +16 -15
- package/dist/cli/config/server.js +43 -12
- package/dist/cli/{doctor-repprx92.js → doctor-m36tmx4d.js} +70 -15
- package/dist/cli/index.js +1 -1
- package/dist/core/streamingSlotRegistrar.js +2 -5
- package/dist/core/streamingSlotRegistrar.js.map +4 -5
- package/dist/core/streamingSlotRegistry.js +2 -5
- package/dist/core/streamingSlotRegistry.js.map +4 -5
- package/dist/dev/serverBootstrap.js +2 -1
- package/dist/index.js +1116 -940
- package/dist/index.js.map +18 -17
- package/dist/islands/index.js +2 -2
- package/dist/islands/index.js.map +3 -3
- package/dist/mobile/browser.js +2 -2
- package/dist/mobile/browser.js.map +3 -3
- package/dist/mobile/index.js +2 -2
- package/dist/mobile/index.js.map +3 -3
- package/dist/react/components/index.js +2 -5
- package/dist/react/components/index.js.map +5 -6
- package/dist/react/index.js +45 -16
- package/dist/react/index.js.map +8 -8
- package/dist/react/router/browser.js.map +2 -2
- package/dist/react/router/index.js.map +2 -2
- package/dist/react/server.js +45 -16
- package/dist/react/server.js.map +8 -8
- package/dist/src/angular/components/defer-slot.component.d.ts +1 -0
- package/dist/src/build/missingReactRouter.d.ts +8 -0
- package/dist/src/build/vueModuleOutputPath.d.ts +10 -6
- package/dist/src/cli/scripts/doctor.d.ts +10 -0
- package/dist/src/core/streamingSlotWarningScope.d.ts +3 -0
- package/dist/src/dev/hot/reload.d.ts +5 -0
- package/dist/src/dev/hot/runtime.d.ts +2 -0
- package/dist/src/dev/srcPath.d.ts +2 -1
- package/dist/src/react/pageHandler.d.ts +5 -0
- package/dist/src/react/router/Link.d.ts +6 -1
- package/dist/src/react/serverComponents/pageHandler.d.ts +2 -0
- package/dist/src/utils/portInUse.d.ts +16 -0
- package/dist/svelte/index.js +39 -12
- package/dist/svelte/index.js.map +6 -6
- package/dist/svelte/server.js +39 -12
- package/dist/svelte/server.js.map +6 -6
- package/dist/vue/components/index.js +2 -5
- package/dist/vue/components/index.js.map +4 -5
- package/dist/vue/index.js +39 -12
- package/dist/vue/index.js.map +6 -6
- package/dist/vue/server.js +39 -12
- package/dist/vue/server.js.map +6 -6
- package/package.json +1 -1
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// .angular-partial-tmp-
|
|
3
|
-
var ENV_VAR = "NODE_ENV";
|
|
4
|
-
var isProductionRuntime = () => process.env[ENV_VAR] === "production";
|
|
5
|
-
|
|
6
|
-
// .angular-partial-tmp-a5Gf1s/src/core/streamingSlotRegistrar.ts
|
|
2
|
+
// .angular-partial-tmp-Ko8cCd/src/core/streamingSlotRegistrar.ts
|
|
7
3
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
8
4
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
9
5
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -44,7 +40,7 @@ var setStreamingSlotWarningController = (controller) => {
|
|
|
44
40
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
|
|
45
41
|
};
|
|
46
42
|
var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
47
|
-
if (
|
|
43
|
+
if (isStreamingSlotCollectionActive()) {
|
|
48
44
|
return;
|
|
49
45
|
}
|
|
50
46
|
getWarningController()?.maybeWarn(primitiveName);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// .angular-partial-tmp-
|
|
3
|
-
var ENV_VAR = "NODE_ENV";
|
|
4
|
-
var isProductionRuntime = () => process.env[ENV_VAR] === "production";
|
|
5
|
-
|
|
6
|
-
// .angular-partial-tmp-a5Gf1s/src/core/streamingSlotRegistrar.ts
|
|
2
|
+
// .angular-partial-tmp-Ko8cCd/src/core/streamingSlotRegistrar.ts
|
|
7
3
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
8
4
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
9
5
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -44,13 +40,13 @@ var setStreamingSlotWarningController = (controller) => {
|
|
|
44
40
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
|
|
45
41
|
};
|
|
46
42
|
var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
47
|
-
if (
|
|
43
|
+
if (isStreamingSlotCollectionActive()) {
|
|
48
44
|
return;
|
|
49
45
|
}
|
|
50
46
|
getWarningController()?.maybeWarn(primitiveName);
|
|
51
47
|
};
|
|
52
48
|
|
|
53
|
-
// .angular-partial-tmp-
|
|
49
|
+
// .angular-partial-tmp-Ko8cCd/src/core/streamingSlotRegistry.ts
|
|
54
50
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
55
51
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
56
52
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, Input, inject, signal } from '@angular/core';
|
|
2
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, Input, inject, PLATFORM_ID, signal } from '@angular/core';
|
|
2
|
+
import { isPlatformServer, NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import { isStreamingSlotCollectionActive, registerStreamingSlot, warnMissingStreamingSlotCollector } from './core/streamingSlotRegistrar.js';
|
|
4
4
|
import { isAngularDeferSlotPayload } from './defer-slot-payload.js';
|
|
5
5
|
import { DeferErrorTemplateDirective, DeferFallbackTemplateDirective, DeferResolvedTemplateDirective } from './defer-slot-templates.directive.js';
|
|
@@ -7,6 +7,10 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
export class DeferSlotComponent {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.cdr = inject(ChangeDetectorRef);
|
|
10
|
+
// Streaming slots exist only in the server render. In the browser the
|
|
11
|
+
// slot waits for the streamed payload instead, and must never touch the
|
|
12
|
+
// server-side registrar: its dev warning path reads NODE_ENV.
|
|
13
|
+
this.isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
10
14
|
this.runtimeReady = signal(false, ...(ngDevMode ? [{ debugName: "runtimeReady" }] : /* istanbul ignore next */ []));
|
|
11
15
|
this.serverSlotRegistered = false;
|
|
12
16
|
this.id = '';
|
|
@@ -37,7 +41,8 @@ export class DeferSlotComponent {
|
|
|
37
41
|
const { id } = this;
|
|
38
42
|
if (!id)
|
|
39
43
|
return;
|
|
40
|
-
if (this.
|
|
44
|
+
if (this.isServer) {
|
|
45
|
+
this.registerServerSlot();
|
|
41
46
|
return;
|
|
42
47
|
}
|
|
43
48
|
const absoluteWindow = window;
|
|
@@ -51,10 +56,10 @@ export class DeferSlotComponent {
|
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
ngAfterViewInit() {
|
|
54
|
-
if (this.
|
|
55
|
-
|
|
56
|
-
if (typeof window === 'undefined')
|
|
59
|
+
if (this.isServer) {
|
|
60
|
+
this.registerServerSlot();
|
|
57
61
|
return;
|
|
62
|
+
}
|
|
58
63
|
requestAnimationFrame(() => {
|
|
59
64
|
this.runtimeReady.set(true);
|
|
60
65
|
this.cdr.markForCheck();
|
|
@@ -63,7 +68,7 @@ export class DeferSlotComponent {
|
|
|
63
68
|
});
|
|
64
69
|
}
|
|
65
70
|
ngOnDestroy() {
|
|
66
|
-
if (
|
|
71
|
+
if (this.isServer)
|
|
67
72
|
return;
|
|
68
73
|
const { id } = this;
|
|
69
74
|
if (!id)
|
|
@@ -34,8 +34,10 @@ export class StreamSlotComponent {
|
|
|
34
34
|
});
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
warnMissingStreamingSlotCollector('StreamSlot');
|
|
38
37
|
if (typeof window === 'undefined') {
|
|
38
|
+
// The collector warning is for server renders only; in the
|
|
39
|
+
// browser there is never a collector and nothing to warn about.
|
|
40
|
+
warnMissingStreamingSlotCollector('StreamSlot');
|
|
39
41
|
this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(this.fallbackHtml));
|
|
40
42
|
return;
|
|
41
43
|
}
|
package/dist/angular/index.js
CHANGED
|
@@ -136,7 +136,7 @@ var init_cspNonceRef = __esm(() => {
|
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
// src/utils/runtimeMode.ts
|
|
139
|
-
var ENV_VAR = "NODE_ENV",
|
|
139
|
+
var ENV_VAR = "NODE_ENV", readEnv = () => typeof process === "undefined" ? undefined : process.env?.[ENV_VAR], getNodeEnv = () => readEnv(), isDevelopmentRuntime = () => readEnv() === "development", isProductionRuntime = () => readEnv() === "production";
|
|
140
140
|
|
|
141
141
|
// src/utils/getDurationString.ts
|
|
142
142
|
var getDurationString = (duration) => {
|
|
@@ -338,13 +338,25 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
338
338
|
return;
|
|
339
339
|
warnedMissingBootstrap = true;
|
|
340
340
|
logWarn("A page contains islands, but the build manifest has no islands bootstrap, so they will render without hydrating. Set `islands.registry` in absolute.config.ts (a default bootstrap is generated from it) or point `islands.bootstrap` at a file that calls startIslands().");
|
|
341
|
-
},
|
|
341
|
+
}, MANIFEST_BUILD_DIR_KEY, getManifestBuildDir = () => {
|
|
342
|
+
const value = Reflect.get(globalThis, MANIFEST_BUILD_DIR_KEY);
|
|
343
|
+
return typeof value === "string" ? value : undefined;
|
|
344
|
+
}, WINDOWS_ABSOLUTE_PATH, withTrailingSlash = (path) => path.endsWith("/") ? path : `${path}/`, currentWorkingRoot = () => {
|
|
345
|
+
try {
|
|
346
|
+
return withTrailingSlash(process.cwd().replaceAll("\\", "/"));
|
|
347
|
+
} catch {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
}, isServerFilePath = (value) => {
|
|
342
351
|
if (WINDOWS_ABSOLUTE_PATH.test(value))
|
|
343
352
|
return true;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
353
|
+
const buildDir = getManifestBuildDir();
|
|
354
|
+
if (buildDir && value.startsWith(withTrailingSlash(buildDir)))
|
|
355
|
+
return true;
|
|
356
|
+
const root = currentWorkingRoot();
|
|
357
|
+
if (root && root !== "/" && value.startsWith(root))
|
|
358
|
+
return true;
|
|
359
|
+
return false;
|
|
348
360
|
}, toBrowserManifest = (manifest) => {
|
|
349
361
|
const browserManifest = {};
|
|
350
362
|
for (const [key, value] of Object.entries(manifest)) {
|
|
@@ -556,12 +568,13 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
556
568
|
return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
|
|
557
569
|
}, setCurrentIslandManifest = (manifest, buildDir) => {
|
|
558
570
|
globalThis.__absoluteManifest = manifest;
|
|
559
|
-
|
|
571
|
+
Reflect.set(globalThis, MANIFEST_BUILD_DIR_KEY, buildDir?.replaceAll("\\", "/"));
|
|
560
572
|
};
|
|
561
573
|
var init_islandPageContext = __esm(() => {
|
|
562
574
|
init_escapeScriptContent();
|
|
563
575
|
init_cspNonceRef();
|
|
564
576
|
init_logger();
|
|
577
|
+
MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
|
|
565
578
|
WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
|
|
566
579
|
});
|
|
567
580
|
|
|
@@ -16238,7 +16251,7 @@ var setStreamingSlotWarningController = (controller) => {
|
|
|
16238
16251
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
|
|
16239
16252
|
};
|
|
16240
16253
|
var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
16241
|
-
if (
|
|
16254
|
+
if (isStreamingSlotCollectionActive()) {
|
|
16242
16255
|
return;
|
|
16243
16256
|
}
|
|
16244
16257
|
getWarningController()?.maybeWarn(primitiveName);
|
|
@@ -16425,7 +16438,11 @@ var extractCallsiteFromStack = (stack) => {
|
|
|
16425
16438
|
`).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
|
|
16426
16439
|
return location ? normalizeCallsitePath2(location) : undefined;
|
|
16427
16440
|
};
|
|
16428
|
-
var buildMissingCollectorWarning = (primitiveName,
|
|
16441
|
+
var buildMissingCollectorWarning = (primitiveName, { explicitlyDisabled, handlerCallsite }) => {
|
|
16442
|
+
const fix = explicitlyDisabled ? "This page handler sets { collectStreamingSlots: false }, so the slot stays on its fallback and never streams. Remove the option (or set it to true) to stream this route." : "The slot stays on its fallback and never streams. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.";
|
|
16443
|
+
return `${primitiveName} rendered during SSR without streaming slot collection enabled. ${fix}${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
|
|
16444
|
+
};
|
|
16445
|
+
var productionWarnings = new Set;
|
|
16429
16446
|
setStreamingSlotWarningController({
|
|
16430
16447
|
maybeWarn: (primitiveName) => {
|
|
16431
16448
|
const store = getWarningStorage()?.getStore();
|
|
@@ -16433,7 +16450,13 @@ setStreamingSlotWarningController({
|
|
|
16433
16450
|
return;
|
|
16434
16451
|
}
|
|
16435
16452
|
store.hasWarned = true;
|
|
16436
|
-
|
|
16453
|
+
const message = buildMissingCollectorWarning(primitiveName, store);
|
|
16454
|
+
if (isProductionRuntime()) {
|
|
16455
|
+
if (productionWarnings.has(message))
|
|
16456
|
+
return;
|
|
16457
|
+
productionWarnings.add(message);
|
|
16458
|
+
}
|
|
16459
|
+
logWarn(message);
|
|
16437
16460
|
}
|
|
16438
16461
|
});
|
|
16439
16462
|
var captureStreamingSlotWarningCallsite = () => {
|
|
@@ -16446,7 +16469,11 @@ var captureStreamingSlotWarningCallsite = () => {
|
|
|
16446
16469
|
}
|
|
16447
16470
|
return extractCallsiteFromStack(stack);
|
|
16448
16471
|
};
|
|
16449
|
-
var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({
|
|
16472
|
+
var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage().run({
|
|
16473
|
+
explicitlyDisabled: metadata?.explicitlyDisabled === true,
|
|
16474
|
+
handlerCallsite: metadata?.handlerCallsite,
|
|
16475
|
+
hasWarned: false
|
|
16476
|
+
}, task);
|
|
16450
16477
|
|
|
16451
16478
|
// src/angular/pageHandler.ts
|
|
16452
16479
|
init_ssrRender();
|
|
@@ -17153,8 +17180,8 @@ class StreamSlotComponent {
|
|
|
17153
17180
|
});
|
|
17154
17181
|
return;
|
|
17155
17182
|
}
|
|
17156
|
-
warnMissingStreamingSlotCollector("StreamSlot");
|
|
17157
17183
|
if (typeof window === "undefined") {
|
|
17184
|
+
warnMissingStreamingSlotCollector("StreamSlot");
|
|
17158
17185
|
this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(this.fallbackHtml));
|
|
17159
17186
|
return;
|
|
17160
17187
|
}
|
|
@@ -17241,5 +17268,5 @@ export {
|
|
|
17241
17268
|
withPendingTask
|
|
17242
17269
|
};
|
|
17243
17270
|
|
|
17244
|
-
//# debugId=
|
|
17271
|
+
//# debugId=1A554578F02D3D8164756E2164756E21
|
|
17245
17272
|
//# sourceMappingURL=index.js.map
|