Skip to content

Latest commit

 

History

History
387 lines (251 loc) · 13.2 KB

File metadata and controls

387 lines (251 loc) · 13.2 KB

examples/react/todo

0.1.1

Patch Changes

  • Updated dependencies [1220d7e]:
    • @tanstack/query-db-collection@0.2.0

0.1.0

Minor Changes

  • 0.1 release - first beta 🎉 (#332)

Patch Changes

  • Updated dependencies [7d2f4be, f0eda36]:
    • @tanstack/electric-db-collection@0.1.0
    • @tanstack/query-db-collection@0.1.0
    • @tanstack/react-db@0.1.0
    • @tanstack/trailbase-db-collection@0.1.0

0.0.39

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.15
    • @tanstack/query-db-collection@0.0.15
    • @tanstack/react-db@0.0.33
    • @tanstack/trailbase-db-collection@0.0.9

0.0.38

Patch Changes

  • Updated dependencies [e04bd12]:
    • @tanstack/query-db-collection@0.0.14
    • @tanstack/electric-db-collection@0.0.14
    • @tanstack/react-db@0.0.32
    • @tanstack/trailbase-db-collection@0.0.8

0.0.37

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.13
    • @tanstack/query-db-collection@0.0.13
    • @tanstack/react-db@0.0.31
    • @tanstack/trailbase-db-collection@0.0.7

0.0.36

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.12
    • @tanstack/query-db-collection@0.0.12
    • @tanstack/react-db@0.0.30
    • @tanstack/trailbase-db-collection@0.0.6

0.0.35

Patch Changes

  • Updated dependencies [5260ee3]:
    • @tanstack/trailbase-db-collection@0.0.5
    • @tanstack/electric-db-collection@0.0.11
    • @tanstack/query-db-collection@0.0.11
    • @tanstack/react-db@0.0.29

0.0.34

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.10
    • @tanstack/query-db-collection@0.0.10
    • @tanstack/react-db@0.0.28
    • @tanstack/trailbase-db-collection@0.0.4

0.0.33

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.9
    • @tanstack/query-db-collection@0.0.9
    • @tanstack/react-db@0.0.27
    • @tanstack/trailbase-db-collection@0.0.3

0.0.32

Patch Changes

  • Add initial release of TrailBase collection for TanStack DB. TrailBase is a blazingly fast, open-source alternative to Firebase built on Rust, SQLite, and V8. It provides type-safe REST and realtime APIs with sub-millisecond latencies, integrated authentication, and flexible access control - all in a single executable. This collection type enables seamless integration with TrailBase backends for high-performance real-time applications. (#228)

  • Updated dependencies [09c6995]:

    • @tanstack/trailbase-db-collection@0.0.2
    • @tanstack/electric-db-collection@0.0.8
    • @tanstack/query-db-collection@0.0.8
    • @tanstack/react-db@0.0.26

0.0.31

Patch Changes

  • Updated dependencies [20f810e]:
    • @tanstack/electric-db-collection@0.0.7
    • @tanstack/query-db-collection@0.0.7
    • @tanstack/react-db@0.0.25

0.0.30

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.6
    • @tanstack/query-db-collection@0.0.6
    • @tanstack/react-db@0.0.24

0.0.29

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.5
    • @tanstack/query-db-collection@0.0.5
    • @tanstack/react-db@0.0.23

0.0.28

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.0.4
    • @tanstack/query-db-collection@0.0.4
    • @tanstack/react-db@0.0.22

0.0.27

Patch Changes

  • Move Collections to their own packages (#252)

    • Move local-only and local-storage collections to main @tanstack/db package
    • Create new @tanstack/electric-db-collection package for ElectricSQL integration
    • Create new @tanstack/query-db-collection package for TanStack Query integration
    • Delete @tanstack/db-collections package (removed from repo)
    • Update example app and documentation to use new package structure

    Why?

    • Better separation of concerns
    • Independent versioning for each collection type
    • Cleaner dependencies (electric collections don't need query deps, etc.)
    • Easier to add more collection types moving forward
  • Updated dependencies [8e23322]:

    • @tanstack/electric-db-collection@0.0.3
    • @tanstack/query-db-collection@0.0.3
    • @tanstack/react-db@0.0.21

0.0.26

Patch Changes

  • Updated dependencies []:
    • @tanstack/db-collections@0.0.24
    • @tanstack/react-db@0.0.20

0.0.25

Patch Changes

    • [Breaking change for the Electric Collection]: Use numbers for txid (#245)
    • misc type fixes
  • Updated dependencies [9f0b0c2]:
    • @tanstack/db-collections@0.0.23
    • @tanstack/react-db@0.0.19

0.0.24

Patch Changes

  • Updated dependencies [266bd29]:
    • @tanstack/db-collections@0.0.22
    • @tanstack/react-db@0.0.18

0.0.23

Patch Changes

  • Updated dependencies [1c9e867]:
    • @tanstack/db-collections@0.0.21
    • @tanstack/react-db@0.0.17

0.0.22

Patch Changes

  • Updated dependencies [e478d53]:
    • @tanstack/react-db@0.0.16
    • @tanstack/db-collections@0.0.20

0.0.21

Patch Changes

  • Updated dependencies [0912a7c]:
    • @tanstack/db-collections@0.0.19
    • @tanstack/react-db@0.0.15

0.0.20

Patch Changes

  • Updated dependencies [0dede0a]:
    • @tanstack/db-collections@0.0.18

0.0.19

Patch Changes

  • Updated dependencies []:
    • @tanstack/db-collections@0.0.17
    • @tanstack/react-db@0.0.14

0.0.18

Patch Changes

  • Updated dependencies [945868e, 57b5f5d]:
    • @tanstack/react-db@0.0.13
    • @tanstack/db-collections@0.0.16

0.0.17

Patch Changes

  • Updated dependencies [5cafaf4]:
    • @tanstack/db-collections@0.0.15

0.0.16

Patch Changes

  • Updated dependencies [f6abe9b]:
    • @tanstack/db-collections@0.0.14
    • @tanstack/react-db@0.0.12

0.0.15

Patch Changes

  • Export ElectricCollectionUtils & allow passing generic to createTransaction (#179)

  • Updated dependencies [c5489ff]:

    • @tanstack/db-collections@0.0.13
    • @tanstack/react-db@0.0.11

0.0.14

Patch Changes

  • Updated dependencies []:
    • @tanstack/db-collections@0.0.12
    • @tanstack/react-db@0.0.10

0.0.13

Patch Changes

  • Updated dependencies []:
    • @tanstack/db-collections@0.0.11
    • @tanstack/react-db@0.0.9

0.0.12

Patch Changes

  • Type PendingMutation whenever possible (#163)

  • Updated dependencies [5c538cf, b4602a0]:

    • @tanstack/db-collections@0.0.10
    • @tanstack/react-db@0.0.8

0.0.11

Patch Changes

  • Updated dependencies [8b43ad3]:
    • @tanstack/db-collections@0.0.9
    • @tanstack/react-db@0.0.7

0.0.10

Patch Changes

  • This change introduces a more streamlined and intuitive API for handling mutations by allowing onInsert, onUpdate, and onDelete handlers to be defined directly on the collection configuration. (#156)

    When collection.insert(), .update(), or .delete() are called outside of an explicit transaction (i.e., not within useOptimisticMutation), the library now automatically creates a single-operation transaction and invokes the corresponding handler to persist the change.

    Key changes:

    • @tanstack/db: The Collection class now supports onInsert, onUpdate, and onDelete in its configuration. Direct calls to mutation methods will throw an error if the corresponding handler is not defined.
    • @tanstack/db-collections:
      • queryCollectionOptions now accepts the new handlers and will automatically refetch the collection's query after a handler successfully completes. This behavior can be disabled if the handler returns { refetch: false }.
      • electricCollectionOptions also accepts the new handlers. These handlers are now required to return an object with a transaction ID ({ txid: string }). The collection then automatically waits for this txid to be synced back before resolving the mutation, ensuring consistency.
    • Breaking Change: Calling collection.insert(), .update(), or .delete() without being inside a useOptimisticMutation callback and without a corresponding persistence handler (onInsert, etc.) configured on the collection will now throw an error.

    This new pattern simplifies the most common use cases, making the code more declarative. The useOptimisticMutation hook remains available for more complex scenarios, such as transactions involving multiple mutations across different collections.


    The documentation and the React Todo example application have been significantly refactored to adopt the new direct persistence handler pattern as the primary way to perform mutations.

    • The README.md and docs/overview.md files have been updated to de-emphasize useOptimisticMutation for simple writes. They now showcase the much simpler API of calling collection.insert() directly and defining persistence logic in the collection's configuration.
    • The React Todo example (examples/react/todo/src/App.tsx) has been completely overhauled. All instances of useOptimisticMutation have been removed and replaced with the new onInsert, onUpdate, and onDelete handlers, resulting in cleaner and more concise code.
  • Updated dependencies [80fdac7]:

    • @tanstack/db-collections@0.0.8
    • @tanstack/react-db@0.0.6

0.0.9

Patch Changes

  • Collections must have a getId function & use an id for update/delete operators (#134)

  • Switch to Collection options factories instead of extending the Collection class (#145)

    This refactors ElectricCollection and QueryCollection into factory functions (electricCollectionOptions and queryCollectionOptions) that return standard CollectionConfig objects and utility functions. Also adds a createCollection function to standardize collection instantiation.

  • Updated dependencies [1fbb844, ee5d026, e4feb0c]:

    • @tanstack/db-collections@0.0.7
    • @tanstack/react-db@0.0.5

0.0.8

Patch Changes

  • Updated dependencies []:
    • @tanstack/db-collections@0.0.6
    • @tanstack/react-db@0.0.4

0.0.7

Patch Changes

  • Updated dependencies [0bbf4c4]:
    • @tanstack/db-collections@0.0.5

0.0.6

Patch Changes

  • Updated dependencies [2d0fcf1]:
    • @tanstack/db-collections@0.0.4

0.0.5

Patch Changes

  • Updated dependencies []:
    • @tanstack/db-collections@0.0.3
    • @tanstack/react-db@0.0.3

0.0.4

Patch Changes

  • Updated dependencies [4c82edb, 4c82edb]:
    • @tanstack/react-db@0.0.2
    • @tanstack/db-collections@0.0.2

0.0.3

Patch Changes

  • Updated dependencies [b42479c]:
    • @tanstack/react-db@0.0.3

0.0.2

Patch Changes

  • Updated dependencies [9bb6e89]:
    • @tanstack/react-db@0.0.2