Conversation
⚡ Benchmark Results
Legend🟢 > 1% improvement | 🔴 > 1% regression | ⚪ within noise margin Benchmarks run on GitHub Actions runners (shared infrastructure) — expect ~5% variance between runs. Consistent directional changes across multiple routes are more meaningful than any single number. |
❌ 1 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
use-cache-inlineplugin had several bugs in how it tracks closure variables and handles exported cached functions. The root cause was a flatlocalsarray that accumulated variable names from all function scopes without any scoping — variables declared inside one function would leak into the closure capture list of completely unrelated sibling functions. This caused the plugin to emit invalid.bind()calls on module-level exported cached functions, producing parse errors likeexport __cache_name__.bind(null, src, selector, isolate)during production builds.The fix replaces the flat
localsarray with a proper scope stack. Each non-cached function pushes a scope entry on enter and pops it on leave, so only variables from actual enclosing lexical scopes are considered for closure capture. Module-level cached functions now correctly see an empty scope stack and skip.bind()entirely.Additional fixes included in this change: destructured binding patterns (
ObjectPattern,ArrayPattern,AssignmentPattern,RestElement) are now properly walked when collecting local variable names. Function parameters in enclosing scopes are tracked for nested cached function closure capture. Identifiers in non-reference positions (object property keys, member expression properties, declaration ids, function names) are excluded from closure matching — this was necessary because the JSX transform runs before the cache plugin, turning JSX attribute names into regular Property key Identifiers that would otherwise be falsely captured. Exported cached functions are now wrapped in__react_cache__()at module level and get correctCACHE_KEY/CACHE_PROVIDERassignments using scoping-aware target resolution.