[bare-expo][templates] add gradle.properties to disable runtime scheduler (#23117)# Why we found some regression in sdk 49 for `useEffect` due to the `unstable_useRuntimeSchedulerAlways` change.
[bare-expo][templates] add gradle.properties to disable runtime scheduler (#23117)# Why we found some regression in sdk 49 for `useEffect` due to the `unstable_useRuntimeSchedulerAlways` change. though it is unclear how is it going in the meantime. let's add the workaround to disable to `unstable_useRuntimeSchedulerAlways`. # How since it is a workaround, i don't want to add the expo-build-properties support. if people come across the useEffect regression and want to test for `unstable_useRuntimeSchedulerAlways=false`. they could have an inline config-plugin ```js # app.config.js const { withGradleProperties } = require("expo/config-plugins"); function disableUnstableRuntimeScheduler(config) { const KEY = "reactNative.unstable_useRuntimeSchedulerAlways"; return withGradleProperties(config, (config) => { config.modResults = config.modResults.filter( (item) => !(item.type === "property" && item.key === KEY) ); config.modResults.push({ type: "property", key: KEY, value: "false", }); return config; }); } export default ({ config }) => { config.plugins = [...(config.plugins ?? []), disableUnstableRuntimeScheduler]; return config; }; ``` # Test Plan ci passed
show more ...
Upgrade react-native 0.72.0-rc.5 (#22588)# Why upgrade react-native 0.72 for sdk 49 close ENG-8011 # How - bump package versions - `react-native 0.71.3 -> 0.72.0-rc.5` - `metro-reac
Upgrade react-native 0.72.0-rc.5 (#22588)# Why upgrade react-native 0.72 for sdk 49 close ENG-8011 # How - bump package versions - `react-native 0.71.3 -> 0.72.0-rc.5` - `metro-react-native-babel-preset 0.73.9 -> 0.76.5` - [bare-expo][templates][fabric-tester] migrate template base on [upgrade-helper](https://react-native-community.github.io/upgrade-helper/?from=0.71.7&to=0.72.0-rc.5) - [expo-template-tabs] remove the metro version overrides for expo-router. - [core][dev-laucher][dev-menu][media-library][screen-orientation][splash-screen][updates-interface][updates] add the `install_modules_dependencies` to support new architecture + use_frameworks! - [core][autolinking] fix some new architecture error on ios - [react-native-lab] update our fork to 0.72.0-rc.5 based - [go][tools] fix **react-native-lab/react-native/packages/react-native** path move because of react-native's repo monorepo changes - [go][android] fix gradle 8 errors - [go][ios] add `RCT_REMOTE_PROFILE=0` to fix the `RCT_ENABLE_INSPECTOR needs to be set to fulfill RCT_REMOTE_PROFILE` build error - [ncl] remove `ProgressViewIOS` / `ProgressBarAndroid` since they are deprecated/removed in 0.72 - [dev-menu][dev-launcher] rebuild bundles # Note - react-native-web is not bumped because of the [issue](https://github.com/necolas/react-native-web/issues/2523), so it's still react-native-web@~0.18.10. - currently disable ci typecheck for @expo/cli because of upstream metro typescript support. i'll have another pr to fix those errors. - updates e2e ci on android is broken at [here](https://github.com/expo/expo/blob/fada3d764957779fbfc3d7b723d185db1d933d95/packages/expo-updates/e2e/fixtures/Updates.e2e.ts#L518). i doubt if that's related to the react scheduler change. i'd disabled the failed test case. - the react-native upstream [migrated away the `@types/jest`](https://github.com/facebook/react-native/pull/36068). i was afraid that will be a breaking change to the existing jest test code since it requires the explicit `@jest/globals` import. i didn't do this in this upgrade. # Test Plan - ✅ fabric-tester (without expo-dev-client) - ✅ ci passed. there are some errors which are known: - updates e2e on android: as mentioned above - ios expo go on eas build: versioned expo go are broken on eas build m1 worker. this is also happening on main. - android client: no space left on the ubuntu worker. this is also happening on main. - ✅ bare-expo - ✅ unversioned expo go + ncl --------- Co-authored-by: Tomasz Sapeta <[email protected]>
feat(metro-config): support any entry file in development builds that don't use Expo dev client (#21643)# Why - React Native enforces that apps must use `index.js` as the entry file, this is hi
feat(metro-config): support any entry file in development builds that don't use Expo dev client (#21643)# Why - React Native enforces that apps must use `index.js` as the entry file, this is highly inconvenient and forces us to change the app entry on `expo prebuild` (cite: [prebuild side effects](https://github.com/expo/expo/blob/4d2795e/docs/pages/workflow/prebuild.mdx#side-effects) (`index.js` and `package.json` `scripts`)). - In #14964 I added support for production Android apps to use any entry point. - In #18381 I added the same support to iOS apps in production. - Development builds using `expo-dev-client` and Expo Go both use a manifest which support arbitrary entry points. - This just leaves development builds that don't have Expo code-loading support (e.g. no manifest/index.html where the script can be changed dynamically). # How - This PR introduces the virtual entry file `.expo/.virtual-metro-entry` which should never physically exist. When this endpoint is pinged, Expo CLI will rewrite the the URL to the correct entry point based on the project configuration. This enables us to fully drop the prebuild side-effect as no case will require an `index.js` (`index.bundle`) as the entry file. - The rewrite means Metro will never support a physical file located at `.expo/.virtual-metro-entry.js` as this will always be ignored. We could support forwarding the request if this file exists but we'll probably go the other way and assert if this file exists to mitigate possible confusion. - The name `.expo/.virtual-metro-entry.js` was chosen to be clear and long enough that users wouldn't try to actually create this file. - I originally tried using a middleware to perform the redirect but this wouldn't work with the HMR server which emulates pinging the endpoint in-memory. Because of this, I went with the metro `server.rewriteRequestUrl` function. > This feature is implemented in Expo's Metro configuration, meaning it should apply to `npx react-native start` (but this is untested and not officially supported). ## New Setup Instructions for non-prebuild users Non-prebuild projects will need to modify their `AppDelegate.mm` as follows: ```diff - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG - return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"]; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } ``` And their `android/app/src/main/java/***/MainApplication.java`: ```diff @Override protected String getJSMainModuleName() { - return "index"; + return ".expo/.virtual-metro-entry"; } ``` This is of course in addition to the `android/app/build.gradle`: ```groovy entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim()) ``` And iOS production change: ``` shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" $PROJECT_ROOT ios relative | tail -n 1)\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n"; ``` # Test Plan ### Continuous(-ish) - Updated the templates to use this new format. ### Quick test - Start the dev server and ping the entry URL directly: - `http://localhost:8081/.expo/.virtual-metro-entry.bundle?platform=web&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true` - The redirected URL should show in the `sourceURL` at the end of the file. ### E2E - Prebuild, then apply the native changes in a local projects - Use the following `metro.config.js` (you don't need to use the latest Expo CLI for this to work): ```js // Learn more https://docs.expo.io/guides/customizing-metro const { getDefaultConfig } = require("../../expo/packages/@expo/metro-config"); // const { getDefaultConfig } = require('expo/metro-config'); module.exports = getDefaultConfig(__dirname); ``` - `npx expo run:ios` and `npx expo run:android` should point to `index.bundle` - Changing the `main` field in the package.json or deleting `index.js` should continue to work when you reload the app. # 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]>
[1/3] upgrade react-native 0.71 (#20799)# Why upgrade react-native 0.71 for sdk 48 close ENG-7192 # How - update package versions - `react: 18.1.0 -> 18.2.0` - `react-native 0.70.5
[1/3] upgrade react-native 0.71 (#20799)# Why upgrade react-native 0.71 for sdk 48 close ENG-7192 # How - update package versions - `react: 18.1.0 -> 18.2.0` - `react-native 0.70.5 -> 0.71.0` - `react-dom: 18.1.0 -> 18.2.0` - `react-test-renderer: 18.1.0 -> 18.2.0` - `react-native-web: 0.18.9 -> 0.18.10` - `babel-plugin-react-native-web: 0.18.9 -> 0.18.10` - `metro-react-native-babel-preset: 0.72.3 -> 0.73.5` - upgrade three project templates based on [upgrade-helper](https://react-native-community.github.io/upgrade-helper/?from=0.70.6&to=0.71.0) - bare-expo - expo-template-bare-minimum - fabric-tester (this is based on `npx expo prebuild --clean --no-install --template /path/to/expo-template-bare-minimum.tgz`) so it includes some inconsistent changes - [@expo/config-plugins]: support 0.71 template transform. the `namespace` in build.gradle and the files in `release` build variants - [fbjni] upgrade 0.3.0 to align 0.71 (also ndk version) - [expo-updates] move the `EX_UPDATES_NATIVE_DEBUG` `bundleInDebug` setup to templates. unfortunately, because RNGP setups the task dependencies pretty early. the original setup in expo-updates build.gradle is too late. note that the change doesn't reference any files from templates to expo-updates package. somehow it's not tightly coupled. - [native-tests / expo-modules-test-core / expo-modules-autolinking] fix ios unit test build error because jsc now in a dedicated podspec. in theory, the ios native unit test could now run on hermes as well. - for other details, please check commit histories one by one. # Test Plan - bare-expo ios / android - fabric ios / android - ci passed (except ios) - test-suite ios is broken for unknown reasons. it breaks only on github actions and hermes. for nightlies testing, i also [changed it to jsc](https://github.com/expo/expo/blob/1e029c89c4247802cc4880e27e116a6b4c71c502/tools/src/commands/SetupReactNativeNightly.ts#L287-L293) to make ci green. i'll try to follow up and investigate the root cause.
[bare-expo] Fix Flipper crash in release mode (#19508)# Why Running `ReactNativeFlipper.initializeFlipper` in release mode causes the app to crash. # How Only call `ReactNativeFlipper.init
[bare-expo] Fix Flipper crash in release mode (#19508)# Why Running `ReactNativeFlipper.initializeFlipper` in release mode causes the app to crash. # How Only call `ReactNativeFlipper.initializeFlipper` in debug # Test Plan `./gradlew installRelease` from `apps/bare-expo/android`
Upgrade to react-native 0.69 (#18006)# Why for sdk 46 close ENG-5353 # How - update packages - react -> 18.0.0 - react-native -> 0.69.0 - react-dom -> 18.0.0 - react-native-w
Upgrade to react-native 0.69 (#18006)# Why for sdk 46 close ENG-5353 # How - update packages - react -> 18.0.0 - react-native -> 0.69.0 - react-dom -> 18.0.0 - react-native-web -> ~0.18.1 - react-test-renderer -> ~18.0.0 - @types/react -> ~18.0.14 - @types/react-native -> ~0.69.1 - early patch react-native for 0.69.1 fixes - https://github.com/facebook/react-native/commit/43f831b - https://github.com/facebook/react-native/commit/c2088e1 - https://github.com/facebook/react-native/commit/f97c6a5 - https://github.com/facebook/react-native/commit/79baca6 - https://github.com/facebook/react-native/pull/34064#issuecomment-1168810152 - migrate `expo-template-bare-minimum`, `bare-expo`, `bare-sandbox` to 0.69. reference from https://react-native-community.github.io/upgrade-helper/?from=0.68.1&to=0.69.0 - also remove the `hermesCommand` because 0.69 uses the builtin hermes-engine - `expo-av`, `expo-modules-core`, `expo-gl-cpp`: fix android cpp building errors, because 0.69 ships both release and debug aar - `expo-dev-client`: fix android build error from RedBox package rename - `html-elements`: update RNWView where react-native-web removed [the `css` import](https://github.com/necolas/react-native-web/commit/b27c9820) - `expo`: move Expo.podspec out from ios, because newer [rn-cli removed the `podspecPath` and `project` support](https://github.com/react-native-community/cli/commit/25eec7c#diff-0dddbcedebb33032fcac5991f3dcdfa44157e6ae87afcf3dabcd240a0db09832L58). - [ ] disable dev-client because the vendored reanimated in dev menu doesn't support 0.69 yet, e.g. `folly_json -> folly_runtime` - update reanimated and gesture-handler to latest for 0.69 support - `jest-expo`: update to [fix the deprecated react-native-web jest preset](https://github.com/necolas/react-native-web/commit/9b0c119) - `NCL`, `home`, patch `react-native-svg`: fix react 18 that [`children` should be explicitly added](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-typescript-definitions) - `@expo/cli` fix react-native-web and react-dom version checks # Test Plan - android bare-expo smoke test - ios bare-expo smoke test - ci passed - updates e2e is broken because in the flow the react-native doesn't include 0.69.1 fixes.
[bare-expo][Android] Solution for `rn-screens` problem https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067 (#17642)
[android][ios] Upgrade to react-native 0.68 (#16532)# Why targeting react-native 0.68 in sdk 45 even though it's rc now. # How - [x] upgrade package.json - [x] migrate bare-expo - [x] mi
[android][ios] Upgrade to react-native 0.68 (#16532)# Why targeting react-native 0.68 in sdk 45 even though it's rc now. # How - [x] upgrade package.json - [x] migrate bare-expo - [x] migrate expo-template-bare-minimum - [x] migrate bare-sandbox ❗️ reanimated build error because our previous integration is broken on AGP 7. solution in [the pr](https://github.com/software-mansion/react-native-reanimated/pull/3113). since the pr is not landed yet, i have a [temporarily workaround to patch reanimated](https://github.com/expo/expo/pull/16532/commits/8e5662bec377ea11edc21ec6114c39f6580cb56a). # Test Plan - android bare-expo launch test - ios bare-expo launch test
[expo-dev-client] restore ability of host apps to disable dev client (#16521)
[expo-dev-client][expo-modules-core] Android automatic setup of dev client (#16441)
[android][ios] Upgrade react-native-gesture-handler to 2.0.0 (#15404)# Why upgrade react-native-gesture-handler to 2.0.0 for sdk 44 close ENG-2591 # How - update versioning script - `et
[android][ios] Upgrade react-native-gesture-handler to 2.0.0 (#15404)# Why upgrade react-native-gesture-handler to 2.0.0 for sdk 44 close ENG-2591 # How - update versioning script - `et uvm -m react-native-gesture-handler -c "2a279196b7023596c13ea162fb2d73309c42d90e"` - remove deprecated RNGestureHandlerEnabledRootView - publish dev home because there's gesture-handler in bundle - [TODO] publish local bundle # Test Plan - android unversioned Expo Go + NCL - ios unversioned Expo Go + NCL - bare-expo android + NCL
[bare-expo][android] Install reanimated v2 (#14586)# Why Currently, react-native-reanimated wasn't installed in the bare-expo project on Android. # How - Added symlink, otherwise, the rean
[bare-expo][android] Install reanimated v2 (#14586)# Why Currently, react-native-reanimated wasn't installed in the bare-expo project on Android. # How - Added symlink, otherwise, the reaniamted's aar won't be linked correctly. - Added `JSIModulePackage` to app host. # Test Plan - bare-expo with NCL reanimated example
Make expo package linkable by RN instead of expo-modules-core (#14277)
[splash-screen] setup resizeMode by resource instead of code (#14061)# Why save config-plugin to use dangerous mod for modifying some splash screen styles like `resizeMode` # How based on
[splash-screen] setup resizeMode by resource instead of code (#14061)# Why save config-plugin to use dangerous mod for modifying some splash screen styles like `resizeMode` # How based on #13457 we had the in-module `show` for splash screen. this pr additionally moves `resizeMode` and `statusBarTranslucent` into resource. with the help of gradle system, application could easily override the library default value. bare-expo changes in this pr is an example of that. # Migration Guide for expo-splash-screen < 0.12.0 The changes in the pr are backward compatible, the code for `expo-splash-screen` will still work as it used to be. However, if you are going to migrate as new style API, here are the steps: 1. Migrate your project from react-native-unimodules to expo-modules-core 2. Remove expo-splash-screen code from MainActivity ```diff --- a/android/app/src/main/java/com/helloworld/MainActivity.java +++ b/android/app/src/main/java/com/helloworld/MainActivity.java import com.facebook.react.ReactRootView; import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; -import expo.modules.splashscreen.singletons.SplashScreen; -import expo.modules.splashscreen.SplashScreenImageResizeMode; - public class MainActivity extends ReactActivity { @Override protected void onCreate(Bundle savedInstanceState) { // This is required for expo-splash-screen. setTheme(R.style.AppTheme); super.onCreate(null); - // SplashScreen.show(...) has to be called after super.onCreate(...) - // Below line is handled by '@expo/configure-splash-screen' command and it's discouraged to modify it manually - SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, ReactRootView.class, false); } ``` 3. Override default `resizeMode` and `statusBarTranslucent` in stings.xml ```diff --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <resources> <string name="app_name">sdk42</string> + <string name="expo_splash_screen_resize_mode">contain</string> + <string name="expo_splash_screen_status_bar_translucent">false</string> </resources> ``` # Test Plan check bare-expo android app to show the same splash screen before and after. # Checklist - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.io and README.md). - [x] Update configure-splash-screen https://github.com/expo/expo-cli/pull/3774 - [x] This diff will work correctly for `expo build` (eg: updated `@expo/xdl`). - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin): https://github.com/expo/expo-cli/pull/3784
[expo-modules] Move code from `unimodules` into `expo-modules-core` (#13703)# Why Migrated `unimodules-core`, `unimodules-react-native-adapter`, `unimodules-app-loader` into `expo-modules-core`
[expo-modules] Move code from `unimodules` into `expo-modules-core` (#13703)# Why Migrated `unimodules-core`, `unimodules-react-native-adapter`, `unimodules-app-loader` into `expo-modules-core` # How - Change package using AS refactor tools - Fix some places where AS wasn't able to do automatically - Fix compatibility with new auto-linking - Ensure that classes which are used during installation steps are still available in the old place # Test Plan - expo-go (tested using unversioned and 41) - bare-expo
[expo-modules][android] propose module-level app or activity customization support (#13457)# Why Some modules require additional setup into MainApplication or MainActivity, e.g. expo-splash-scre
[expo-modules][android] propose module-level app or activity customization support (#13457)# Why Some modules require additional setup into MainApplication or MainActivity, e.g. expo-splash-screen or react-native-gesture-handler Traditionally, we used pre-shaped templates or regular expression in config plugin. This PR propose a way to make MainApplication and MainActivity extensible. # How Introducing `ApplicationLifecycleListener` and `ReactActivityLifecycleListener` for expo-modules, an expo-module package could register these two listeners. For POC, expo-splash-screen in bare-expo is also migrate to the new model. ### Performance impact Leveraging the auto-linking mechanism, a notable change is that we need expo-modules package list before react-native bootstrap. In theory, the change may take longer time to show splash screen. My measurement from `MainApplication.onCreate` to `SplashScreenViewController.show` Before: 74.2ms After 80.0ms There is no meaningful impact to launch time. # Test Plan bare-expo android app will show splashscreen even removed the `SplashScreen.show` in MainActivity.
[android] restore initializeFlipper call in MainApplication (bare) (#13572)
[ios][android] disable flipper in bare-expo (#13373)
[bare-expo] Add detox testing for android (#12893)# Why Originally, detox testing is not enabled on Android. Though we had `expotools android-native-unit-tests --type instrumented`, unfortunate
[bare-expo] Add detox testing for android (#12893)# Why Originally, detox testing is not enabled on Android. Though we had `expotools android-native-unit-tests --type instrumented`, unfortunately, the test cases right now only test on modules themselves but not bare-expo. With this PR, we could be more confident from bare-expo or test-suites regressions. # How Fix debox build on Andriod. # Test Plan Make these works `yarn android:detox:test:debug` `yarn android:detox:test:release`
[ios][android] New autolinking implementation in TypeScript (#11593)
[expo-dev-launcher] Add installation guide (#11223)# Why Add installation guide to the `dev-launcher`'s `README.md`. # Test Plan - https://github.com/lukmccall/with-dev-launcher ✅
[bare-expo] Update main component name in Android, conforming to #11430 (#11484)
added project defined symlinks (#11456)* added project defined symlinks * sync image and random * Update CHANGELOG.md * revert pods * revert * Update symlink-necessary-packages.js
regenerate parts of bare-expo using expo eject and Expo config (#11429)* added icons to bare-expo app.json * expo eject * delete old icons * Update app.json * expo eject --no-install -p
regenerate parts of bare-expo using expo eject and Expo config (#11429)* added icons to bare-expo app.json * expo eject * delete old icons * Update app.json * expo eject --no-install -p android * update FBID * Update strings.xml * Update Info.plist * updated app.json to match ejected Info.plist * disable splash on android since it doesn't work * normalize manifest without eject sync * eject manifest sync * fix android splash screen * simplify gitignore
Add expo-camera to bare-expo (#11428)* Add expo-camera to bare-expo * fix icons * Update settings.gradle
123