fix(init): declare RadixThemesPlugin in default rxconfig template - #6776
Conversation
The blank app template renders Radix Themes components (rx.heading, rx.text, rx.code, rx.button), which auto-enable the Radix plugin at compile time. The generated rxconfig.py did not list RadixThemesPlugin, so the compiler fell back to implicit enablement and emitted the "Implicit Radix Themes enablement has been deprecated in version 0.9.0" warning on the first `reflex run` of every freshly scaffolded app. Declare rx.plugins.RadixThemesPlugin() explicitly in the config template (kept last to preserve the existing plugin/stylesheet ordering the implicit path used), which is the exact remedy the deprecation message instructs users to apply. New apps are now warning-free. closes reflex-dev#6483
Greptile SummaryThis PR fixes the spurious "Implicit Radix Themes enablement" deprecation warning emitted on every fresh
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| packages/reflex-base/src/reflex_base/compiler/templates.py | Adds rx.plugins.RadixThemesPlugin() to the rxconfig template; straightforward and correct fix for issue #6483. |
| packages/reflex-components-radix/src/reflex_components_radix/plugin.py | Removes the if self._explicit: return guard from apply_app_theme, making App(theme=...) unconditionally overwrite any explicitly-configured plugin theme. This was flagged in a prior review comment and the PR intentionally implements this behavior, but it means users who follow the deprecation advice (add RadixThemesPlugin(theme=...) to rxconfig) still see their explicit theme silently overridden by the deprecated API. |
| tests/units/test_app.py | Renames and updates the existing explicit-wins test to document the new App-theme-wins behavior, and adds a new test for the default-plugin-adopts-App-theme case. Coverage is thorough for the new behavior. |
| tests/units/utils/test_utils.py | Adds a fail-first assertion confirming RadixThemesPlugin is present in the generated config; clean and effective regression guard. |
Reviews (4): Last reviewed commit: "fix(radix): keep deprecated App(theme=....." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e5bc6ef72
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Merging this PR will not alter performance
Comparing Footnotes
|
|
Tracked down the CI failures — the if self._explicit:
return # App(theme=...) silently ignored
self.enabled = True
self.theme = themeSame thing hits real users: a fresh app doing The min-deps |
…adixThemesPlugin Declaring RadixThemesPlugin() in the default rxconfig template routed App(theme=...) into apply_app_theme's explicit-plugin early return, which silently dropped the theme in freshly scaffolded apps (the pattern all theming docs teach). Remove the guard so the deprecated parameter keeps working, and winning, until its 1.0 removal, matching pre-plugin behavior. Also add news fragments for the changelog check.
53df91f to
40c285e
Compare
Type of change
Bug fix (non-breaking change which fixes an issue).
Summary
reflex initfollowed byreflex runemitted a spurious deprecation warning on a brand-new app:The
blankapp template renders Radix Themes components (rx.heading(size=...),rx.text,rx.code,rx.button), which auto-enable the Radix plugin during compilation. The generatedrxconfig.py, however, only declaredSitemapPluginandTailwindV4Plugin— notRadixThemesPlugin. With no explicit Radix plugin in the config, the compiler falls back toRadixThemesPlugin.create_implicit()(_explicit=False), whoseenter_componentfires the deprecation warning the first time a Radix component compiles.This declares
rx.plugins.RadixThemesPlugin()in the config template thatreflex initwrites, which is exactly the remedy the deprecation message tells users to apply. The plugin is added last in thepluginslist to preserve the existing plugin/stylesheet ordering the implicit path already used (the implicit plugin was appended after the others in the compiler chain), so scaffolded apps behave identically apart from the warning disappearing. The defaultRadixThemesPlugin()carries the same default blue theme the implicit path used.A freshly scaffolded app is now warning-free.
closes #6483
Testing
Extended the existing
test_create_config_e2eintests/units/utils/test_utils.py, which already execs the generatedrxconfig.pyinto a realrx.Config. It now asserts the config declares aRadixThemesPlugin:This assertion fails on
main(the template omits the plugin) and passes with the fix — a genuine fail-first regression test.uv run pytest tests/units/utils/test_utils.py tests/units/test_config.py— 320 passeduv run pytest tests/units/compiler/test_plugins.py tests/units/compiler/test_memoize_plugin.py— 142 passeduv run ruff check .(changed files) — cleanuv run ruff format --check .(changed files) — cleanuv run pyright(changed files) — 0 errors