@absolutejs/absolute 0.20.0-beta.172 → 0.20.0-beta.174
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 +39 -0
- package/README.md +3 -2
- package/changelog.json +68 -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 +86 -39
- package/dist/angular/index.js.map +11 -10
- package/dist/angular/server.js +85 -38
- package/dist/angular/server.js.map +10 -9
- package/dist/build/buildWorker.js +135 -57
- package/dist/build.js +1817 -1623
- package/dist/build.js.map +38 -36
- package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
- package/dist/cli/{compile-ndc36zna.js → compile-n6fs2vmx.js} +16 -14
- package/dist/cli/config/server.js +128 -77
- package/dist/cli/{dev-x49583aj.js → dev-6h1f0mzq.js} +1 -1
- package/dist/cli/{doctor-repprx92.js → doctor-m36tmx4d.js} +70 -15
- package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
- package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
- package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
- package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
- package/dist/cli/index-4j1twret.js +22 -0
- package/dist/cli/{index-25e7k849.js → index-bhyd3ejc.js} +4 -4
- package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
- package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
- package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
- package/dist/cli/{index-z794p5qg.js → index-mqevg32w.js} +22 -19
- package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
- package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
- package/dist/cli/index.js +12 -12
- package/dist/cli/{islands-p4vgx7a2.js → islands-vk05sj6v.js} +5 -4
- package/dist/cli/{mobile-nqdkk3gd.js → mobile-62b6j3j7.js} +5 -4
- package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
- package/dist/cli/{start-t3cq57wn.js → start-jh6kyp92.js} +5 -4
- package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
- 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/importCostReport.js +45 -26
- package/dist/dev/serverBootstrap.js +2 -1
- package/dist/index.js +1748 -1550
- package/dist/index.js.map +40 -38
- 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 +116 -96
- package/dist/mobile/index.js.map +7 -6
- package/dist/mobile/remoteMacAgentEntry.js +205 -651
- 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/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
- package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
- package/dist/src/cli/scripts/doctor.d.ts +10 -0
- package/dist/src/core/streamingSlotWarningScope.d.ts +3 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
- 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/lazyTypescript.d.ts +3 -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
package/dist/cli/index.js
CHANGED
|
@@ -54,7 +54,7 @@ if (command === "dev") {
|
|
|
54
54
|
}
|
|
55
55
|
const positionalArgs = stripNamedArgs("--config", "--android-device", "--ios-device").filter((arg) => arg !== "--no-mobile" && arg !== "--eager");
|
|
56
56
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
57
|
-
const { dev } = await import("./dev-
|
|
57
|
+
const { dev } = await import("./dev-6h1f0mzq.js");
|
|
58
58
|
await dev(serverEntry, configPath, {
|
|
59
59
|
androidDevice,
|
|
60
60
|
eager: args.includes("--eager"),
|
|
@@ -70,7 +70,7 @@ if (command === "dev") {
|
|
|
70
70
|
const configPath = parseNamedArg("--config");
|
|
71
71
|
const positionalArgs = stripNamedArgs("--outdir", "--config").filter((arg) => arg !== "--prebuilt");
|
|
72
72
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
73
|
-
const { start } = await import("./start-
|
|
73
|
+
const { start } = await import("./start-jh6kyp92.js");
|
|
74
74
|
await start(serverEntry, outdir, configPath, {
|
|
75
75
|
prebuilt: args.includes("--prebuilt")
|
|
76
76
|
});
|
|
@@ -80,7 +80,7 @@ if (command === "dev") {
|
|
|
80
80
|
const configPath = parseNamedArg("--config");
|
|
81
81
|
const positionalArgs = stripNamedArgs("--outdir", "--config");
|
|
82
82
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
83
|
-
const { start } = await import("./start-
|
|
83
|
+
const { start } = await import("./start-jh6kyp92.js");
|
|
84
84
|
await start(serverEntry, outdir, configPath, { prepareOnly: true });
|
|
85
85
|
} else if (command === "build") {
|
|
86
86
|
sendTelemetryEvent("cli:command", { command });
|
|
@@ -133,11 +133,11 @@ if (command === "dev") {
|
|
|
133
133
|
await runMem(args);
|
|
134
134
|
} else if (command === "generate" || command === "g") {
|
|
135
135
|
sendTelemetryEvent("cli:command", { command: "generate" });
|
|
136
|
-
const { runGenerate } = await import("./generate-
|
|
136
|
+
const { runGenerate } = await import("./generate-5vyz1s44.js");
|
|
137
137
|
await runGenerate(args);
|
|
138
138
|
} else if (command === "add") {
|
|
139
139
|
sendTelemetryEvent("cli:command", { command: "add" });
|
|
140
|
-
const { runAdd } = await import("./add-
|
|
140
|
+
const { runAdd } = await import("./add-ntg96znk.js");
|
|
141
141
|
await runAdd(args);
|
|
142
142
|
} else if (command === "analyze") {
|
|
143
143
|
sendTelemetryEvent("cli:command", { command: "analyze" });
|
|
@@ -149,11 +149,11 @@ if (command === "dev") {
|
|
|
149
149
|
await runApi(args);
|
|
150
150
|
} else if (command === "remove") {
|
|
151
151
|
sendTelemetryEvent("cli:command", { command: "remove" });
|
|
152
|
-
const { runRemove } = await import("./remove-
|
|
152
|
+
const { runRemove } = await import("./remove-4jh862qa.js");
|
|
153
153
|
await runRemove(args);
|
|
154
154
|
} else if (command === "htmx") {
|
|
155
155
|
sendTelemetryEvent("cli:command", { command: "htmx" });
|
|
156
|
-
const { runHtmx } = await import("./htmx-
|
|
156
|
+
const { runHtmx } = await import("./htmx-26hs6jdm.js");
|
|
157
157
|
await runHtmx(args);
|
|
158
158
|
} else if (command === "env") {
|
|
159
159
|
sendTelemetryEvent("cli:command", { command: "env" });
|
|
@@ -176,7 +176,7 @@ if (command === "dev") {
|
|
|
176
176
|
await runLogs(args);
|
|
177
177
|
} else if (command === "doctor") {
|
|
178
178
|
sendTelemetryEvent("cli:command", { command: "doctor" });
|
|
179
|
-
const { runDoctor } = await import("./doctor-
|
|
179
|
+
const { runDoctor } = await import("./doctor-m36tmx4d.js");
|
|
180
180
|
await runDoctor(args);
|
|
181
181
|
} else if (command === "routes") {
|
|
182
182
|
sendTelemetryEvent("cli:command", { command: "routes" });
|
|
@@ -188,7 +188,7 @@ if (command === "dev") {
|
|
|
188
188
|
await runInspect(args);
|
|
189
189
|
} else if (command === "islands") {
|
|
190
190
|
sendTelemetryEvent("cli:command", { command: "islands" });
|
|
191
|
-
const { runIslands } = await import("./islands-
|
|
191
|
+
const { runIslands } = await import("./islands-vk05sj6v.js");
|
|
192
192
|
await runIslands(args);
|
|
193
193
|
} else if (command === "info") {
|
|
194
194
|
sendTelemetryEvent("cli:command", { command });
|
|
@@ -205,13 +205,13 @@ if (command === "dev") {
|
|
|
205
205
|
const configPath = parseNamedArg("--config");
|
|
206
206
|
const positionalArgs = stripNamedArgs("--outdir", "--outfile", "--config");
|
|
207
207
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
208
|
-
const { compile } = await import("./compile-
|
|
208
|
+
const { compile } = await import("./compile-n6fs2vmx.js");
|
|
209
209
|
await compile(serverEntry, outdir, outfile, configPath);
|
|
210
210
|
} else if (command === "mobile") {
|
|
211
211
|
sendTelemetryEvent("cli:command", {
|
|
212
212
|
command: `mobile:${workspaceCommand ?? "unknown"}`
|
|
213
213
|
});
|
|
214
|
-
const { runMobile } = await import("./mobile-
|
|
214
|
+
const { runMobile } = await import("./mobile-62b6j3j7.js");
|
|
215
215
|
try {
|
|
216
216
|
await runMobile(args);
|
|
217
217
|
} catch (error) {
|
|
@@ -221,7 +221,7 @@ if (command === "dev") {
|
|
|
221
221
|
} else if (command === "typecheck") {
|
|
222
222
|
sendTelemetryEvent("cli:command", { command });
|
|
223
223
|
const configPath = parseNamedArg("--config");
|
|
224
|
-
const { typecheck } = await import("./typecheck-
|
|
224
|
+
const { typecheck } = await import("./typecheck-7fvww3b7.js");
|
|
225
225
|
await typecheck(configPath);
|
|
226
226
|
} else if (command === "migrate") {
|
|
227
227
|
sendTelemetryEvent("cli:command", { command });
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import
|
|
3
|
-
getIslandManifestKey,
|
|
4
|
-
loadIslandRegistryBuildInfo
|
|
5
|
-
} from "./index-z794p5qg.js";
|
|
2
|
+
import"./index-4j1twret.js";
|
|
6
3
|
import {
|
|
7
4
|
loadConfig
|
|
8
5
|
} from "./index-wk0pyxrg.js";
|
|
@@ -14,6 +11,10 @@ import {
|
|
|
14
11
|
import {
|
|
15
12
|
formatBytes
|
|
16
13
|
} from "./index-7854xf0m.js";
|
|
14
|
+
import {
|
|
15
|
+
getIslandManifestKey,
|
|
16
|
+
loadIslandRegistryBuildInfo
|
|
17
|
+
} from "./index-mqevg32w.js";
|
|
17
18
|
|
|
18
19
|
// src/cli/scripts/islands.ts
|
|
19
20
|
import { existsSync as existsSync2, readFileSync as readFileSync2, statSync } from "fs";
|
|
@@ -26,11 +26,12 @@ import {
|
|
|
26
26
|
renderAbsoluteMobileBrandingPreview,
|
|
27
27
|
writeAbsoluteExpoProject2,
|
|
28
28
|
syncAbsoluteExpoWebAssets2
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-cksezef8.js";
|
|
30
30
|
import {
|
|
31
31
|
projectUsesAbsoluteAuth2,
|
|
32
32
|
projectUsesAbsoluteSync2
|
|
33
33
|
} from "./index-pch0v1z6.js";
|
|
34
|
+
import"./index-4j1twret.js";
|
|
34
35
|
import {
|
|
35
36
|
normalizeAbsoluteMobileConfig2
|
|
36
37
|
} from "./index-t7yf3vxs.js";
|
|
@@ -62,7 +63,7 @@ import {
|
|
|
62
63
|
resolveAbsoluteMobileRoute,
|
|
63
64
|
ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
|
|
64
65
|
ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT
|
|
65
|
-
} from "./index-
|
|
66
|
+
} from "./index-zyd80s3h.js";
|
|
66
67
|
import {
|
|
67
68
|
buildAbsoluteExpoAndroidWslBundle2
|
|
68
69
|
} from "./index-3sfcmb49.js";
|
|
@@ -76,10 +77,9 @@ import {
|
|
|
76
77
|
parseIosSimulators2,
|
|
77
78
|
repairAbsoluteIosDevSession2
|
|
78
79
|
} from "./index-prza6tkp.js";
|
|
79
|
-
import"./index-z794p5qg.js";
|
|
80
80
|
import {
|
|
81
81
|
start2
|
|
82
|
-
} from "./index-
|
|
82
|
+
} from "./index-bhyd3ejc.js";
|
|
83
83
|
import {
|
|
84
84
|
captureAbsoluteRemoteMacCommand2,
|
|
85
85
|
getAbsoluteRemoteMacProfile2,
|
|
@@ -99,6 +99,7 @@ import {
|
|
|
99
99
|
import {
|
|
100
100
|
formatBytes
|
|
101
101
|
} from "./index-7854xf0m.js";
|
|
102
|
+
import"./index-mqevg32w.js";
|
|
102
103
|
import {
|
|
103
104
|
sendTelemetryEvent
|
|
104
105
|
} from "./index-qyxd5n9a.js";
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import"./index-4j1twret.js";
|
|
2
3
|
import {
|
|
3
4
|
isFrameworkKey,
|
|
4
5
|
frameworks,
|
|
5
6
|
resolveProject
|
|
6
|
-
} from "./index-
|
|
7
|
-
import {
|
|
8
|
-
applyAbsoluteConfigEdit
|
|
9
|
-
} from "./index-b1wht4q5.js";
|
|
7
|
+
} from "./index-enbw9484.js";
|
|
10
8
|
import"./index-wk0pyxrg.js";
|
|
11
9
|
import"./index-t8jmj8w1.js";
|
|
12
10
|
import {
|
|
13
11
|
findRoutingFile
|
|
14
|
-
} from "./index-
|
|
12
|
+
} from "./index-23hvdyxf.js";
|
|
15
13
|
import {
|
|
16
14
|
colors
|
|
17
15
|
} from "./index-9djrap79.js";
|
|
16
|
+
import {
|
|
17
|
+
applyAbsoluteConfigEdit
|
|
18
|
+
} from "./index-kes8he5s.js";
|
|
18
19
|
import {
|
|
19
20
|
frameworkDependencyNames
|
|
20
21
|
} from "./index-jjfbjv1z.js";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
start2
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-bhyd3ejc.js";
|
|
5
|
+
import"./index-zyd80s3h.js";
|
|
6
|
+
import"./index-mqevg32w.js";
|
|
7
7
|
import"./index-71gchbzt.js";
|
|
8
8
|
import"./index-wk0pyxrg.js";
|
|
9
9
|
import"./index-qyxd5n9a.js";
|
|
10
10
|
import"./index-43a1vvb7.js";
|
|
11
11
|
import"./index-t7yf3vxs.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-cksezef8.js";
|
|
13
|
+
import"./index-4j1twret.js";
|
|
13
14
|
import"./index-pch0v1z6.js";
|
|
14
15
|
import"./index-125cfzvn.js";
|
|
15
16
|
import"./index-3ewt17wm.js";
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
loadConfig,
|
|
6
6
|
loadRawConfig
|
|
7
7
|
} from "./index-wk0pyxrg.js";
|
|
8
|
+
import {
|
|
9
|
+
lazyTypescript
|
|
10
|
+
} from "./index-4j1twret.js";
|
|
8
11
|
import {
|
|
9
12
|
ANSI_ESCAPE_CODE
|
|
10
13
|
} from "./index-t8jmj8w1.js";
|
|
@@ -831,24 +834,23 @@ var ParseErrorCode;
|
|
|
831
834
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
832
835
|
|
|
833
836
|
// src/dev/importCost/deferability.ts
|
|
834
|
-
import ts from "typescript";
|
|
835
837
|
var DEFERRED = "deferred";
|
|
836
838
|
var scriptKindFor = (fileName) => {
|
|
837
839
|
if (fileName.endsWith(".tsx"))
|
|
838
|
-
return
|
|
840
|
+
return lazyTypescript.ScriptKind.TSX;
|
|
839
841
|
if (fileName.endsWith(".jsx"))
|
|
840
|
-
return
|
|
842
|
+
return lazyTypescript.ScriptKind.JSX;
|
|
841
843
|
if (fileName.endsWith(".js") || fileName.endsWith(".mjs")) {
|
|
842
|
-
return
|
|
844
|
+
return lazyTypescript.ScriptKind.JS;
|
|
843
845
|
}
|
|
844
|
-
return
|
|
846
|
+
return lazyTypescript.ScriptKind.TS;
|
|
845
847
|
};
|
|
846
848
|
var namedBindings = (clause) => {
|
|
847
849
|
const names = clause.name === undefined ? [] : [clause.name.text];
|
|
848
850
|
const { namedBindings: bindings } = clause;
|
|
849
851
|
if (bindings === undefined)
|
|
850
852
|
return names;
|
|
851
|
-
if (
|
|
853
|
+
if (lazyTypescript.isNamespaceImport(bindings))
|
|
852
854
|
return [...names, bindings.name.text];
|
|
853
855
|
return [
|
|
854
856
|
...names,
|
|
@@ -857,20 +859,20 @@ var namedBindings = (clause) => {
|
|
|
857
859
|
};
|
|
858
860
|
var declarationFrom = (statement, source) => {
|
|
859
861
|
const specifier = statement.moduleSpecifier;
|
|
860
|
-
if (!
|
|
862
|
+
if (!lazyTypescript.isStringLiteral(specifier))
|
|
861
863
|
return null;
|
|
862
864
|
const clause = statement.importClause;
|
|
863
865
|
const bindings = clause === undefined ? [] : namedBindings(clause);
|
|
864
866
|
const declaration = {
|
|
865
867
|
bindings,
|
|
866
|
-
line:
|
|
868
|
+
line: lazyTypescript.getLineAndCharacterOfPosition(source, statement.getStart(source)).line + 1,
|
|
867
869
|
sideEffect: clause === undefined,
|
|
868
870
|
specifier: specifier.text,
|
|
869
871
|
typeOnly: clause !== undefined && (clause.isTypeOnly || bindings.length === 0)
|
|
870
872
|
};
|
|
871
873
|
return declaration;
|
|
872
874
|
};
|
|
873
|
-
var isTypePosition = (node) =>
|
|
875
|
+
var isTypePosition = (node) => lazyTypescript.isTypeNode(node) && !lazyTypescript.isExpressionWithTypeArguments(node);
|
|
874
876
|
var isDeferredPosition = (current, child) => {
|
|
875
877
|
if (Reflect.get(current, "body") === child)
|
|
876
878
|
return true;
|
|
@@ -878,19 +880,19 @@ var isDeferredPosition = (current, child) => {
|
|
|
878
880
|
return Array.isArray(parameters) && parameters.some((parameter) => parameter === child);
|
|
879
881
|
};
|
|
880
882
|
var classifyAncestor = (current, child) => {
|
|
881
|
-
if (
|
|
883
|
+
if (lazyTypescript.isExportSpecifier(current))
|
|
882
884
|
return "re-exported by the entry";
|
|
883
|
-
if (
|
|
885
|
+
if (lazyTypescript.isDecorator(current))
|
|
884
886
|
return "decorator";
|
|
885
|
-
if (
|
|
887
|
+
if (lazyTypescript.isPropertyDeclaration(current) && current.initializer === child) {
|
|
886
888
|
return "class field initializer";
|
|
887
889
|
}
|
|
888
890
|
if (isTypePosition(current))
|
|
889
891
|
return DEFERRED;
|
|
890
|
-
if (
|
|
892
|
+
if (lazyTypescript.isFunctionLike(current) && isDeferredPosition(current, child)) {
|
|
891
893
|
return DEFERRED;
|
|
892
894
|
}
|
|
893
|
-
if (
|
|
895
|
+
if (lazyTypescript.isSourceFile(current))
|
|
894
896
|
return "module scope";
|
|
895
897
|
return null;
|
|
896
898
|
};
|
|
@@ -910,9 +912,9 @@ var classifyUsage = (node) => {
|
|
|
910
912
|
return pending ?? "module scope";
|
|
911
913
|
};
|
|
912
914
|
var isDeclarationName = (parent, node) => {
|
|
913
|
-
if (
|
|
915
|
+
if (lazyTypescript.isExportSpecifier(parent))
|
|
914
916
|
return false;
|
|
915
|
-
if (
|
|
917
|
+
if (lazyTypescript.isShorthandPropertyAssignment(parent))
|
|
916
918
|
return false;
|
|
917
919
|
return Reflect.get(parent, "name") === node;
|
|
918
920
|
};
|
|
@@ -920,7 +922,7 @@ var isReferencePosition = (node) => {
|
|
|
920
922
|
const { parent } = node;
|
|
921
923
|
if (parent === undefined)
|
|
922
924
|
return false;
|
|
923
|
-
if (
|
|
925
|
+
if (lazyTypescript.isQualifiedName(parent) && parent.right === node)
|
|
924
926
|
return false;
|
|
925
927
|
return !isDeclarationName(parent, node);
|
|
926
928
|
};
|
|
@@ -937,13 +939,13 @@ var recordUsage = (node, owners, reasons) => {
|
|
|
937
939
|
var collectUnsafeReasons = (source, owners) => {
|
|
938
940
|
const reasons = new Map;
|
|
939
941
|
const visit = (node) => {
|
|
940
|
-
if (
|
|
942
|
+
if (lazyTypescript.isImportDeclaration(node))
|
|
941
943
|
return;
|
|
942
|
-
if (
|
|
944
|
+
if (lazyTypescript.isIdentifier(node))
|
|
943
945
|
recordUsage(node, owners, reasons);
|
|
944
|
-
|
|
946
|
+
lazyTypescript.forEachChild(node, visit);
|
|
945
947
|
};
|
|
946
|
-
|
|
948
|
+
lazyTypescript.forEachChild(source, visit);
|
|
947
949
|
return reasons;
|
|
948
950
|
};
|
|
949
951
|
var verdictFor = (declaration, reason) => {
|
|
@@ -957,12 +959,12 @@ var verdictFor = (declaration, reason) => {
|
|
|
957
959
|
};
|
|
958
960
|
var reExportOf = (statement, source) => {
|
|
959
961
|
const specifier = statement.moduleSpecifier;
|
|
960
|
-
if (specifier === undefined || !
|
|
962
|
+
if (specifier === undefined || !lazyTypescript.isStringLiteral(specifier))
|
|
961
963
|
return null;
|
|
962
964
|
if (statement.isTypeOnly)
|
|
963
965
|
return null;
|
|
964
966
|
const entry = {
|
|
965
|
-
line:
|
|
967
|
+
line: lazyTypescript.getLineAndCharacterOfPosition(source, statement.getStart(source)).line + 1,
|
|
966
968
|
reason: "re-exported by the entry",
|
|
967
969
|
specifier: specifier.text,
|
|
968
970
|
verdict: "used at module scope"
|
|
@@ -970,9 +972,9 @@ var reExportOf = (statement, source) => {
|
|
|
970
972
|
return entry;
|
|
971
973
|
};
|
|
972
974
|
var analyzeEntryImports = (sourceText, fileName) => {
|
|
973
|
-
const source =
|
|
974
|
-
const declarations = source.statements.filter(
|
|
975
|
-
const reExports = source.statements.filter(
|
|
975
|
+
const source = lazyTypescript.createSourceFile(fileName, sourceText, lazyTypescript.ScriptTarget.ESNext, true, scriptKindFor(fileName));
|
|
976
|
+
const declarations = source.statements.filter(lazyTypescript.isImportDeclaration).map((statement) => declarationFrom(statement, source)).filter((declaration) => declaration !== null);
|
|
977
|
+
const reExports = source.statements.filter(lazyTypescript.isExportDeclaration).map((statement) => reExportOf(statement, source)).filter((entry) => entry !== null);
|
|
976
978
|
const owners = new Map;
|
|
977
979
|
declarations.forEach((declaration, index) => {
|
|
978
980
|
for (const binding of declaration.bindings)
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/utils/runtimeMode.ts
|
|
3
|
-
var ENV_VAR = "NODE_ENV", getNodeEnv = () => process.env[ENV_VAR], isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
|
|
4
|
-
|
|
5
2
|
// src/core/streamingSlotRegistrar.ts
|
|
6
3
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
7
4
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
@@ -43,7 +40,7 @@ var setStreamingSlotWarningController = (controller) => {
|
|
|
43
40
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
|
|
44
41
|
};
|
|
45
42
|
var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
46
|
-
if (
|
|
43
|
+
if (isStreamingSlotCollectionActive()) {
|
|
47
44
|
return;
|
|
48
45
|
}
|
|
49
46
|
getWarningController()?.maybeWarn(primitiveName);
|
|
@@ -58,5 +55,5 @@ export {
|
|
|
58
55
|
warnMissingStreamingSlotCollector
|
|
59
56
|
};
|
|
60
57
|
|
|
61
|
-
//# debugId=
|
|
58
|
+
//# debugId=B814AB4D54EB8FE164756E2164756E21
|
|
62
59
|
//# sourceMappingURL=streamingSlotRegistrar.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
3
|
+
"sources": ["../src/core/streamingSlotRegistrar.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"
|
|
6
|
-
"import { isProductionRuntime } from '../utils/runtimeMode';\nimport type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isProductionRuntime() || isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n"
|
|
5
|
+
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\n/* Warns in production too: a slot that silently stays on its fallback is\n * worse there. The controller logs each distinct warning once per process\n * in production. */\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n"
|
|
7
6
|
],
|
|
8
|
-
"mappings": ";;
|
|
9
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;AAUA,IAAM,+BAA+B,OAAO,IAC3C,mCACD;AACA,IAAM,qCAAqC,OAAO,IACjD,2CACD;AACA,IAAM,wCAAwC,OAAO,IACpD,8CACD;AAEA,IAAM,sCAAsC,MAAM;AAAA,EACjD,MAAM,QAAQ,QAAQ,IAAI,YAAY,4BAA4B;AAAA,EAClE,IAAI,OAAO,UAAU,cAAc,UAAU,MAAM;AAAA,IAClD,OAAO;AAAA,EACR;AAAA,EAEA;AAAA;AAGD,IAAM,iBAAiB,CAAC,UACvB,QAAQ,KAAK,KAAK,OAAO,UAAU;AAEpC,IAAM,mCAAmC,CACxC,UAEA,eAAe,KAAK,MACpB,eAAe,UACf,OAAO,MAAM,cAAc;AAE5B,IAAM,sCAAsC,CAC3C,UAEA,eAAe,KAAK,MACpB,kBAAkB,UAClB,OAAO,MAAM,iBAAiB;AAE/B,IAAM,uBAAuB,MAAM;AAAA,EAClC,MAAM,QAAQ,QAAQ,IAAI,YAAY,kCAAkC;AAAA,EACxE,IAAI,UAAU,QAAQ,OAAO,UAAU;AAAA,IAAa;AAAA,EAEpD,OAAO,iCAAiC,KAAK,IAAI,QAAQ;AAAA;AAG1D,IAAM,0BAA0B,MAAM;AAAA,EACrC,MAAM,QAAQ,QAAQ,IACrB,YACA,qCACD;AAAA,EACA,IAAI,UAAU,QAAQ,OAAO,UAAU;AAAA,IAAa;AAAA,EAEpD,OAAO,oCAAoC,KAAK,IAAI,QAAQ;AAAA;AAGtD,IAAM,sCAAsC,MAClD,OAAO,oCAAoC,MAAM;AAC3C,IAAM,kCAAkC,MAC9C,wBAAwB,GAAG,aAAa,MAAM;AACxC,IAAM,wBAAwB,CAAC,SAAwB;AAAA,EAC7D,oCAAoC,IAAI,IAAI;AAAA;AAEtC,IAAM,uCAAuC,CACnD,eACI;AAAA,EACJ,QAAQ,IAAI,YAAY,uCAAuC,UAAU;AAAA;AAEnE,IAAM,4BAA4B,CACxC,kBACI;AAAA,EACJ,QAAQ,IAAI,YAAY,8BAA8B,aAAa;AAAA;AAE7D,IAAM,oCAAoC,CAChD,eACI;AAAA,EACJ,QAAQ,IAAI,YAAY,oCAAoC,UAAU;AAAA;AAKhE,IAAM,oCAAoC,CAAC,kBAA0B;AAAA,EAC3E,IAAI,gCAAgC,GAAG;AAAA,IACtC;AAAA,EACD;AAAA,EAEA,qBAAqB,GAAG,UAAU,aAAa;AAAA;",
|
|
8
|
+
"debugId": "B814AB4D54EB8FE164756E2164756E21",
|
|
10
9
|
"names": []
|
|
11
10
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/utils/runtimeMode.ts
|
|
3
|
-
var ENV_VAR = "NODE_ENV", getNodeEnv = () => process.env[ENV_VAR], isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
|
|
4
|
-
|
|
5
2
|
// src/core/streamingSlotRegistrar.ts
|
|
6
3
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
7
4
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
@@ -43,7 +40,7 @@ var setStreamingSlotWarningController = (controller) => {
|
|
|
43
40
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
|
|
44
41
|
};
|
|
45
42
|
var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
46
|
-
if (
|
|
43
|
+
if (isStreamingSlotCollectionActive()) {
|
|
47
44
|
return;
|
|
48
45
|
}
|
|
49
46
|
getWarningController()?.maybeWarn(primitiveName);
|
|
@@ -114,5 +111,5 @@ export {
|
|
|
114
111
|
runWithStreamingSlotRegistry
|
|
115
112
|
};
|
|
116
113
|
|
|
117
|
-
//# debugId=
|
|
114
|
+
//# debugId=0132C30F715579BD64756E2164756E21
|
|
118
115
|
//# sourceMappingURL=streamingSlotRegistry.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
3
|
+
"sources": ["../src/core/streamingSlotRegistrar.ts", "../src/core/streamingSlotRegistry.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"
|
|
6
|
-
"import { isProductionRuntime } from '../utils/runtimeMode';\nimport type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isProductionRuntime() || isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
|
|
5
|
+
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\n/* Warns in production too: a slot that silently stays on its fallback is\n * worse there. The controller logs each distinct warning once per process\n * in production. */\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (isStreamingSlotCollectionActive()) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
|
|
7
6
|
"import type { StreamingSlot } from '../utils/streamingSlots';\nimport {\n\tsetStreamingSlotCollectionController,\n\tsetStreamingSlotRegistrar\n} from './streamingSlotRegistrar';\n\ntype SlotStore = Map<string, StreamingSlot>;\ntype AsyncLocalStorageType =\n\timport('node:async_hooks').AsyncLocalStorage<SlotStore>;\n\nconst STREAMING_SLOT_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotAsyncLocalStorage'\n);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is AsyncLocalStorageType =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst getStorageGlobal = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn value;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst isServerRuntime = () =>\n\ttypeof process !== 'undefined' &&\n\ttypeof process.versions?.node === 'string';\n\nconst ensureAsyncLocalStorage = async () => {\n\tconst storage = getStorageGlobal();\n\tif (typeof storage !== 'undefined') {\n\t\treturn storage;\n\t}\n\tif (!isServerRuntime()) {\n\t\tReflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);\n\n\t\treturn getStorageGlobal();\n\t}\n\n\tconst mod = await import('node:async_hooks');\n\tReflect.set(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_STORAGE_KEY,\n\t\tnew mod.AsyncLocalStorage<SlotStore>()\n\t);\n\n\treturn getStorageGlobal();\n};\n\nconst getActiveSlotStore = () => {\n\tconst storage = getStorageGlobal();\n\tif (!storage) return undefined;\n\n\treturn storage.getStore();\n};\n\nconst registerStreamingSlot = (slot: StreamingSlot) => {\n\tconst store = getActiveSlotStore();\n\tif (!store) return;\n\tstore.set(slot.id, slot);\n};\n\nsetStreamingSlotRegistrar(registerStreamingSlot);\nsetStreamingSlotCollectionController({\n\tisCollecting: () => getActiveSlotStore() !== undefined\n});\n\nexport const hasActiveStreamingSlotRegistry = () =>\n\tgetActiveSlotStore() !== undefined;\n\nexport const runWithStreamingSlotRegistry = async <T>(\n\ttask: () => Promise<T> | T\n) => {\n\tconst storage = await ensureAsyncLocalStorage();\n\tif (!storage) {\n\t\tconst slots: StreamingSlot[] = [];\n\n\t\treturn {\n\t\t\tresult: await task(),\n\t\t\tslots\n\t\t};\n\t}\n\n\treturn storage.run(new Map<string, StreamingSlot>(), async () => {\n\t\tconst result = await task();\n\t\tconst store = storage.getStore();\n\n\t\treturn {\n\t\t\tresult,\n\t\t\tslots: store ? [...store.values()] : []\n\t\t};\n\t});\n};\n"
|
|
8
7
|
],
|
|
9
|
-
"mappings": ";;
|
|
10
|
-
"debugId": "
|
|
8
|
+
"mappings": "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",
|
|
9
|
+
"debugId": "0132C30F715579BD64756E2164756E21",
|
|
11
10
|
"names": []
|
|
12
11
|
}
|