Repository navigation
Commit 11aac86
committed
docs(upgrade-guide): correct the non-suspense behavior, and restore useUser coverage
Both from Armando's review.
The guide said the components "only ever worked with suspense={true}, and in
non-suspense mode they logged a deprecation warning and rendered anyway".
Wrong in both halves, and wrong in opposite directions. Rendered each shape
against v5:
- Plain AuthCheck worked in non-suspense mode, warning aside.
- AuthCheck with requiredClaims warned, then threw.
- ClaimsCheck alone threw before reaching its warning, so those users may
have seen no warning at all.
The person most exposed is the one running plain AuthCheck without suspense.
Their app works today, the old text told them it never did, so they would
skip the entry and hit a load-time break.
The SigninGate stand-in now uses useUser rather than useSigninCheck, so the
tests inside describe('useUser') cover useUser again. Verified both ways:
with the gate on useSigninCheck, making useUser throw left the navigating-away
test passing while the same mutation failed it on v5. With the gate on
useUser it fails again. Suite is 12/12, both typechecks clean.
Also from the review: the migration sample guarded loading and then read
signInCheckResult.signedIn, which throws a TypeError when the observable
errors before its first emission, since ObservableStatus declares data: T
rather than a discriminated union. It now destructures error and checks
status === 'error'.1 parent fc8d838 commit 11aac86
2 files changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments