Conversation
🦋 Changeset detectedLatest commit: e3609e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
8c77252 to
b011fe2
Compare
- Make indexing explicit with BasicIndex and BTreeIndex - autoIndex defaults to 'off', dev mode suggestions warn when indexes would help - New @tanstack/db/indexing entry point for tree-shakeable indexing - BasicIndex: lightweight Map + sorted Array for equality and range queries - BTreeIndex: full-featured O(log n) index for large collections - Fix pagination when indexes aren't available - Remove docs folder (now CI-generated) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b011fe2 to
9c047aa
Compare
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: +1.83 kB (+1.97%) Total Size: 95 kB
ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.85 kB ℹ️ View Unchanged
|
Tests added on main were calling createIndex() or using autoIndex: 'eager' without setting defaultIndexType, which is now required. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review SummaryOverall this is a well-designed simplification. Replacing Critical
This is a deliberately-requested feature that silently degrades. Consider throwing if (config.autoIndex === 'eager' && !config.defaultIndexType) {
throw new CollectionConfigurationError(
`autoIndex: 'eager' requires defaultIndexType to be set. ` +
`Import an index type and set it:\n` +
` import { BasicIndex } from '@tanstack/db/indexing'\n` +
` createCollection({ defaultIndexType: BasicIndex, autoIndex: 'eager', ... })`
)
}Important
Suggestions
Test Coverage Gaps
Strengths
|
Summary
Makes indexing explicit and opt-in rather than automatic, allowing users to choose the right index type for their use case and enabling better tree-shaking.
Based on #950 with the
ReadOptimizedIndex/WriteOptimizedIndexrenaming reverted — keeps the originalBasicIndex/BTreeIndexnames.Key changes
autoIndexnow defaults tooffinstead ofeagerBTreeIndexis no longer exported from@tanstack/dbmain entry point@tanstack/db/indexingentry point for tree-shakeable indexingcreateIndex()orautoIndex: 'eager', you must setdefaultIndexTypeon the collectionBundle size impact
Test plan
defaultIndexTypewhere needed🤖 Generated with Claude Code