TanStackOSS
    router
    perf(router-core): faster enumerable-key collection in structural sharing getEnumerableOwnKeys (used by replaceEqualDeep) called Object.getOwnPropertyNames and then invoked propertyIsEnumerable once per key to verify every own string prop is enumerable. Replace that O(n) loop of JS method calls with Object.keys (native, enumerable-only) plus a single length comparison against getOwnPropertyNames to detect non-enumerable string props. Symbol handling is unchanged. Behavior is identical (verified against the existing suite + fuzzing): the function still returns the enumerable own keys in the same order and still bails (returns false) for objects with any non-enumerable own string or symbol property. replaceEqualDeep runs on every selector result on every state update when defaultStructuralSharing is enabled, so this is a hot client path for selector-heavy apps. Measured ~1.3-1.5x faster on typical router state.
    nx affected --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build --parallel=3
Succeeded
CI Pipeline Execution

nx affected --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build --parallel=3

Click to copy
d7301af97664
5%

Cache hits

40 of 841 tasks used cache.

94%

Distribution saved time

12m 49s instead of 3h 50m 29s.

Atomizer enabled

300 groups of tasks optimized.

© 2026 - Nx Cloud

Terms of ServicePrivacy PolicyChangelogStatusDocsContact Nx CloudPricingCompany@NxDevTools