Skip to content

0.2.2

Latest

Choose a tag to compare

@ElliotNB ElliotNB released this 04 Dec 02:32
· 3 commits to master since this release

This release bundles a long line of perf, correctness, and DX improvements that landed after 0.2.0, plus a small cleanup for 0.2.2 itself. Internals have been modernized (Symbols, WeakMaps, coalesced cleanup scheduler, linked-list path tracking), with better memory behavior and tooling to validate performance.

Breaking changes

  • Dropped IE11 support

    • The library now targets modern environments only.
    • IE11-specific code paths and shims have been removed.
  • Internal introspection moved to Symbols

    • Replaces magic string internals (e.g. "__getTarget"-style) with Symbol-based capabilities and public helpers.
    • If you relied on undocumented internal string keys on the proxy, you’ll need to switch to the public helpers (ObservableSlim.isProxy, getTarget, getParent, getPath, or ObservableSlim.symbols.*).

Features & behavior improvements

  • Cycle-safe graph handling

    • Adds protection against self-referential / cyclic object graphs so deeply nested or circular structures no longer risk blowing the stack or leaking.
    • Introduces a cycle-safe DFS and proxy unwrapping when tearing down orphaned subtrees.
  • Configurable cleanup scheduler

    • Replaces the previous fixed timeout cleanup with a coalesced, configurable scheduler.
    • Cleanup of orphaned subgraphs is batched to reduce overhead on hot paths.
    • flushCleanup is available so tests can run deterministically and quickly.
  • Linked-list-based path tracking

    • Refactors path tracking from array-based paths to a linked-list lineage of parent proxies.
    • Keeps creation time O(N) with clearer semantics for getPath / JSON Pointer reporting, especially in nested and array-heavy graphs.
  • More robust proxy orchestration

    • Ensures sibling proxies are notified of deletes using a dupProxy propagation spec without creating loops.
    • Fixes a bug related to getParent after migrating to Symbols.

Performance and memory

  • WeakMap-based tracking for observables

    • Replaces array-based tracking with WeakMaps for O(1) lookups and GC-safe tracking of targets and proxies.
    • Reduces overhead for pause, resume, pauseChanges, resumeChanges, and remove.
  • Shallow hydration of assigned objects

    • When assigning new objects/arrays onto the graph, only shallowly hydrates them instead of doing a deep walk.
    • Greatly improves performance for large graphs and frequent assignments.
  • Memory leak fixes and cleanup

    • Cleans up unused path-related bookkeeping that could otherwise contribute to minor leaks.
    • Prunes orphaned, unused functions that were left behind after earlier perf refactors.

Tooling and benchmarks

  • Benchmark suite

    • Adds a benchmark suite to validate time complexity and scaling performance on realistic object graphs.
    • New npm run bench command to run these benchmarks locally.
  • Post-build conformance tests

    • Adds tests to validate built artifacts (UMD, CJS, ESM, etc.) behave as expected across module formats.
  • Typing improvements

    • Multiple passes over the JSDoc and type surface to improve generated .d.ts.
    • Ensures npm run type auto-generates the declaration file correctly and adds a test script to validate type usage.