Skip to content

Skip reflex_components_* frames in deprecation warning locations - #7811

Merged
FarhanAliRaza merged 1 commit into
mainfrom
fix/deprecation-frames-skip-component-packages
Nov 11, 2026
Merged

FarhanAliRaza merged 1 commit into
mainfrom
fix/deprecation-frames-skip-component-packages

Conversation

@masenf

@masenf masenf commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Description

Found in the reflex 0.11.0a1 pre-release testing (FINDING-028).

A deprecation warning names the first stack frame outside the framework. _exclude_paths_from_frame_info in reflex_base/utils/log.py excluded reflex, reflex_base, click, socketio, granian, typing_extensions and the stdlib, but not the component packages split out of reflex. So rx.input(on_change=client_state.set_value) reported a file inside reflex_components_* (for example .../site-packages/reflex_components_core/el/elements/forms.py:857) instead of the app's line.

This PR adds the root of every importable reflex_components_* package to the exclude roots. The names come from pkgutil.iter_modules(), which lists the sys.path entries and costs about 10 ms. They are resolved through the same find_spec path as the stdlib roots, inside the existing @once function, so the work happens once per process.

Checked end to end: a script calling rx.input(on_change=cs.set_value) reports reflex-components-radix/src/reflex_components_radix/... on main and (user_app.py:5) with this change.

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?

New test: tests/units/reflex_base/utils/test_log.py::test_component_packages_are_framework_code. It fails on main and passes with this change. tests/units/reflex_base/utils and tests/units/utils pass, and ruff, ruff format, pyright and pre-commit are clean on the changed files.


Generated by Claude Code

View guided diff Turn on auto-fix

Deprecation warnings name the first frame outside the framework, but the
exclude roots did not cover the component packages split out of reflex, so
`on_change=client_state.set_value` reported a file inside
`site-packages/reflex_components_*` instead of the app's line. Add every
importable `reflex_components_*` package root to the exclude roots, computed
once with the existing roots.

Found in the reflex 0.11.0a1 pre-release testing (FINDING-028).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dxjadq3qkhKnqZR2b9WBFi
@masenf
masenf requested a review from a team as a code owner November 11, 2026 09:12
@masenf masenf added this to the v0.11.0 milestone Nov 11, 2026
@masenf masenf added the on deck PRs lined up to review / merge next label Nov 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues remain.

Summary

Deprecation warnings now skip installed reflex_components_* packages so they point at the app’s calling line.

  • Deprecation warnings now point past component packages to the app call site.

Reviews (4) · Last reviewed commit: "Skip reflex_components_* frames in depre..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Nov 11, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 4.98%

1 warning

⚠️ 17 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 2 regressed benchmarks
✅ 149 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ test_route_matching[1000] 47.8 µs 50.5 µs -5.45%
❌ test_process_event_burst_independent_tokens[1] 2.7 ms 2.9 ms -4.51%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/deprecation-frames-skip-component-packages (175367f) with main (2d71015)

Open in CodSpeed

@masenf

masenf commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

CodSpeed is red here (test_route_matching[1000] -5.5%, test_process_event_burst_independent_tokens[1] -4.5%), but this PR doesn't cause it. Both benchmarks show the same 4–6% drop on every PR in this batch, whatever code each one touches. This PR changes only _exclude_paths_from_frame_info, a @once function that runs on the first deprecation warning, and no benchmark emits one. CodSpeed is not a required check; leaving it for acknowledgement on CodSpeed.


Generated by Claude Code

@FarhanAliRaza
FarhanAliRaza merged commit 8c2cb7d into main Nov 11, 2026
170 of 171 checks passed
@FarhanAliRaza
FarhanAliRaza deleted the fix/deprecation-frames-skip-component-packages branch November 11, 2026 13:48
masenf added a commit that referenced this pull request Nov 11, 2026
Deprecation warnings name the first frame outside the framework, but the
exclude roots did not cover the component packages split out of reflex, so
`on_change=client_state.set_value` reported a file inside
`site-packages/reflex_components_*` instead of the app's line. Add every
importable `reflex_components_*` package root to the exclude roots, computed
once with the existing roots.

Found in the reflex 0.11.0a1 pre-release testing (FINDING-028).

Claude-Session: https://claude.ai/code/session_01Dxjadq3qkhKnqZR2b9WBFi

Co-authored-by: Claude <[email protected]>
(cherry picked from commit 8c2cb7d)
@masenf masenf added the release-train Issues found during agentic /prerelease-testing fanout, not necessarily validated bugs. label Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on deck PRs lined up to review / merge next release-train Issues found during agentic /prerelease-testing fanout, not necessarily validated bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants