github TanStack/db @tanstack/db@0.2.0

latest releases: @tanstack/vue-db@0.0.48, @tanstack/trailbase-db-collection@0.1.15, @tanstack/svelte-db@0.1.15...
one day ago

Minor Changes

  • Enhanced Ref System with Nested Optional Properties (#386)

    Comprehensive refactor of the ref system to properly support nested structures and optionality, aligning the type system with JavaScript's optional chaining behavior.

    ✨ New Features

    • Nested Optional Properties: Full support for deeply nested optional objects (employees.profile?.bio, orders.customer?.address?.street)
    • Enhanced Type Safety: Optional types now correctly typed as RefProxy<T> | undefined with optionality outside the ref
    • New Query Functions: Added isUndefined, isNull for proper null/undefined checks
    • Improved JOIN Handling: Fixed optionality in JOIN operations and multiple GROUP BY support

    ⚠️ Breaking Changes

    IMPORTANT: Code that previously ignored optionality now requires proper optional chaining syntax.

    // Before (worked but type-unsafe)
    employees.profile.bio // ❌ Now throws type error
    
    // After (correct and type-safe)
    employees.profile?.bio // ✅ Required syntax

    Migration

    Add ?. when accessing potentially undefined nested properties

Patch Changes

  • fix count aggregate function (evaluate only not null field values like SQL count) (#453)

  • fix a bug where distinct was not applied to queries using a join (#510)

  • Fix bug where too much data would be loaded when the lazy collection of a join contains an offset and/or limit clause. (#508)

  • Refactored select improving spread (...obj) support and enabling nested projection. (#389)

  • fix a bug that prevented chaining joins (joining collectionB to collectionA, then collectionC to collectionB) within one query without using a subquery (#511)

  • Updated dependencies [08303e6, 0f6fb37, 0be4e2c]:

    • @tanstack/db-ivm@0.1.3

Don't miss a new db release

NewReleases is sending notifications on new releases.