Skip to content

Preserve entry.client.js in prod mode#5813

Merged
adhami3310 merged 1 commit into
mainfrom
masenf/preserve-entry-client
Sep 22, 2025
Merged

Preserve entry.client.js in prod mode#5813
adhami3310 merged 1 commit into
mainfrom
masenf/preserve-entry-client

Conversation

@masenf

@masenf masenf commented Sep 22, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Edit Code Review Bot Settings | Greptile

@codspeed-hq

codspeed-hq Bot commented Sep 22, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #5813 will not alter performance

Comparing masenf/preserve-entry-client (47034ff) with main (4468e14)

Summary

✅ 8 untouched

@adhami3310 adhami3310 merged commit 59c980e into main Sep 22, 2025
40 of 41 checks passed
@adhami3310 adhami3310 deleted the masenf/preserve-entry-client branch September 22, 2025 20:49
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