Repository navigation
Warn once about auto_memoize=False without react_compiler - #7814
Conversation
The config is built several times per run, and the warning added in #7694 had no once-per-process guard, so `reflex compile` logged it twice and `reflex run` five times. Guard it with a module flag, the same way the react_compiler warning is guarded by `_warned_react_compiler`. Found in the reflex 0.11.0a1 pre-release testing (FINDING-047). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dxjadq3qkhKnqZR2b9WBFi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dxjadq3qkhKnqZR2b9WBFi
[Low impact] This PR appears safe to merge. SummaryWarn once per process when both page memoization options are disabled.
No actionable issues found. Tests were not run during this review. Reviews (1) · Last reviewed commit: "Warn once about auto_memoize=False witho..." · Reviewed by Greptile |
Merging this PR will degrade performance by 4.36%1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
|
CodSpeed is red here ( Generated by Claude Code |
The config is built several times per run, and the warning added in #7694 had no once-per-process guard, so `reflex compile` logged it twice and `reflex run` five times. Guard it with a module flag, the same way the react_compiler warning is guarded by `_warned_react_compiler`. Found in the reflex 0.11.0a1 pre-release testing (FINDING-047). Claude-Session: https://claude.ai/code/session_01Dxjadq3qkhKnqZR2b9WBFi Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit 682201f)
…the train Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dxjadq3qkhKnqZR2b9WBFi
Type of change
Description
Found in the reflex 0.11.0a1 pre-release testing (FINDING-047).
The config is built several times per run. The "auto_memoize=False without react_compiler=True" warning added in #7694 had no once-per-process guard, so
REFLEX_AUTO_MEMOIZE=false REFLEX_REACT_COMPILER=false reflex compilelogged it twice andreflex runfive times.This PR adds a
_warned_auto_memoizemodule flag inreflex_base/config.py, the same guard the react_compiler warning has with_warned_react_compiler. I used a flag rather thanextra={"dedupe": True}because the dedupe filter only applies in managed (CLI) mode.Checked end to end on a scratch app:
reflex compilewith both env vars set prints the warning once.Changes To Core Features:
tests/units/test_config.py::test_warns_when_all_memoization_is_disablednow builds the config twice and asserts exactly one warning. On main the two disabled/disabled cases fail withassert 2 == 1.test_config.pypasses, and ruff, ruff format, pyright and pre-commit are clean on the changed files.Generated by Claude Code