-
Notifications
You must be signed in to change notification settings - Fork 161
Description
- I've validated the bug against the latest version of DB packages
Describe the bug
Hello 👋
While building app based on Electric I've spotted that utils on collection aren't typed correctly - they fall back to untyped UtilsRecord. Before just reporting it - I verified it for every built-in collection that has custom utils whether it works and found out that it doesn't for a few more collections.
It doesn't have utils (so it works correctly):
- RxDB collection
It works correctly for:
- Local Storage collection
- TanStack Query collection
Utils aren't typed correctly for:
- Local only collection
- Electric collection
- PowerSync collection
- Trailbase collection
I've created a reproduction including every single of the above collections (except of rxdb which doesn't have custom utils), so it's easy to verify:
https://github.com/pawelblaszczyk5/tanstack-db-missing-collection-utils/blob/main/src/test.ts
As you can see on above screenshot, a few of these has generic UtilsRecord instead of correctly typed ones.
To Reproduce
Steps to reproduce the behavior:
- Create Electric/Trailbase/PowerSync/localOnly collection
- Try to access utils
- Observe them being untyped (they're still there at runtime)
Expected behavior
Collection utils are correctly typed
Screenshots
Provided above
Desktop (please complete the following information):
- OS: N/A
- Browser N/A
- Version N/A
Smartphone (please complete the following information):
- Device: N/A
- OS: N/A
- Browser N/A
- Version N/A
Additional context
N/A