Allow overriding files with Plugins, just warn about it#6471
Allow overriding files with Plugins, just warn about it#6471riebecj wants to merge 5 commits intoreflex-dev:mainfrom
Conversation
Greptile SummaryThis PR changes how duplicate output paths are resolved during compilation: instead of keeping the first result and silently discarding later ones, it now always uses the last result and emits a warning. The intent is to let plugins override compile-time files.
Confidence Score: 3/5The core compile_results change is straightforward, but the plugin override goal is only partially met — the static-assets code path still drops plugin files on conflict. The fix achieves last-one-wins for the compile_results loop, but leaves the get_static_assets() loop unchanged. Plugins that attempt to override via static assets will still have their files silently ignored, which contradicts the stated fix. Merging as-is would leave users confused about why plugin overrides via static assets still do not work. reflex/compiler/compiler.py — specifically the get_static_assets() loop at lines 1253–1263 that still prevents plugin overrides. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[compile_results loop] --> B{path in output_mapping?}
B -- Yes --> C[warn: last one will be used]
C --> D[output_mapping updated - last wins]
B -- No --> D
E[plugin get_static_assets loop] --> F{path in output_mapping?}
F -- Yes --> G[warn: plugin file ignored - BUG NOT FIXED]
F -- No --> H[output_mapping updated with plugin content]
I[plugin modify_files_tasks loop] --> J[output_mapping updated via modify fn]
D --> K[Write all files to Disk]
H --> K
G -.->|file dropped| K
J --> K
|
Merging this PR will not alter performance
Comparing Footnotes
|
This fixes a bug where any
Pluginwould not be able to override any compile-time files.All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features: