Home

facebook/react

Status:Indexed
Analyzed 3d ago240K+ starsJavaScript

The library for web and native user interfaces.

Back to Pull Requests
#35298Open
Complex Review

[compiler][poc] Improve impurity/ref tracking

by josephsavonaDec 5, 2025
View on GitHub

Summary

This PR refactors how React's compiler tracks impure functions (like Date.now()) by changing the 'Impure' effect to signify that the *value* itself is impure, rather than the act of calling it. It enhances data flow analysis to propagate this impurity, but stops propagation when reaching refs, thereby allowing refs to hold impure values.

Changes

+1054 additions-196 deletions

Impact Areas

CompilerStatic AnalysisPerformance Optimizations