Update tsconfigs to node 18 (current LTS) (#24471)# Why Expo supports Node.js LTS, this is currently Node 18. This PR updates from 14 to 18. <!-- Please describe the motivation for this PR,
Update tsconfigs to node 18 (current LTS) (#24471)# Why Expo supports Node.js LTS, this is currently Node 18. This PR updates from 14 to 18. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> --------- Co-authored-by: Expo Bot <[email protected]>
show more ...
feat(cli): ensure port is running after build. (#24315)# Why If a user runs either build command (`npx expo run:ios` or `npx expo run:android`) simultaneously, then there is chance for a port c
feat(cli): ensure port is running after build. (#24315)# Why If a user runs either build command (`npx expo run:ios` or `npx expo run:android`) simultaneously, then there is chance for a port conflict. This change proposes we run a secondary port check after the build to provide a slightly better user experience. If the port is taken by the same app, the dev server will be skipped and the process will proceed in headless-mode, if the port is taken by a different process, then an error will be thrown. --------- Co-authored-by: Expo Bot <[email protected]>
[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)Why --- Prettier 3 is out. Add support for it with this linter config. **Note for reviewer:** the first commit is the one with th
[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)Why --- Prettier 3 is out. Add support for it with this linter config. **Note for reviewer:** the first commit is the one with the actual changes. The rest of this PR are changes to get the linter passing (mostly autofix). How --- Update eslint-config-prettier and eslint-plugin-prettier. To address deprecation warnings, also update typescript-eslint/parser and typescript-eslint/eslint-plugin. Because of an update to typescript-eslint/parser, we need to suppress deprecation warnings (documented in a comment). Regenerated test snapshots. Due to the upgraded dependencies, typecasts and optional chaining are now auto-fixable by lint. This converts warnings into autofixes. Test Plan --- `yarn test` in the linter config. Run `expotools check --all --fix-lint --no-build --no-test --no-uniformity-check` to try this config on the whole repo. --------- Co-authored-by: Expo Bot <[email protected]>
Fix bug preventing non-standard xcode projects from running with `npx expo run:ios`. (#23831)# Why Bug discovered when running with `@bacons/xcode` which correctly asserts that `TargetAttribute
Fix bug preventing non-standard xcode projects from running with `npx expo run:ios`. (#23831)# Why Bug discovered when running with `@bacons/xcode` which correctly asserts that `TargetAttributes` is not required. This bug shouldn't break standard SDK 49 since we do define `TargetAttributes` by default https://github.com/expo/expo/blob/ee9ef118cc3ddf1ae2ed311b4a50e770ce55f6db/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj#L165. But `@bacons/xcode` could "corrupt" the project, will take a pass at that next. --------- Co-authored-by: Expo Bot <[email protected]>
[cli][packages] unify the default dev server port to 8081 (#22880)# Why for historical reasons, when running `npx expo start` the dev-server listens to port 19000, and running `npx expo start --
[cli][packages] unify the default dev server port to 8081 (#22880)# Why for historical reasons, when running `npx expo start` the dev-server listens to port 19000, and running `npx expo start --dev-client` it listens to port 8081. since we are now on our effort to deprecate `--dev-client` option, it is better to unify the listening port. close ENG-8936 # How - update packages/**/*.ts for port 19000 -> 8081 - search more occurrences for 19000 to 8081 # Test Plan - ci passed - bare-expo - unversioned expo go + ncl
feat(cli, metro-config): environment variable support (#21983)# Why - It's nice to be able to use uncommitted values in your app, based on the environment. This feels very familiar to web devel
feat(cli, metro-config): environment variable support (#21983)# Why - It's nice to be able to use uncommitted values in your app, based on the environment. This feels very familiar to web developers. - Values that are prefixed with `EXPO_PUBLIC_` will be inlined in the bundle when bundling normally (e.g. not for Node.js). - `.env` files are loaded into memory and applied to the process during a run. This also means that they're available in `app.config.js`. - During development-only, environment variables are exposed on the `process.env` object (non-enumerable) to ensure they're available between fast refresh updates. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Create new package `@expo/env` which is used to hydrate env variables in a unified way. I plan to open another PR in `eas-cli` which uses this package to fill in environment variables before uploading. NOTE: environment variables that are defined in eas.json are not available in Expo CLI when building locally, but are available in the cloud since they'll be on the process, this means they effectively emulate `.env.production`. - Update templates to gitignore local env files. - Add basic documentation to the versioned metro guide (more to come). <!-- How did you build this feature or fix this bug and why? --> # Test Plan - [ ] E2E rendering test - [ ] E2E Node.js rendering test - [x] Unit tests for serializer - [x] Tests for env package <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # 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 `expo prebuild` & EAS Build (eg: updated a module plugin).
feat(expo)!: use Expo CLI when building for development in Xcode (#21397)# Why - Related #21396 - Use `npx expo start --dev-client` instead of `npx react-native start` when building a project
feat(expo)!: use Expo CLI when building for development in Xcode (#21397)# Why - Related #21396 - Use `npx expo start --dev-client` instead of `npx react-native start` when building a project from Xcode. This ensures we use the correct version of Metro regardless of where the project is started. - It's unclear if building from Android Studio is supposed to trigger the bundler in development but I couldn't get it to do so, so this PR is iOS-only. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Copy over a bunch of the default scripts from `react-native/scripts` into the same locations in `expo/scripts` to make it easy to maintain this change and simple to migrate. I decided to omit the following as it appeared to be unused (sets RCT_METRO_PORT): ``` source "$THIS_DIR/.packager.env" ``` I also dropped: - Support for `$RCT_PACKAGER_LOGS_DIR`. - The `Process terminated. Press <enter> to close the window` log that is presented after closing the dev server. - Support for a custom React Native CLI config (this is not supported in Expo CLI). <!-- How did you build this feature or fix this bug and why? --> # Test Plan - TBD - Building for development from Xcode causes a terminal window running `npx expo start` will open instead of the community version. <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # 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 `expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <[email protected]> Co-authored-by: Kudo Chien <[email protected]>
feat(cli)!: set node and babel env for CLI commands (#21337)# Why - User's may want to dynamically configure Metro or their Expo Config file to work differently when bundling for production env
feat(cli)!: set node and babel env for CLI commands (#21337)# Why - User's may want to dynamically configure Metro or their Expo Config file to work differently when bundling for production environments, they can now do this by utilizing the standard `NODE_ENV` environment variable. We've been doing this with Webpack since it was introduced. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Set `NODE_ENV` and `BABEL_ENV` environment variables to `development` or `production` in `start`, `export`, `customize`, `install`, `run:ios`, `run:android`, `config`, `prebuild` commands based on the input mode. - This can be overwritten by setting `NODE_ENV` and `BABEL_ENV` manually before running. `BABEL_ENV` will be set to `NODE_ENV` if defined. - Most commands can safely default to assuming `development`. - Only thing that this doesn't cover is `npx react-native bundle` and `npx react-native start` (building from Xcode/Android Studio). We'll need to change these commands in the future but it shouldn't be blocking for this PR. <!-- How did you build this feature or fix this bug and why? --> # Test Plan <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # 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 `expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <[email protected]>
feat(cli): improve ios multi-scheme resolution (#21240)# Why - Building app clips onto a native device will fail because the protocol appears to be unimplemented natively on-device. - When an
feat(cli): improve ios multi-scheme resolution (#21240)# Why - Building app clips onto a native device will fail because the protocol appears to be unimplemented natively on-device. - When an iOS project has multiple schemes, the default scheme should be the first application scheme if available. This prevents the addition of something like App Clips from breaking the default behavior. --------- Co-authored-by: Expo Bot <[email protected]>
fix(cli): auto-detect the TLS version based on current node version (#21169)# Why After debugging this issue https://github.com/byCedric/expo-monorepo-example/issues/84, it seems that we are h
fix(cli): auto-detect the TLS version based on current node version (#21169)# Why After debugging this issue https://github.com/byCedric/expo-monorepo-example/issues/84, it seems that we are having trouble with the internals of `expo run:ios`. What's happening here are two major things: 1. Node 17+ is throwing an internal OpenSSL error when establishing a secure TLS connection to the iOS device. This is caused by the explicit `secureProtocol` option, which is set to `TLSv1_method`. 2. We don't have any error event handlers when opening (secure) sockets to iOS devices. These two issues together result in `expo run:ios` not-installing the app on the device. Luckily, it does build the app. But, due to the missing error handlers, we are swallowing the underlying error and the installation part is [stuck on a promise](https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/run/ios/appleDevice/AppleDevice.ts#L143) that will never be resolved. Here is the chain that's getting blocked by issue 2 (caused by issue 1) - `clientManager.getMobileImageMounterClient` - `this.getServiceClient('com.apple.mobile.mobile_image_mounter', MobileImageMounterClient)` - `lockdowndClient.startService(name)` is invoked (from `MobileImageMounterClient`) - `LockdownProtocolClient.sendMessage` is invoked (with `StartService`, `com.apple.mobile.mobile_image_mounter`) - `ProtocolClient.sendMessage` is invoked - Socket TLS handshake fails, but the `socket.on('error')` is not set. So the error is never received. # How - Removed the explicit `TLSv1_method` from `tls.createSecureContext` - Added error handlers to surface underlying errors After removing the fixed TLS method, it seems to use TLSv1.2 by default. # Test Plan Test `main` on Node 17+, while adding `enableTrace: true` and `socket.on('error', (error) => console.log(error));` to the changes I made > This should fail with an internal socket/openssl error Test this PR on Node 16, and Node 18 > This should NOT fail # 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 `expo prebuild` & EAS Build (eg: updated a module plugin).
[cli] fix getting UDID for network connected iOS devices (#20279)
feat(cli): sign simulator builds (#19505)* feat: code sign simulator builds with entitlements * Update CHANGELOG.md * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <34669
feat(cli): sign simulator builds (#19505)* feat: code sign simulator builds with entitlements * Update CHANGELOG.md * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * chore(cli): add tests * Update simulatorCodeSigning.ts Co-authored-by: Expo Bot <[email protected]>
feat(cli): disable prompts in non interactive processes (#18300)* feat(cli): disable prompts in non interactive processes * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <34
feat(cli): disable prompts in non interactive processes (#18300)* feat(cli): disable prompts in non interactive processes * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * Update startAsync.ts * fix tests Co-authored-by: Expo Bot <[email protected]>
feat(cli): add `run:ios` command (#16662)* [wip] Added expo run:ios command * Clean up run:ios * feat(cli): add headless server mode * fix(cli): fix run:ios logic issues * Update CHANGE
feat(cli): add `run:ios` command (#16662)* [wip] Added expo run:ios command * Clean up run:ios * feat(cli): add headless server mode * fix(cli): fix run:ios logic issues * Update CHANGELOG.md * Update packages/expo/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * clean up * refine fixture * refactor and test code signing * Update resolveOptionsAsync.ts * fix merge * added new impl * Update AppleDevice.ts * Added more tests * fixed e2e tests * lint fix * Update index-test.ts Co-authored-by: Expo Bot <[email protected]>