Skip to content

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

Open
gaurav0107 wants to merge 1 commit into
reflex-dev:mainfrom
gaurav0107:fix/6483-default-template-radix-themes-plugin
Open

fix(init): declare RadixThemesPlugin in default rxconfig template#6776
gaurav0107 wants to merge 1 commit into
reflex-dev:mainfrom
gaurav0107:fix/6483-default-template-radix-themes-plugin

Conversation

@gaurav0107

Copy link
Copy Markdown

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 a spurious deprecation warning (Implicit Radix Themes enablement has been deprecated in version 0.9.0) shown on the first reflex run of every freshly scaffolded app. The blank app template uses Radix Themes components, but the generated rxconfig.py never declared RadixThemesPlugin explicitly, causing the compiler to fall back to the implicit path.

  • Adds rx.plugins.RadixThemesPlugin() as the last entry in rxconfig_template, matching the ordering already used by the implicit compiler path and carrying the same default blue theme.
  • Extends test_create_config_e2e with a fail-first regression assertion that verifies RadixThemesPlugin appears in the generated config's plugin list.

Confidence Score: 5/5

Safe 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. RadixThemesPlugin is confirmed exported at reflex.plugins, the default-theme and plugin ordering match the prior implicit behaviour, and the test exercises the real exec-based path used during reflex init.

No files require special attention.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/compiler/templates.py Adds rx.plugins.RadixThemesPlugin() as the last entry in the default plugin list of rxconfig_template, matching the ordering used by the implicit compiler path and silencing the deprecation warning on fresh scaffolded apps.
tests/units/utils/test_utils.py Extends test_create_config_e2e with an assertion that RadixThemesPlugin appears in the generated config's plugin list; import is correctly sourced from reflex.plugins.

Reviews (1): Last reviewed commit: "fix(init): declare RadixThemesPlugin in ..." | 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".

plugins=[
rx.plugins.SitemapPlugin(),
rx.plugins.TailwindV4Plugin(),
rx.plugins.RadixThemesPlugin(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant