Conversation
Remove the Proxy-based tracking of nested object mutations and mutative method calls. The `deep` option is no longer supported, and SourceCell now only triggers updates on top-level value changes.
📝 WalkthroughWalkthroughThis PR removes deep reactivity capabilities from the library. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR removes the automatic proxy-based reactivity system from
SourceCell. Previously, when reading a value from a source cell via.get(), the returned value was wrapped in aProxythat intercepted property access and mutations, allowing patterns likecell.get().a = 2to trigger reactive updates. With the optionaldeep: trueflag, this proxying extended recursively to nested properties.This approach had several issues:
.get()means the caller is never working with the actual value, which can cause subtle bugs with identity checks, serialization, and interop with external libraries..get()call created a newProxy, and every property access on the returned object went through trap handlers, includinginstanceofchecks againstMap,Set,Date,Array, andArrayBufferviews..set()calls are clearer and more predictable.Map,Set,Date, andArray, and each new collection type would need additional special-casing.Changes
library/classes.js: Removed the#proxy()method fromSourceCell, so.get()now returns the raw value directly. Removed the mutative method sets (mutativeMapMethods,mutativeSetMethods,mutativeArrayMethods,mutativeDateMethods) that supported the proxy logic. Removed thedeepoption fromCellOptionsand related JSDoc.README.md: Removed documentation of thedeepoption from the source cell configuration example.tests/index.test.js: Removed the entireNested cellstest suite and proxy-related cell option tests. Updated the deep equality test to no longer use thedeepoption or test mutation-through-get patterns.Migration
Code that relied on mutating values through
.get():Code that used the
deepoption can simply remove it — the option no longer exists and will be ignored.Summary by CodeRabbit
Release Notes