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

No analytics in production #3922

Merged
merged 2 commits into from
Aug 27, 2021
Merged

No analytics in production #3922

merged 2 commits into from
Aug 27, 2021

Conversation

kneth
Copy link
Contributor

@kneth kneth commented Aug 24, 2021

What, How & Why?

The environment variable NODE_ENV is today commonly used by many JavaScript framework. We can use the variable to disable analytics for test and production stages.

NODE_ENV is set or used by:

NODE_ENV is not set by:

☑️ ToDos

  • 📝 Changelog entry
  • [ ] 📝 Compatibility label is updated or copied from previous entry
  • [ ] 🚦 Tests
  • [ ] 📝 Public documentation PR created or is not necessary
  • [ ] 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • [ ] typescript definitions file is updated
  • [ ] jsdoc files updated
  • [ ] Chrome debug API is updated if API is available on React Native

@nirinchev
Copy link
Member

Is this going to work with Electron? I believe the suggestion there is to use app.isPackaged, but not sure if it also sets NODE_ENV.

@kneth
Copy link
Contributor Author

kneth commented Aug 25, 2021

Is this going to work with Electron? I believe the suggestion there is to use app.isPackaged, but not sure if it also sets NODE_ENV.

Electron is often used with a JavaScript framework (React, maybe) which will cover many cases. The documentation is hinting that app.isPackaged doesn't guarantee that you can detect development or production stage. Still, it might be the best we can do for now.

@kneth kneth force-pushed the kneth/no-analytics-in-production branch from 1c22adb to 04337e8 Compare August 27, 2021 14:41
@kneth kneth merged commit 3b1d1f4 into master Aug 27, 2021
@kneth kneth deleted the kneth/no-analytics-in-production branch August 27, 2021 16:00
Copy link

@fronck fronck left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants