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 configuration option to specify arguments passed to expo start #991

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

kmagiera
Copy link
Member

In one of the projects we heard the feedback from, they use --scheme option provided to expo start command. This is necessary for legacy reasons that they keep using expo this way.

The --scheme option makes it so that expo bundler uses the provided scheme when generating app URLs that we use for launching the app when expo dev client is detected. We eventually want to avoid relying on launching dev clients via URL, but the necessary changes only landed in SDK 52 (expo/expo#33182), so for compatibility reasons we need to have a way for the schema to be customized on older versions (and until we add a way to launch dev client with extra arguments like proposed here expo/expo#33182)

For the time being, the easiest workaround is to extend the launch configuration and give option to pass additional arguments to expo start. It doesn't appear like any other args really make sense to be added, yet giving more genering "args" option seem to require less explanation.

How Has This Been Tested:

  1. Launch expo dev client project – make sure nothing breaks
  2. Add --scheme something' as extra args in launch configuration. See that it wouldn't launch and in debug logs you'll see that the app tries to launch using something://` scheme

Copy link

vercel bot commented Feb 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 0:43am

Copy link
Contributor

@jwajgelt jwajgelt left a comment

Choose a reason for hiding this comment

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

No real issues I can see.

Comment on lines 139 to 143
appRootFolder: string,
libPath: string,
resetCache: boolean,
expoStartExtraArgs: string[] | undefined,
metroEnv: typeof process.env
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:
5 is a lot of arguments, it might be better to pack them in a struct.

Suggested change
appRootFolder: string,
libPath: string,
resetCache: boolean,
expoStartExtraArgs: string[] | undefined,
metroEnv: typeof process.env
{
appRootFolder,
libPath,
resetCache,
expoStartExtraArgs,
metroEnv
}: LaunchExpoMetroArgs

@kmagiera kmagiera merged commit 7248273 into main Feb 27, 2025
4 checks passed
@kmagiera kmagiera deleted the kmagiera/expo-start-extra-args branch February 27, 2025 23:13
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.

2 participants