- TypeScript: Fix issue preventing TypeScript types from being resolved
- Bug Fix: Fix error when importing in CommonJS projects.
- Breaking: Drop support for environments which don't have WeakMap. This should only affect Internet Explorer 10 and older.
- New: TypeScript type definitions are now included.
- Miscellaneous: The package is now implemented as a native ES module.
- Breaking:
getDependants
(the second argument) must return an array. Per the below added feature, this has been done in an effort to to reduce developer burden in normalizing dependants reuse as arrays. - New: The created selector exposes
getDependants
function as a property. Refer to README.md for usage.
- Improved: Minor size and performance optimization on cache arguments handling.
- Improved: Now uses
WeakMap
when available and when possible to cache per set of dependants. This also results in improved cache hit rates for dependants derived from getter arguments. - Removed:
options.maxSize
is no longer supported. The options argument, if passed, is now simply ignored.
- Fix: Correctly skips incorrect cached value return on mismatched argument length
- Fix: Resolve infinite loop which can occur due to lingering references in recalling from previous cache
- Fix: Resolve error which can occur in certain conditions with
maxSize
- Fix: Resolve infinite loop which can occur due to lingering references in recalling from previous cache
- Improved: Significant performance optimizations by reimplementing cache as linked list stack. For more details and benchmarks, see sister project "memize" from which the implementation is derived.
- Improved: Performance optimization on creating argument cache
- Fix: Skip impossible condition when deciding to surface result to top of cache
- Improved: Performance optimization on multiple subsequent selector calls with identical arguments
- Fix: Use correct cache to determine cache update optimization
- Breaking Change: The memoized function is no longer exposed. Calls to
selector.memoizedSelector.clear
should be updated toselector.clear
. - New Feature:
createSelector
accepts an optional third argument to specify options, currently supportingmaxSize
(defaulting toInfinity
) - Internal: Cache lookup and max size use an LRU (least recently used) policy to bias recent access, improving efficiency on subsequent calls with same arguments
- Internal: Inline memoization with returned selector to optimize arguments handling
- Internal: Drop moize dependency in favor of home-grown memoization solution, significantly reducing bundled size (10.2kb -> 0.5kb minified, 3.0kb -> 0.3kb minified + gzipped)
- Internal: Add package-lock.json
- Fix: Resolve an error in environments not supporting Promise, caused by defaults behavior in the underlying memoization library.
- Improved: Object target is ignored in generating memoized function cache key. This can resolve issues where cache would be discarded if dependant references were the same but the target object reference changed.
- Fix: Include dist in npm package (for unpkg availability)
- Initial release