github TanStack/db @tanstack/db-ivm@1.0.0-rc.1.5

pre-releaseone hour ago

Patch Changes

  • Avoid structural hashing on small Index buckets. A bucket of up to two values compares them with equalHashValues and promotes to a hashed map at the third value, which removes redundant hashing of large rows during incremental join updates. equalHashValues lists an object's keys natively and skips type tests for plain arrays and plain objects, and join reads each key's rows as an array instead of through nested generators. (#2488)

    Index, and so join and reduce, no longer merges two distinct values whose 32-bit hashes collide. An Index.addValue that throws leaves the entries and presence of its key unchanged. A cyclic or very deep value is rejected when a bucket first hashes it, at its third distinct value, where it was rejected at the second before. equalHashValues compares deeply nested values without overflowing the call stack.

    Two separate RegExp values with a NaN lastIndex now stay distinct in an Index, as equalHashValues already defined them. They merged before because their hashes are equal.

    Operators no longer take or store an id: the Operator, UnaryOperator, and BinaryOperator constructors lose their first parameter, and D2.getNextOperatorId is removed. Nothing read the id.

    structuralIdentity gives a RegExp whose lastIndex is not a primitive no identity, and hash refuses a RegExp whose lastIndex is a plain object with a TypeError, so groupBy no longer merges two such RegExps that D2 compares as different. The hash stream no longer writes a marker for null, so digest values differ from earlier versions; D2 value identity is unchanged. MultiSet.consolidate keeps two records of different structure apart when their digests collide.

    An Effect whose query graph step throws now reports the error once through onSourceError (or console.error without a handler) and disposes, as a live query does, instead of rerunning the graph over partly applied state.

  • Reduce the initial JavaScript download for eager React and Query DB apps. Load on-demand and persisted Query sync as needed. Preserve refetch settlement during startup and support built-in functions in manually constructed query expressions. (#2500)

Don't miss a new db release

NewReleases is sending notifications on new releases.