@absolutejs/absolute 0.19.0-beta.839 → 0.19.0-beta.840
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-Xw5PlA/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-Xw5PlA/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
48
48
|
getWarningController()?.maybeWarn(primitiveName);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// .angular-partial-tmp-
|
|
51
|
+
// .angular-partial-tmp-Xw5PlA/src/core/streamingSlotRegistry.ts
|
|
52
52
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
53
53
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
54
54
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
@@ -104,16 +104,23 @@
|
|
|
104
104
|
: null;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
// Recompute on every
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
// Recompute on every call rather than caching via $derived. SSR
|
|
108
|
+
// renders Routes in declaration order; each Route's template invokes
|
|
109
|
+
// `getActiveMatch()` immediately after registering itself, before its
|
|
110
|
+
// siblings have registered. A cached value would freeze on whichever
|
|
111
|
+
// Route triggered the computation first, so later-registered (more
|
|
112
|
+
// specific) Routes would lose. Calling `computeWinner()` afresh on
|
|
113
|
+
// every read sees the full registry by the time all Routes have
|
|
114
|
+
// rendered. Each call is O(N) over N routes; for typical pages
|
|
115
|
+
// (N < 20) the recomputation is negligible. Reactivity still works:
|
|
116
|
+
// each Route wraps the call in its own `$derived`, which tracks the
|
|
117
|
+
// `$state(routes)` and `page.url` reads inside `computeWinner`.
|
|
111
118
|
const registry: RouterRegistry = {
|
|
112
119
|
basepath: stackedBasepath,
|
|
113
120
|
deregister: (id) => {
|
|
114
121
|
routes.delete(id);
|
|
115
122
|
},
|
|
116
|
-
getActiveMatch: () =>
|
|
123
|
+
getActiveMatch: () => computeWinner(),
|
|
117
124
|
mode: stackedMode,
|
|
118
125
|
nextRouteId: () => `r${routeCounter++}`,
|
|
119
126
|
register: (id, entry) => {
|
package/package.json
CHANGED