fireproof-storage / fireproof

Realtime database, runs anywhere. Install Fireproof in your front-end app or edge function, and sync data via any backend.
https://fireproof.storage
Other
219 stars 16 forks source link

feat: adds further support for generics across type definitions #64

Closed thedanchez closed 5 months ago

thedanchez commented 5 months ago

Summary

After merging https://github.com/fireproof-storage/fireproof/pull/63, realized there was more to do on the type enhancement front to support generics across the @fireproof type definitions ecosystem.

Note

I used the SolidJS example from https://github.com/fireproof-storage/fireproof/pull/53 to test out the correctness of the type changes. I'm thinking we should probably expand the example further to flex more of the type definition areas to gain further confidence if we are wary of these changes in some regard.

thedanchez commented 5 months ago

I'm wondering if I should refactor things on the generics side to extend Record<string, DocFragment> instead of Record<string, unknown>.

thedanchez commented 5 months ago

I'm wondering if I should refactor things on the generics side to extend Record<string, DocFragment> instead of Record<string, unknown>.

@jchris any thoughts on this?

jchris commented 5 months ago

I think the idea of Record<string, DocFragment> is good -- DocFragment might get refined over time. It would be nice to get the_files behavior into the typedef

jchris commented 5 months ago

looks great! I will have to check to see that DocBody is backwards compatible with old apps but I'm guessing yes. Merging now.