@absolutejs/absolute 0.19.0-beta.695 → 0.19.0-beta.696
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/README.md +1 -1
- package/dist/angular/browser.js +48 -40
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/index.js +2308 -2232
- package/dist/angular/index.js.map +14 -13
- package/dist/angular/server.js +2279 -2203
- package/dist/angular/server.js.map +14 -14
- package/dist/build.js +42796 -6393
- package/dist/build.js.map +8 -19
- package/dist/cli/index.js +1 -1
- package/dist/core/streamingSlotRegistrar.js +24 -16
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +42 -29
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/index.js +42693 -5631
- package/dist/index.js.map +18 -23
- package/dist/react/components/index.js +24 -16
- package/dist/react/components/index.js.map +2 -2
- package/dist/react/index.js +922 -868
- package/dist/react/index.js.map +12 -12
- package/dist/react/server.js +903 -848
- package/dist/react/server.js.map +11 -11
- package/dist/src/build/compileTailwind.d.ts +3 -0
- package/dist/src/core/pageHandlers.d.ts +0 -2
- package/dist/src/core/ssrCache.d.ts +3 -0
- package/dist/svelte/index.js +963 -899
- package/dist/svelte/index.js.map +14 -13
- package/dist/svelte/server.js +777 -712
- package/dist/svelte/server.js.map +12 -12
- package/dist/types/build.d.ts +5 -4
- package/dist/types/index.d.ts +0 -1
- package/dist/types/island.d.ts +14 -11
- package/dist/vue/components/index.js +24 -16
- package/dist/vue/components/index.js.map +2 -2
- package/dist/vue/index.js +1040 -976
- package/dist/vue/index.js.map +12 -12
- package/dist/vue/server.js +908 -841
- package/dist/vue/server.js.map +11 -11
- package/package.json +16 -8
package/dist/cli/index.js
CHANGED
|
@@ -2046,7 +2046,7 @@ var info = () => {
|
|
|
2046
2046
|
field("vue", getPackageVersion("vue"));
|
|
2047
2047
|
field("typescript", getPackageVersion("typescript"));
|
|
2048
2048
|
field("tailwindcss", getPackageVersion("tailwindcss"));
|
|
2049
|
-
field("
|
|
2049
|
+
field("bun-plugin-tailwind", getPackageVersion("bun-plugin-tailwind"));
|
|
2050
2050
|
lines.push("");
|
|
2051
2051
|
console.log("");
|
|
2052
2052
|
console.log(lines.join(`
|
|
@@ -79,43 +79,51 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
|
79
79
|
var __require = import.meta.require;
|
|
80
80
|
|
|
81
81
|
// src/core/streamingSlotRegistrar.ts
|
|
82
|
-
var STREAMING_SLOT_REGISTRAR_KEY
|
|
82
|
+
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
83
|
+
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
84
|
+
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
85
|
+
var getRegisteredStreamingSlotRegistrar = () => {
|
|
83
86
|
const value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);
|
|
84
87
|
if (typeof value === "function" || value === null) {
|
|
85
88
|
return value;
|
|
86
89
|
}
|
|
87
90
|
return;
|
|
88
|
-
}
|
|
91
|
+
};
|
|
92
|
+
var isObjectRecord = (value) => Boolean(value) && typeof value === "object";
|
|
93
|
+
var isStreamingSlotWarningController = (value) => isObjectRecord(value) && ("maybeWarn" in value) && typeof value.maybeWarn === "function";
|
|
94
|
+
var isStreamingSlotCollectionController = (value) => isObjectRecord(value) && ("isCollecting" in value) && typeof value.isCollecting === "function";
|
|
95
|
+
var getWarningController = () => {
|
|
89
96
|
const value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);
|
|
90
97
|
if (value === null || typeof value === "undefined")
|
|
91
98
|
return;
|
|
92
99
|
return isStreamingSlotWarningController(value) ? value : undefined;
|
|
93
|
-
}
|
|
100
|
+
};
|
|
101
|
+
var getCollectionController = () => {
|
|
94
102
|
const value = Reflect.get(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY);
|
|
95
103
|
if (value === null || typeof value === "undefined")
|
|
96
104
|
return;
|
|
97
105
|
return isStreamingSlotCollectionController(value) ? value : undefined;
|
|
98
|
-
}
|
|
106
|
+
};
|
|
107
|
+
var hasRegisteredStreamingSlotRegistrar = () => typeof getRegisteredStreamingSlotRegistrar() === "function";
|
|
108
|
+
var isStreamingSlotCollectionActive = () => getCollectionController()?.isCollecting() === true;
|
|
109
|
+
var registerStreamingSlot = (slot) => {
|
|
99
110
|
getRegisteredStreamingSlotRegistrar()?.(slot);
|
|
100
|
-
}
|
|
111
|
+
};
|
|
112
|
+
var setStreamingSlotCollectionController = (controller) => {
|
|
101
113
|
Reflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);
|
|
102
|
-
}
|
|
114
|
+
};
|
|
115
|
+
var setStreamingSlotRegistrar = (nextRegistrar) => {
|
|
103
116
|
Reflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);
|
|
104
|
-
}
|
|
117
|
+
};
|
|
118
|
+
var setStreamingSlotWarningController = (controller) => {
|
|
105
119
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
|
|
106
|
-
}
|
|
120
|
+
};
|
|
121
|
+
var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
107
122
|
if (isStreamingSlotCollectionActive()) {
|
|
108
123
|
return;
|
|
109
124
|
}
|
|
110
125
|
getWarningController()?.maybeWarn(primitiveName);
|
|
111
126
|
};
|
|
112
|
-
var init_streamingSlotRegistrar = __esm(() => {
|
|
113
|
-
STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
114
|
-
STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
115
|
-
STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
116
|
-
});
|
|
117
|
-
init_streamingSlotRegistrar();
|
|
118
|
-
|
|
119
127
|
export {
|
|
120
128
|
warnMissingStreamingSlotCollector,
|
|
121
129
|
setStreamingSlotWarningController,
|
|
@@ -126,5 +134,5 @@ export {
|
|
|
126
134
|
hasRegisteredStreamingSlotRegistrar
|
|
127
135
|
};
|
|
128
136
|
|
|
129
|
-
//# debugId=
|
|
137
|
+
//# debugId=345CD8457628A71164756E2164756E21
|
|
130
138
|
//# sourceMappingURL=streamingSlotRegistrar.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
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};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (\n\t\tprocess.env.NODE_ENV === 'production' ||\n\t\tisStreamingSlotCollectionActive()\n\t) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";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CAAuC,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;AAEhE,IAAM,oCAAoC,CAAC,kBAA0B;AAAA,EAC3E,IAEC,gCAAgC,GAC/B;AAAA,IACD;AAAA,EACD;AAAA,EAEA,qBAAqB,GAAG,UAAU,aAAa;AAAA;",
|
|
8
|
+
"debugId": "345CD8457628A71164756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -79,50 +79,65 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
|
79
79
|
var __require = import.meta.require;
|
|
80
80
|
|
|
81
81
|
// src/core/streamingSlotRegistrar.ts
|
|
82
|
-
var STREAMING_SLOT_REGISTRAR_KEY
|
|
82
|
+
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
83
|
+
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
84
|
+
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
85
|
+
var getRegisteredStreamingSlotRegistrar = () => {
|
|
83
86
|
const value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);
|
|
84
87
|
if (typeof value === "function" || value === null) {
|
|
85
88
|
return value;
|
|
86
89
|
}
|
|
87
90
|
return;
|
|
88
|
-
}
|
|
91
|
+
};
|
|
92
|
+
var isObjectRecord = (value) => Boolean(value) && typeof value === "object";
|
|
93
|
+
var isStreamingSlotWarningController = (value) => isObjectRecord(value) && ("maybeWarn" in value) && typeof value.maybeWarn === "function";
|
|
94
|
+
var isStreamingSlotCollectionController = (value) => isObjectRecord(value) && ("isCollecting" in value) && typeof value.isCollecting === "function";
|
|
95
|
+
var getWarningController = () => {
|
|
89
96
|
const value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);
|
|
90
97
|
if (value === null || typeof value === "undefined")
|
|
91
98
|
return;
|
|
92
99
|
return isStreamingSlotWarningController(value) ? value : undefined;
|
|
93
|
-
}
|
|
100
|
+
};
|
|
101
|
+
var getCollectionController = () => {
|
|
94
102
|
const value = Reflect.get(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY);
|
|
95
103
|
if (value === null || typeof value === "undefined")
|
|
96
104
|
return;
|
|
97
105
|
return isStreamingSlotCollectionController(value) ? value : undefined;
|
|
98
|
-
}
|
|
106
|
+
};
|
|
107
|
+
var hasRegisteredStreamingSlotRegistrar = () => typeof getRegisteredStreamingSlotRegistrar() === "function";
|
|
108
|
+
var isStreamingSlotCollectionActive = () => getCollectionController()?.isCollecting() === true;
|
|
109
|
+
var registerStreamingSlot = (slot) => {
|
|
99
110
|
getRegisteredStreamingSlotRegistrar()?.(slot);
|
|
100
|
-
}
|
|
111
|
+
};
|
|
112
|
+
var setStreamingSlotCollectionController = (controller) => {
|
|
101
113
|
Reflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);
|
|
102
|
-
}
|
|
114
|
+
};
|
|
115
|
+
var setStreamingSlotRegistrar = (nextRegistrar) => {
|
|
103
116
|
Reflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);
|
|
104
|
-
}
|
|
117
|
+
};
|
|
118
|
+
var setStreamingSlotWarningController = (controller) => {
|
|
105
119
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
|
|
106
|
-
}
|
|
120
|
+
};
|
|
121
|
+
var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
107
122
|
if (isStreamingSlotCollectionActive()) {
|
|
108
123
|
return;
|
|
109
124
|
}
|
|
110
125
|
getWarningController()?.maybeWarn(primitiveName);
|
|
111
126
|
};
|
|
112
|
-
var init_streamingSlotRegistrar = __esm(() => {
|
|
113
|
-
STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
114
|
-
STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
115
|
-
STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
116
|
-
});
|
|
117
127
|
|
|
118
128
|
// src/core/streamingSlotRegistry.ts
|
|
119
|
-
var STREAMING_SLOT_STORAGE_KEY
|
|
129
|
+
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
130
|
+
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
131
|
+
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
132
|
+
var getStorageGlobal = () => {
|
|
120
133
|
const value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);
|
|
121
134
|
if (value === null || typeof value === "undefined") {
|
|
122
135
|
return value;
|
|
123
136
|
}
|
|
124
137
|
return isAsyncLocalStorage(value) ? value : undefined;
|
|
125
|
-
}
|
|
138
|
+
};
|
|
139
|
+
var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
140
|
+
var ensureAsyncLocalStorage = async () => {
|
|
126
141
|
const storage = getStorageGlobal();
|
|
127
142
|
if (typeof storage !== "undefined") {
|
|
128
143
|
return storage;
|
|
@@ -134,17 +149,25 @@ var STREAMING_SLOT_STORAGE_KEY, isObjectRecord2 = (value) => Boolean(value) && t
|
|
|
134
149
|
const mod = await import("async_hooks");
|
|
135
150
|
Reflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, new mod.AsyncLocalStorage);
|
|
136
151
|
return getStorageGlobal();
|
|
137
|
-
}
|
|
152
|
+
};
|
|
153
|
+
var getActiveSlotStore = () => {
|
|
138
154
|
const storage = getStorageGlobal();
|
|
139
155
|
if (!storage)
|
|
140
156
|
return;
|
|
141
157
|
return storage.getStore();
|
|
142
|
-
}
|
|
158
|
+
};
|
|
159
|
+
var registerStreamingSlot2 = (slot) => {
|
|
143
160
|
const store = getActiveSlotStore();
|
|
144
161
|
if (!store)
|
|
145
162
|
return;
|
|
146
163
|
store.set(slot.id, slot);
|
|
147
|
-
}
|
|
164
|
+
};
|
|
165
|
+
setStreamingSlotRegistrar(registerStreamingSlot2);
|
|
166
|
+
setStreamingSlotCollectionController({
|
|
167
|
+
isCollecting: () => getActiveSlotStore() !== undefined
|
|
168
|
+
});
|
|
169
|
+
var hasActiveStreamingSlotRegistry = () => getActiveSlotStore() !== undefined;
|
|
170
|
+
var runWithStreamingSlotRegistry = async (task) => {
|
|
148
171
|
const storage = await ensureAsyncLocalStorage();
|
|
149
172
|
if (!storage) {
|
|
150
173
|
const slots = [];
|
|
@@ -162,20 +185,10 @@ var STREAMING_SLOT_STORAGE_KEY, isObjectRecord2 = (value) => Boolean(value) && t
|
|
|
162
185
|
};
|
|
163
186
|
});
|
|
164
187
|
};
|
|
165
|
-
var init_streamingSlotRegistry = __esm(() => {
|
|
166
|
-
init_streamingSlotRegistrar();
|
|
167
|
-
STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
168
|
-
setStreamingSlotRegistrar(registerStreamingSlot2);
|
|
169
|
-
setStreamingSlotCollectionController({
|
|
170
|
-
isCollecting: () => getActiveSlotStore() !== undefined
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
init_streamingSlotRegistry();
|
|
174
|
-
|
|
175
188
|
export {
|
|
176
189
|
runWithStreamingSlotRegistry,
|
|
177
190
|
hasActiveStreamingSlotRegistry
|
|
178
191
|
};
|
|
179
192
|
|
|
180
|
-
//# debugId=
|
|
193
|
+
//# debugId=B49ED06B058CECE964756E2164756E21
|
|
181
194
|
//# sourceMappingURL=streamingSlotRegistry.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
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};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (\n\t\tprocess.env.NODE_ENV === 'production' ||\n\t\tisStreamingSlotCollectionActive()\n\t) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
|
|
6
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"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;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