fix(init): declare RadixThemesPlugin in default rxconfig template#6776
fix(init): declare RadixThemesPlugin in default rxconfig template#6776gaurav0107 wants to merge 1 commit into
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 a spurious deprecation warning (
Confidence Score: 5/5Safe to merge — the change is a one-line addition to a config template with a targeted regression test. The fix is minimal and well-scoped: one line added to the template string, one assertion added to the existing e2e test. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(init): declare RadixThemesPlugin in ..." | 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".
| plugins=[ | ||
| rx.plugins.SitemapPlugin(), | ||
| rx.plugins.TailwindV4Plugin(), | ||
| rx.plugins.RadixThemesPlugin(), |
There was a problem hiding this comment.
Preserve legacy App theme in scaffolded apps
Adding a default explicit RadixThemesPlugin() to every generated rxconfig.py changes how freshly scaffolded apps handle rx.App(theme=...): _resolve_radix_themes_plugin treats this as an explicit plugin, and RadixThemesPlugin.apply_app_theme() returns without applying the app theme when _explicit is true. So a new app that follows the current theming examples and sets app = rx.App(theme=rx.theme(accent_color="teal")) will now compile with the plugin’s default blue theme instead of the requested theme; before this template change, the implicit plugin preserved the legacy app theme while warning.
Useful? React with 👍 / 👎.
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