@uniflowed/router 0.0.0-alpha.26 → 0.0.0-alpha.28
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/internal/runtime.js +13 -4
- package/package.json +3 -3
package/internal/runtime.js
CHANGED
|
@@ -1227,7 +1227,12 @@ async function resolveRoute(
|
|
|
1227
1227
|
// are: a slot is matched against the URL and depends on nothing the loader
|
|
1228
1228
|
// produces, so the second match and its imports overlap the first page's
|
|
1229
1229
|
// loader rather than following it.
|
|
1230
|
-
const slots = resolveSlots(
|
|
1230
|
+
const slots = resolveSlots(
|
|
1231
|
+
matched.route.slots ?? [],
|
|
1232
|
+
pathname,
|
|
1233
|
+
matched.route.layouts.length,
|
|
1234
|
+
matched.params,
|
|
1235
|
+
);
|
|
1231
1236
|
|
|
1232
1237
|
// The loader, run here and awaited below — or not awaited at all.
|
|
1233
1238
|
//
|
|
@@ -1311,17 +1316,21 @@ async function resolveSlots(
|
|
|
1311
1316
|
records: $ReadOnlyArray<SlotRecord>,
|
|
1312
1317
|
pathname: string,
|
|
1313
1318
|
layoutCount: number,
|
|
1319
|
+
fallbackParams: RouteParams,
|
|
1314
1320
|
): Promise<$ReadOnlyArray<ResolvedSlot>> {
|
|
1315
1321
|
if (records.length === 0) {
|
|
1316
1322
|
return [];
|
|
1317
1323
|
}
|
|
1318
|
-
return Promise.all(
|
|
1324
|
+
return Promise.all(
|
|
1325
|
+
records.map((record) => resolveSlot(record, pathname, layoutCount, fallbackParams)),
|
|
1326
|
+
);
|
|
1319
1327
|
}
|
|
1320
1328
|
|
|
1321
1329
|
async function resolveSlot(
|
|
1322
1330
|
record: SlotRecord,
|
|
1323
1331
|
pathname: string,
|
|
1324
1332
|
layoutCount: number,
|
|
1333
|
+
fallbackParams: RouteParams,
|
|
1325
1334
|
): Promise<ResolvedSlot> {
|
|
1326
1335
|
// Clamped exactly as a template's `above` is, and for the same reason: a
|
|
1327
1336
|
// hand-written table, or a `(group)` between the layout and the route, can
|
|
@@ -1331,7 +1340,7 @@ async function resolveSlot(
|
|
|
1331
1340
|
name: record.name,
|
|
1332
1341
|
above,
|
|
1333
1342
|
page: null,
|
|
1334
|
-
params:
|
|
1343
|
+
params: fallbackParams,
|
|
1335
1344
|
layouts: [],
|
|
1336
1345
|
slots: [],
|
|
1337
1346
|
};
|
|
@@ -1373,7 +1382,7 @@ async function resolveSlot(
|
|
|
1373
1382
|
layouts: loaded,
|
|
1374
1383
|
// The slot's own layouts are what a nested slot is measured against, so
|
|
1375
1384
|
// the count handed down is this slot's rather than the route's.
|
|
1376
|
-
slots: await resolveSlots(route.slots, pathname, loaded.length),
|
|
1385
|
+
slots: await resolveSlots(route.slots, pathname, loaded.length, matched.params),
|
|
1377
1386
|
};
|
|
1378
1387
|
}
|
|
1379
1388
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniflowed/router",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.28",
|
|
4
4
|
"description": "The file-system router for Flow React applications: matching, layouts, loaders, navigation, server rendering and hydration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react-dom": ">=19"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@uniflowed/hooks": "0.0.0-alpha.
|
|
38
|
-
"@uniflowed/server": "0.0.0-alpha.
|
|
37
|
+
"@uniflowed/hooks": "0.0.0-alpha.28",
|
|
38
|
+
"@uniflowed/server": "0.0.0-alpha.28"
|
|
39
39
|
}
|
|
40
40
|
}
|