Preserve entry.client.js in prod mode#5813
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR modifies the purge_web_pages_dir function in reflex/compiler/compiler.py to preserve the entry.client.js file during web directory purging operations. Previously, only routes.js was preserved when the .web/pages directory was emptied out. Now both routes.js and entry.client.js are kept in the keep_files list.
This change addresses a critical issue in Reflex's build process where the client-side entry point file was being inadvertently deleted during production builds. The entry.client.js file serves as the main entry point for the client-side React bundle, handling crucial functionality like React hydration, client-side routing, and browser-specific initialization code.
The modification integrates seamlessly with Reflex's existing web compilation pipeline. The purge_web_pages_dir function is part of the compiler's cleanup process that runs when not in development mode (unless REFLEX_PERSIST_WEB_DIR is set). By extending the preservation logic to include entry.client.js, this ensures that essential client-side infrastructure remains intact across builds while still allowing the cleanup process to remove other generated files as intended.
Confidence score: 5/5
- This PR is extremely safe to merge with virtually no risk of breaking existing functionality
- Score reflects a simple, targeted fix that addresses a clear production issue without introducing complexity or side effects
- No files require special attention as this is a straightforward one-line change to preserve an essential file
1 file reviewed, no comments
CodSpeed Performance ReportMerging #5813 will not alter performanceComparing Summary
|
No description provided.