Skip to content

Commit c3a305e

Browse files
committed
changeset
1 parent 9f8b947 commit c3a305e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
"@tanstack/db": patch
3+
---
4+
5+
## Enhanced Ref System with Nested Optional Properties
6+
7+
Comprehensive refactor of the ref system to properly support nested structures and optionality, aligning the type system with JavaScript's optional chaining behavior.
8+
9+
### ✨ New Features
10+
11+
- **Nested Optional Properties**: Full support for deeply nested optional objects (`employees.profile?.bio`, `orders.customer?.address?.street`)
12+
- **Enhanced Type Safety**: Optional types now correctly typed as `RefProxy<T> | undefined` with optionality outside the ref
13+
- **New Query Functions**: Added `isUndefined`, `isNotUndefined`, `isNull`, `isNotNull` for proper null/undefined checks
14+
- **Improved JOIN Handling**: Fixed optionality in JOIN operations and multiple GROUP BY support
15+
16+
### ⚠️ Breaking Changes
17+
18+
**IMPORTANT**: Code that previously ignored optionality now requires proper optional chaining syntax.
19+
20+
```typescript
21+
// Before (worked but type-unsafe)
22+
employees.profile.bio // ❌ Now throws type error
23+
24+
// After (correct and type-safe)
25+
employees.profile?.bio // ✅ Required syntax
26+
```
27+
28+
### Migration
29+
30+
Add `?.` when accessing potentially undefined nested properties

0 commit comments

Comments
 (0)