Repository navigation
Commit e460c06
committed
fix: tighten ReactFireOptions generic types, remove T | any widening
Removes `| any` from `initialData` and `startWithValue`, so a value of the
wrong type is a TypeScript error rather than silently accepted. `T | any`
collapses to `any`, so the generic never enforced anything.
Tightens `checkIdField` to read `options?.idField` directly, and narrows
`checkOptions` / `checkinitialData` from `any` to `unknown`. Both are kept
as exports; removal is tracked in #754.
Adds casts at the rxfire `docData` / `collectionData` call sites, where
rxfire expects `keyof T` and the field is a plain string.
Adds `src/reactfire-options.type-test.ts`, five `@ts-expect-error`
assertions riding the existing `tsc --noEmit` CI, kept out of the tarball
by `.npmignore`. The negative-case consts are consumed so the directives
are load-bearing: without that, `noUnusedLocals` satisfies them with a
TS6133 and the file passes even if the tightening is reverted.
Breaking for the raw snapshot hooks: their correct `initialData` is a
`DocumentSnapshot<T>` / `QuerySnapshot<T>`, and the interface now says
`T`, so correct usage stops compiling. #741 tracks the real fix and is
required for 5.0.0.
Fixes #383.1 parent 0b70a12 commit e460c06
13 files changed
Lines changed: 169 additions & 25 deletions
File tree
- docs/reference
- classes
- functions
- interfaces
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments