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(cli): skip loading the telemetry client when disabled #24841

Merged
merged 4 commits into from Oct 12, 2023

Conversation

byCedric
Copy link
Member

@byCedric byCedric commented Oct 12, 2023

Why

When the telemetry client is not enabled, we don't have to load it. This does exactly that, mostly for commands that should execute pretty much instantly (like npx expo config).

How

  • Added check before loading the telemetry client in bin/cli.ts

Test Plan

You can test the performance increase in a project using hyperfine:

image

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Oct 12, 2023
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Oct 12, 2023
@byCedric byCedric merged commit d2ff888 into main Oct 12, 2023
4 of 6 checks passed
@byCedric byCedric deleted the @bycedric/cli/not-load-telemetry-when-disabled branch October 12, 2023 17:15
marklawlor pushed a commit that referenced this pull request Oct 30, 2023
# Why

When the telemetry client is not enabled, we don't have to load it. This
does exactly that, mostly for commands that should execute pretty much
instantly (like `npx expo config`).

# How

- Added check before loading the telemetry client in `bin/cli.ts`

# Test Plan

You can test the performance increase in a project using hyperfine:

<img width="891" alt="image"
src="https://github.com/expo/expo/assets/1203991/a892cc19-cad0-4f35-b687-31e2ada29147">

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants