Commit 316f9e2
committed
fix(signals): expose useSessionStorage as a bare window global
window.useLocalStorage was assigned and window.useSessionStorage was not, so
the two composables behaved differently depending on where they were called
from. Both are in STX_RUNTIME_GLOBALS, so a <script client> block receives
either through the setup destructure and the gap is invisible there — but code
reading the window global directly (a plain <script>, or a bundled module the
auto-import transform didn't rewrite) found useLocalStorage defined and
useSessionStorage undefined.
Covered in use-storage-guards.test.ts against both window and window.stx;
verified the assertion fails without the assignment.1 parent 4952707 commit 316f9e2
2 files changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5946 | 5946 | | |
5947 | 5947 | | |
5948 | 5948 | | |
| 5949 | + | |
| 5950 | + | |
| 5951 | + | |
| 5952 | + | |
| 5953 | + | |
| 5954 | + | |
5949 | 5955 | | |
5950 | 5956 | | |
5951 | 5957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
0 commit comments