@tanstack/router-core@1.171.32
Patch Changes
-
#8363
cecae54- Detect plain objects by constructor instead ofObject.prototype.toStringdispatches inisPlainObject, which gates everydeepEqualandreplaceEqualDeeprecursion step. Object literals,JSON.parseoutput and null-prototype objects are still plain; objects from another realm no longer are. Records with an ownconstructorkey (for example the search params of?constructor=foo) fall back to a prototype check, so they keep structural sharing while class instances stay opaque. -
#8364
0103578- Compare and copy plain objects inreplaceEqualDeepby their string keys only, skipping the symbol-key lookup that dominated key enumeration. Objects with non-enumerable own properties, or symbol keys on the incoming value, now pass through untouched instead of being structurally shared. -
#8411
ce10dcd- Reduce structural-sharing allocations by reusing array key storage and returning incoming objects when their children need no replacements. Preserve signed zero consistently, remove stale symbol properties, and keep sparse arrays with extra keys and built-ins with an ownconstructoropaque.Null-prototype mode now applies only when constructing a copy; existing incoming objects can be reused with their original prototype.
-
#8362
84936cc- Allocate thereplaceEqualDeepresult only at the first difference, so structural sharing of search, params, state and loader data no longer allocates when the new value is deeply equal to the previous one. -
#8389
bbd2336- SplitreplaceEqualDeepinto an equality scan and a copy phase: arrays and objects are scanned by dedicated loops up to the first difference, matching keys prove ownership without ahasOwnPropertylookup, and once a difference is found the result is built without any further equality bookkeeping. Deeply equal search, params, state and loader data are recognised faster and changed values are copied with less work per entry.