Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: don't include DevtoolsOverlay & TraceUpdateOverlay in the production bundle #40749

Closed
wants to merge 1 commit into from

Conversation

ecreeth
Copy link
Contributor

@ecreeth ecreeth commented Oct 9, 2023

Summary:

Currently, when we build the app in production mode the DevtoolsOverlay & TraceUpdateOverlay are bundle

Changelog:

[GENERAL][REMOVED]: removed DevtoolsOverlay & TraceUpdateOverlay from production bundle

Test Plan:

  1. Build the app in production mode
  2. Check that both DevtoolsOverlay & TraceUpdateOverlay are included in the bundle

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Oct 9, 2023
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Warnings
⚠️ One hour and a half have passed and the E2E jobs haven't finished yet.

Generated by 🚫 dangerJS against 1f747a1

@hoxyq hoxyq self-requested a review October 10, 2023 12:50
@facebook-github-bot
Copy link
Contributor

@hoxyq has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@luluwu2032
Copy link
Contributor

All callsites of "mountReactDevToolsOverlays" are already guarded by dev check at

@hoxyq
Copy link
Contributor

hoxyq commented Oct 10, 2023

All callsites of "mountReactDevToolsOverlays" are already guarded by dev check at

Yes, need to validate that this is enough for Metro to exclude these components from the production bundle. If not, then wrapping in DEV is required.

@ecreeth
Copy link
Contributor Author

ecreeth commented Oct 10, 2023

All callsites of "mountReactDevToolsOverlays" are already guarded by dev check at

We need to add the __DEV__ check in mountReactDevToolsOverlays in order to work properly. If we don't do it, metro will remove the code inside of componentDidMount, but won't remove the mountReactDevToolsOverlays related code.

@ecreeth
Copy link
Contributor Author

ecreeth commented Oct 10, 2023

You can see that if we don't add the check, the code is included in the bundle. (RN rn0730rc1)
image

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Oct 11, 2023
@facebook-github-bot
Copy link
Contributor

@hoxyq merged this pull request in 0004888.

@ecreeth ecreeth deleted the refactor-app-container branch October 11, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants