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

Add React Developers Tools #1410

Merged
merged 1 commit into from
Nov 24, 2020
Merged

Conversation

panuhorsmalahti
Copy link
Contributor

Add React Developers Tools to the Electron app for debugging purposes.

* The dependency is not bundled to the production build.
*/
export const installDeveloperTools = async () => {
if (process.env.NODE_ENV === 'development') {
Copy link
Contributor

Choose a reason for hiding this comment

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

isDevelopment variable is available in common/vars.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we use the environment variable through a variable assignment, then webpack can't optimize the build. In other words if isDevelopment is used, the code inside the if branch is included in the production build. However it appears the dependency itself (electron-devtools-installer) is excluded in both cases, but I'd still keep using process.env directly to make sure future changes will exclude the code too.

@chenhunghan
Copy link
Contributor

I tested the branch locally, the React developer tools is working fine, not sure why the integration failed https://dev.azure.com/lensapp/lensapp/_build/results?buildId=3499&view=logs&j=93056758-5bfb-5750-f113-e720ddefdb4c&t=39774cca-89df-5118-1dfb-4fca56fe47ed&l=994

@panuhorsmalahti panuhorsmalahti force-pushed the feature/add-react-devtools branch 5 times, most recently from d349645 to 6d7028c Compare November 24, 2020 08:27
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
Copy link
Contributor

@nevalla nevalla left a comment

Choose a reason for hiding this comment

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

LGTM

@panuhorsmalahti panuhorsmalahti merged commit 2a8cfe5 into master Nov 24, 2020
@panuhorsmalahti panuhorsmalahti deleted the feature/add-react-devtools branch November 24, 2020 10:45
@jakolehm jakolehm mentioned this pull request Nov 25, 2020
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.

3 participants