docs: add guidance for scaling state - #6898
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThe PR adds a comprehensive Scaling State guide and incorporates it into the documentation paths used by developers and coding agents.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| docs/state_structure/scaling_state.md | Adds the central decision guide for State ownership, composition, cross-State access, testing, and performance. |
| docs/app/agent_files/_plugin.py | Routes generated agent-readable documentation toward the new scaling guide and related architecture pages. |
| docs/app/reflex_docs/redirects.py | Centralizes documentation redirects and restores legacy substate mappings to existing State Structure routes. |
| docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/learn.py | Adds Scaling State to the State Structure sidebar while retaining the documented section ordering. |
| docs/app/tests/test_agent_files.py | Extends coverage for architecture links in generated Markdown, llms.txt, and llms-full.txt output. |
| docs/app/tests/test_routes.py | Adds regression assertions for the restored legacy substate redirects. |
| docs/app/tests/test_sidebar.py | Verifies the intended placement of Scaling State in the State Structure section. |
Reviews (4): Last reviewed commit: "docs: make redirect test platform-safe" | Re-trigger Greptile
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| This layout keeps the code that changes together close together: | ||
|
|
||
| - `state.py` owns the feature's Vars, computed vars, and small event handlers. | ||
| - `events.py` may contain decentralized handlers when the handler set becomes large. |
There was a problem hiding this comment.
this is the only one that i'm hesitant on because decentralized handlers are defined in a weird way and don't feel very reflexy to me, so idk if we should recommend them.
There was a problem hiding this comment.
I agree, decentralized handlers if anything is an anti pattern that masks having too large of a state.
What changed
llms.txt,llms-full.txt, Skills, Agent Toolkit, andAGENTS.mdguidance through the large-app reading path/substates/*URLs and add regression coverageWhy
The existing docs explain each State primitive separately, but do not give humans or coding agents a normative way to choose and combine them in a scaled, multi-page app. This makes State ownership, coupling, and inheritance decisions under-specified.
Validation
uv run --no-sync pytest tests -q— 406 passed, 1 skipped, 1 xfailedgit diff --checkuv run --no-sync reflex compile --dryinitialized the docs app, but a full compile requires a Reflex Enterprise login in this environment.