Skip to content

fix(init): declare RadixThemesPlugin in default rxconfig template - #6776

Merged
masenf merged 3 commits into
reflex-dev:mainfrom
gaurav0107:fix/6483-default-template-radix-themes-plugin
Aug 7, 2026
Merged

fix(init): declare RadixThemesPlugin in default rxconfig template#6776
masenf merged 3 commits into
reflex-dev:mainfrom
gaurav0107:fix/6483-default-template-radix-themes-plugin

Conversation

@gaurav0107

Copy link
Copy Markdown
Contributor

Type of change

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

Summary

reflex init followed by reflex run emitted a spurious deprecation warning on a brand-new app:

Implicit Radix Themes enablement has been deprecated in version 0.9.0.

The blank app template renders Radix Themes components (rx.heading(size=...), rx.text, rx.code, rx.button), which auto-enable the Radix plugin during compilation. The generated rxconfig.py, however, only declared SitemapPlugin and TailwindV4Plugin — not RadixThemesPlugin. With no explicit Radix plugin in the config, the compiler falls back to RadixThemesPlugin.create_implicit() (_explicit=False), whose enter_component fires the deprecation warning the first time a Radix component compiles.

This declares rx.plugins.RadixThemesPlugin() in the config template that reflex init writes, which is exactly the remedy the deprecation message tells users to apply. The plugin is added last in the plugins list 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 default RadixThemesPlugin() 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_e2e in tests/units/utils/test_utils.py, which already execs the generated rxconfig.py into a real rx.Config. It now asserts the config declares a RadixThemesPlugin:

assert any(isinstance(plugin, RadixThemesPlugin) for plugin in config.plugins)

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 passed
  • uv run pytest tests/units/compiler/test_plugins.py tests/units/compiler/test_memoize_plugin.py — 142 passed
  • uv run ruff check . (changed files) — clean
  • uv run ruff format --check . (changed files) — clean
  • uv run pyright (changed files) — 0 errors

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-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the spurious "Implicit Radix Themes enablement" deprecation warning emitted on every fresh reflex run by adding rx.plugins.RadixThemesPlugin() to the rxconfig.py template that reflex init generates. A secondary change in plugin.py removes the guard that previously let an explicitly-configured plugin theme win over the deprecated App(theme=...), so the deprecated API now unconditionally overwrites any theme the user configured in their plugin — an already-flagged concern (see prior review comment) that the PR intentionally documents with updated tests.

  • templates.py: Adds rx.plugins.RadixThemesPlugin() as the third entry in the generated plugins list, directly fixing issue DeprecationWarning: Implicit Radix Themes enablement has been deprecated in version 0.9.0. #6483 for all newly scaffolded apps.
  • plugin.py: Drops the if self._explicit: return guard in apply_app_theme, making App(theme=...) always win over any RadixThemesPlugin theme during the deprecation window; tests and changelog updated accordingly.
  • test_utils.py / test_app.py: New fail-first regression test confirms the template declares the plugin; existing explicit-wins test renamed and inverted; new test covers the default-plugin-adopts-App-theme path.

Confidence Score: 4/5

  • Safe to merge for the primary goal (eliminating the init-time warning), but the apply_app_theme behavioral change — making App(theme=...) unconditionally overwrite an explicitly-configured plugin theme — was already flagged in a prior review and remains unresolved.
  • The template fix is clean and achieves its stated goal. The plugin.py change deliberately inverts a previously-established priority rule: users who follow the deprecation message's own advice and configure RadixThemesPlugin(theme=...) explicitly will still have that theme silently overridden by the deprecated App(theme=...) API, which undermines the migration path the warning describes.
  • packages/reflex-components-radix/src/reflex_components_radix/plugin.py — the unconditional theme overwrite in apply_app_theme deserves another look before merging.

Important Files Changed

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

@gaurav0107
gaurav0107 marked this pull request as ready for review July 15, 2026 19:16
@gaurav0107
gaurav0107 requested a review from a team as a code owner July 15, 2026 19:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread packages/reflex-base/src/reflex_base/compiler/templates.py
@codspeed-hq

codspeed-hq Bot commented Jul 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing gaurav0107:fix/6483-default-template-radix-themes-plugin (40c285e) with main (346177c)2

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (d8a132b) during the generation of this report, so 346177c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@FarhanAliRaza

Copy link
Copy Markdown
Contributor

Tracked down the CI failures — the test_appearance ones are actually caused by this PR. AppHarness scaffolds its test apps with reflex init, so they now get the explicit RadixThemesPlugin() from the template, and with an explicit plugin apply_app_theme warns but then throws the deprecated App(theme=...) away:

if self._explicit:
    return          # App(theme=...) silently ignored

self.enabled = True
self.theme = theme

Same thing hits real users: a fresh app doing rx.App(theme=rx.theme(appearance="dark")) — still what the theming docs teach — now compiles with the default blue theme instead. The fix is just deleting that early return so the deprecated param keeps working until its 1.0 removal. Pushed it with a fail-first regression test and the news fragments the changelog check wants: FarhanAliRaza/reflex@770b5db — feel free to cherry-pick onto this branch.

The min-deps check jobs fail on main too (missing lower-bound bumps from other commits), so those aren't on this PR.

…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.
@FarhanAliRaza
FarhanAliRaza force-pushed the fix/6483-default-template-radix-themes-plugin branch from 53df91f to 40c285e Compare August 7, 2026 16:33
@masenf
masenf merged commit 4363732 into reflex-dev:main Aug 7, 2026
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning: Implicit Radix Themes enablement has been deprecated in version 0.9.0.

3 participants