Skip to content

Commit feaba11

Browse files
ci: apply automated fixes
1 parent 79db466 commit feaba11

File tree

100 files changed

+773
-1973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+773
-1973
lines changed

.changeset/optional-indexing.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
---
2-
"@tanstack/db": minor
2+
'@tanstack/db': minor
33
---
44

55
Make indexing explicit with two index types for different use cases
66

77
**Breaking Changes:**
8+
89
- `autoIndex` now defaults to `off` instead of `eager`
910
- `BTreeIndex` is no longer exported from `@tanstack/db` main entry point
1011
- To use `createIndex()` or `autoIndex: 'eager'`, you must set `defaultIndexType` on the collection
1112

1213
**Changes:**
14+
1315
- New `@tanstack/db/indexing` entry point for tree-shakeable indexing
1416
- **BasicIndex** - Lightweight index using Map + sorted Array for both equality and range queries (`eq`, `in`, `gt`, `gte`, `lt`, `lte`). O(n) updates but fast reads.
1517
- **BTreeIndex** - Full-featured index with O(log n) updates and sorted iteration for ORDER BY optimization on large collections (10k+ items)
@@ -20,6 +22,7 @@ Make indexing explicit with two index types for different use cases
2022
If you were relying on auto-indexing, set `defaultIndexType` on your collections:
2123

2224
1. **Lightweight indexing** (good for most use cases):
25+
2326
```ts
2427
import { BasicIndex } from '@tanstack/db/indexing'
2528

@@ -31,6 +34,7 @@ const collection = createCollection({
3134
```
3235

3336
2. **Full BTree indexing** (for ORDER BY optimization on large collections):
37+
3438
```ts
3539
import { BTreeIndex } from '@tanstack/db/indexing'
3640

@@ -42,11 +46,12 @@ const collection = createCollection({
4246
```
4347

4448
3. **Per-index explicit type** (mix index types):
49+
4550
```ts
4651
import { BasicIndex, BTreeIndex } from '@tanstack/db/indexing'
4752

4853
const collection = createCollection({
49-
defaultIndexType: BasicIndex, // Default for createIndex()
54+
defaultIndexType: BasicIndex, // Default for createIndex()
5055
// ...
5156
})
5257

@@ -55,6 +60,7 @@ collection.createIndex((row) => row.date, { indexType: BTreeIndex })
5560
```
5661

5762
**Bundle Size Impact:**
63+
5864
- No indexing: ~30% smaller bundle
5965
- BasicIndex: ~5 KB (~1.3 KB gzipped)
6066
- BTreeIndex: ~33 KB (~7.8 KB gzipped)

0 commit comments

Comments
 (0)