Skip to content

Fix cache size warnings for bounded weakMapMemoize caches - #825

Open
LucasLeao18 wants to merge 1 commit into
reduxjs:masterfrom
LucasLeao18:fix/bounded-cache-size-warning
Open

LucasLeao18 wants to merge 1 commit into
reduxjs:masterfrom
LucasLeao18:fix/bounded-cache-size-warning

Conversation

@LucasLeao18

Copy link
Copy Markdown

With weakMapMemoize(fn, { maxSize: 1002 }), adding 1001 distinct primitive arguments triggers a warning that the cache will grow without bound and recommends setting maxSize, even though it is already set.

Skip the unbounded-growth warning when generational bounding is enabled. Tests exercise once and always, multiple generations, and clearCache(). Existing checks still verify warnings for unbounded caches.

Validation on Node 24.15.0 / Windows:

  • Both new cases fail before the fix.
  • pnpm test: 139 runtime tests and 29 type tests passed, plus the loose-null-checks compiler run.
  • pnpm lint and pnpm format:check: passed.

Prepared with OpenAI Codex; tests were run locally.

@netlify

netlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for reselect-docs canceled.

Name Link
🔨 Latest commit 0a10f5c
🔍 Latest deploy log https://app.netlify.com/projects/reselect-docs/deploys/6ad7bc50a350ce8c22c9d754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant