Repository navigation
Commit 3e9a726
committed
fix(router): #582 reject "." in slot names + document prerender tag-union as by-design
loaderParentId (segment-system.tsx) strips a loader segment id from the first
`D<index>.` separator to recover its parent. That is only correct while slot
names contain no ".": a parallel/intercept slot named "@D3.foo" embeds as
`${shortCode}[email protected]`, so the regex mis-cuts at the slot's own "D3." and the
loader's data is silently dropped (a bare "D" like "@detail" is fine — no
trailing dot). Add assertValidSlotName in the parallel()/intercept() DSL helpers
to reject a "." at definition time with a clear error, turning a silent
tree-corruption into a loud failure, and note the invariant loaderParentId relies
on.
Also document (prerender-api-design.md) that the prerender serve path records no
cache({ tags }) into the document tag union on a hit — so a pre-rendered route's
document-cache entry is not reached by updateTag/revalidateTag. This is
intentional, not a gap: the baked payload is immutable until rebuild, so
invalidating the wrapper would only re-serve the identical body. Closes the
remaining #582 cross-seam item as by-design rather than implementing a no-op
tag-capture across the prerender artifact format.
Userland coverage through the public urls()/parallel()/intercept() DSL: a dotted
parallel slot and a dotted intercept slot both throw; a "@D3foo"/"@detail" name
(D+digits, no dot) is accepted (guard non-vacuity).1 parent cdddc25 commit 3e9a726
4 files changed
Lines changed: 90 additions & 1 deletion
File tree
- packages/rangojs-router
- docs
- src
- __tests__
- route-definition
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
394 | 403 | | |
395 | 404 | | |
396 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1045 | 1103 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
527 | 543 | | |
528 | 544 | | |
529 | 545 | | |
| |||
539 | 555 | | |
540 | 556 | | |
541 | 557 | | |
| 558 | + | |
542 | 559 | | |
543 | 560 | | |
544 | 561 | | |
| |||
698 | 715 | | |
699 | 716 | | |
700 | 717 | | |
| 718 | + | |
| 719 | + | |
701 | 720 | | |
702 | 721 | | |
703 | 722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
508 | 511 | | |
509 | 512 | | |
510 | 513 | | |
| |||
0 commit comments