docs: remove dead code, unused assets and unused dependencies from the docs app
All Submissions:
- Have you followed the guidelines stated in CONTRIBUTING.md file?
- Have you checked to ensure there aren't any other open Pull Requests for the desired changed?
Type of change
- Bug fix (non-breaking change which fixes an issue) — cleanup of the docs app; no page or URL changes
Changes To Core Features:
- Have you added an explanation of what your changes do and why you'd like us to include them?
- Have you written new tests for your core changes, as applicable?
- Have you successfully ran tests with your changes locally?
What changed
Docs-audit session E (dead code, assets and dependencies). I re-checked every finding against current main before deleting anything.
1. 19 unreachable modules deleted. An AST import graph rooted at reflex_docs.reflex_docs, rxconfig.py, agent_files/ and every reflex_docs import in docs/**/*.md reaches none of them:
components/{ai_guide_graphic,button,hint,webpage}, models.py, pages/docs/{api_reference/plugins,api_reference/utils,guide,source}, pages/docs_landing/views/cta_artwork, pages/gallery, pages/integrations/{integration,integration_header}, templates/docpage/sidebar/sidebar_items/cloud, templates/docpage/state, utils/http, views/animated_box, views/bottom_section/{get_started,newsletter}.
/flexdown-guide("Coming Soon"):guide.pywas never imported, so the route was never registered. It was absent from the route list and sitemap, and nothing links to it, so no redirect is needed.pages/docs/source.py(finding 4): only its own test (test_responsive_description_is_rendered_onceintest_site_quality.py) imported it. That test is deleted with it. The README's "Edit this page" lookup now lives intemplates/docpage/docpage.py:github_edit_url, and API pages are built byapiref.py.components/button.pywent dead oncenewsletter.pywas deleted. The audit's earlier count only kept it because of a prose example indocs/app/CLAUDE.md. That example now importsreflex_docs.templates.docpage, and CLAUDE.md no longer mentions the nonexistentmainpagetemplate or the deleted CTA views.- The now-orphaned
.docs-hintCSS rule is removed as well.
2. docpage template: 288 lines of deletions only. Removed copy_to_markdown, ask_ai_chat, RadixDocState, hover_item, dict_to_formatted_string, used_component, style_grid and their now-unused imports. Nothing is restructured, so session B's chrome edits should merge cleanly. feedback_button_toc stays because the docpage layout uses it.
3. 8 landing SVGs and 12 public assets deleted. For each one I grepped the filename across the whole repo, including docs markdown and packages/reflex-site-shared, and also checked the dynamic paths (artwork(name), agent-logos/{name}, components_previews/{section}/{mode}/{name}, the AI-card --ai-cloud CSS).
- Landing SVGs:
ai_mcp,framework_{auth,components,database},getting_started_illustration,mcp_illustration,reflex_mark,squares_docs_logo. Onlyai_getting_started.svgis used. - Public assets:
meta/mstile-*.png(5) andmeta/browserconfig.xml(the only file that referencedmstile-150x150.png, and nothing links to it),docs/{light,dark}/{getting_started,mcp}.svg,framework-diagrams/lavender.avif,chakra_color_mode_provider.js. - Kept
robots.txt(a convention file, not linked from code), thesankeychartpreviews (used viaBUNDLED_PREVIEWS) andagent-logos/*(used through an f-string).
5. Dependencies.
- Removed
orjson(only imported by the deletedutils/http.py), plusfastapi,psycopg[binary]and devuvicorn. None is imported by the app or its tests, and the markdown FastAPI/psycopg snippets are plain display blocks, notexec. - Replaced
plotly-expresswithplotly: the demos importplotly.express, which ships in plotly. The shim only addedstatsmodels,scipy,patsy,formulaicandinterface-meta, and no demo uses trendlines or anything else that needs them. - The
uv.lockdiff is removals plus theplotlyedge that replacesplotly-express: the removals are those 5 packages,orjson,plotly-express, and the docs-app edges. fastapi, psycopg and uvicorn stay locked because reflex's own dev group pins them.
Regression test. tests/test_module_reachability.py walks the static import graph and asserts that the list of unreachable modules is exactly []. Before this change it listed the 19 modules.
- The reachability test follows
importstatements only; a module loaded any other way (importlib, string paths,exec) would count as unreachable.
Verification
- I couldn't run
reflex exporthere: reflex-enterprise needs a logged-in Reflex account, andreflex compiledies atbun installbecause the proxy blocks a GitHub tarball. Instead, a script imports the app, evaluates every registered page component and dumps the route list. Result before and after: 562 routes, 0 render errors, identical route lists. - The "after" run used a venv synced to the new deps, so fastapi, psycopg and statsmodels weren't installed. Every page still rendered.
uv run pytest tests/in docs/app, without a built site: 871 passed, 110 skipped, 16 xfailed (one test removed, two added). The skips and xfails are browser/build tests that need an exported site; I could not build the full site here to get the with-site count.uv run pre-commit run --all-files(ruff, codespell, pyright, ty, biome) is clean.
Skipped findings
- 6, duplicated
reflex_site_sharedlib/meta/meta.py: the copies have diverged.lib/metaemits root-relative/meta/...and/favicon.icolinks for a site served at the domain root, whilemeta/meta.pyusesrx.assetfor the/docsprefix. The docs app imports onlymeta.meta, but reflex-site-shared is a released package andlib/metalooks like it serves the marketing site (another repo), so I left it.