Skip to content

Allow overriding files with Plugins, just warn about it#6476

Merged
masenf merged 6 commits intoreflex-dev:mainfrom
riebecj:plugins-fix
May 8, 2026
Merged

Allow overriding files with Plugins, just warn about it#6476
masenf merged 6 commits intoreflex-dev:mainfrom
riebecj:plugins-fix

Conversation

@riebecj
Copy link
Copy Markdown
Contributor

@riebecj riebecj commented May 8, 2026

This fixes a bug where any Plugin would not be able to override any compile-time files.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

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

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

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 successfully ran tests with your changes locally?

@riebecj riebecj requested a review from a team as a code owner May 8, 2026 22:27
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR fixes a bug where plugins could not override compile-time files — previously the plugin file was silently ignored if the path already existed in output_mapping. Both the compile-results loop and the plugin static-assets loop now use last-wins semantics, with updated warning messages.

  • Plugin override fix: Removes the else guard in the plugin static assets loop so that output_mapping[path] is always written, enabling plugins to intentionally replace generated files (with a warning logged).
  • compile_results behavior change: The same structural change is applied to the compile_results loop, shifting from first-wins to last-wins for duplicate output paths — this is not described in the PR but appears intentional for consistency.

Confidence Score: 4/5

Safe to merge; the plugin override fix is correct and the diff is minimal.

The plugin static-assets fix is straightforward and correct. The only concern is that the compile_results loop also quietly switches from first-wins to last-wins, which is a real behavior change not mentioned in the PR description. In practice duplicate compile_results paths would indicate a compilation bug, so the impact is low — but it's worth a confirmation from the author before merging.

reflex/compiler/compiler.py — specifically the compile_results duplicate-path handling around line 1247.

Important Files Changed

Filename Overview
reflex/compiler/compiler.py Two related changes in compile_app: compile_results now uses last-wins semantics (was first-wins), and plugin static assets can now overwrite existing paths instead of being silently ignored. Both warning messages updated accordingly.

Reviews (1): Last reviewed commit: "Merge branch 'reflex-dev:main' into main" | Re-trigger Greptile

Comment thread reflex/compiler/compiler.py
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 8, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing riebecj:plugins-fix (fb93cea) with main (61d8fad)

Open in CodSpeed

Footnotes

  1. 2 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.

@masenf masenf merged commit d5a05a2 into reflex-dev:main May 8, 2026
136 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.

2 participants