Skip to content

Commit

Permalink
refactor: don't include DevtoolsOverlay & TraceUpdateOverlay in t…
Browse files Browse the repository at this point in the history
…he production bundle (#40749)

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

## Changelog:

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

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: #40749

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

Reviewed By: robhogan, NickGerleman

Differential Revision: D50121208

Pulled By: hoxyq

fbshipit-source-id: 3e1fb506c679ec79b116dea9772d372cd2ea9ca9
  • Loading branch information
ecreeth authored and facebook-github-bot committed Oct 11, 2023
1 parent cd78e39 commit 0004888
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/react-native/Libraries/ReactNative/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ class AppContainer extends React.Component<Props, State> {
static getDerivedStateFromError: any = undefined;

mountReactDevToolsOverlays(): void {
const DevtoolsOverlay = require('../Inspector/DevtoolsOverlay').default;
const devtoolsOverlay = <DevtoolsOverlay inspectedView={this._mainRef} />;
if (__DEV__) {
const DevtoolsOverlay = require('../Inspector/DevtoolsOverlay').default;
const devtoolsOverlay = <DevtoolsOverlay inspectedView={this._mainRef} />;

const TraceUpdateOverlay =
require('../Components/TraceUpdateOverlay/TraceUpdateOverlay').default;
const traceUpdateOverlay = <TraceUpdateOverlay />;
const TraceUpdateOverlay =
require('../Components/TraceUpdateOverlay/TraceUpdateOverlay').default;
const traceUpdateOverlay = <TraceUpdateOverlay />;

this.setState({devtoolsOverlay, traceUpdateOverlay});
this.setState({devtoolsOverlay, traceUpdateOverlay});
}
}

componentDidMount(): void {
Expand Down

0 comments on commit 0004888

Please sign in to comment.