Expo SDK 42

Brent Vatne
Exposition
Published in
7 min readJul 1, 2021

--

Today we’re announcing the release of Expo SDK 42. SDK 42 includes React Native 0.63, the same version as in SDK 41. Thank you to everyone who helped with beta testing. (Curious why we didn’t include React Native 0.64? Learn more.)

⚡️ Highlights

  • Preview release of custom development clients. The expo-dev-client library, in combination with EAS Build, makes it possible to use libraries like react-native-fast-image, react-native-blurhash, react-native-date-picker, and @react-native-voice/voice in your managed Expo projects, even though they are not included in the Expo SDK. You can think of expo-dev-client as a library that installs an “Expo Go”-like interface in debug builds of any React Native app. Yes, expo-dev-client works in any React Native app, not only in Expo managed apps! Read “Introducing: Custom Development Clients” for the full story.
  • First-party Stripe support: We collaborated with the team at Stripe to make the @stripe/stripe-react-native library work seamlessly in Expo projects. With SDK 42, expo-payments-stripe has been deprecated in favor of this new library. Learn more in the API reference, and check out this excellent YouTube video that walks through integrating Stripe in your Expo app, by Varun Nath.
  • Experimental support for Hermes on Android is now available in Expo Go, on apps built with EAS Build, and in expo-updates. Hermes for Android is not available in standalone apps built with expo build. Learn more in the “Using Hermes” guide.
  • Improved managed apps on EAS Build. In SDK 41 we released the first version of support for managed apps on EAS Build, and in SDK 42 we’ve rolled out a bunch of improvements, for example: we now only include Android permissions for libraries that are used in the project (with only a minimal set of default permissions), we added support for specifying splash screen for specific DPIs, we automatically sync capabilities with App Store Connect based on project entitlements, and we ensure default project styles are consistent with expo build (there were a few inconsistencies on Android in SDK 41).
  • The default Xcode version has been updated to 12.5 for EAS Build. If you don’t specify an "image" in your build profile, or you use "image": “default", your app will automatically be built with Xcode 12.5 when you update to SDK 42. Learn more in “Build Server Infrastructure”.
  • New Notifications features: SDK 42 brings support for two highly-requested expo-notifications features: handling push notifications while your app is in the background, and using custom notification sounds in your managed workflow app. Custom sounds are available only for apps built with the new EAS Build system. Learn more in the “Notifications” API reference.
  • To see the full list of new features and fixes, refer to the changelog!

📝 Expo Tools for Visual Studio Code

The “Expo Tools” Visual Studio Code extension began as a tool for autocompletion and validation of your static Expo config app.json. With the introduction of config plugins, the Expo config has become a part of the core foundation of the new build system used by EAS Build; it makes “prebuilding” and configuring custom native modules possible. We’ve built new features into the VSCode extension to make working with Expo config easier than ever.

Mod Previews

Mods modify native project files during the prebuild process (learn more). Previously, the only way to see the resulting native files was to run expo prebuild and find them in the file tree. This was slow and made plugins hard to develop and to work with, so we introduced the mod preview. In VSCode, press ⌘⇧P or ⌃⇧P , type “Expo: preview modifier”, and then select a file to preview. Changes in the config will be reflected live in the preview:

Previewing the Info.plist live

This can also be used to determine what permissions will be added to your AndroidManifest.xml (a highly requested feature):

If permissions are added through a library AndroidManifest.xml, they will not be included in this list; this will only show which permissions are explicitly added through mods.

IntelliSense

We’ve also added IntelliSense for icons, images, and Config Plugins, because computers can and should help you with such things.

🌐 Expo CLI

We’ve made Expo CLI more powerful than ever before, by introducing the new run commands which enable you to build and test your app locally before sending it to EAS Build.

If you use run commands in a managed project, be sure to clean up after the changes it makes to your project before building it.

Config Plugins

Since we introduced Config Plugins in Expo 41, we’ve seen incredible community adoption from some of the most requested packages:

These packages can be installed and used today with custom dev clients (not in the Expo Go app).

Many packages like react-native-fast-image and react-native-blurhash work right out of the box without a config plugin, because they don’t require any configuration beyond installation.

🏗 Deprecations, renamings, and removals

@react-native-community/masked-view is now @react-native-masked-view/masked-view

You don’t have to switch over right away, you can use either package in your project; React Navigation v5 depends on @react-native-community/masked-view and React Navigation v6 has an optional dependency on @react-native-masked-view/masked-view.

expo-permissions has been removed from react-native-unimodules.

The expo-permissions library was deprecated in SDK 41 in favor of module specific permissions requesters, eg: Camera.requestPermissionsAsync().

If you aren’t ready to move off of expo-permissions yet, make sure that you have it installed in your package.json rather than depending on it transitively through react-native-unimodules.

If you already don’t depend on expo-permissions anymore, you will need to ensure that it is not imported in your Android MainApplication. See this diff where it was removed it from the template project, and do the same in your project if needed.

expo-payments-stripe has been deprecated in favor of @stripe/stripe-react-native

As mentioned in the “Highlights” section of this blog post, Expo and Stripe collaborated to make the @stripe/stripe-react-native library work seamlessly in all Expo projects and expo-payments-stripe is no longer needed. If you’re using expo-payments-stripe, please follow this migration guide to start using the new library.

🧹 Dropped SDK 38; will drop SDK 39 next release

We routinely drop SDK versions that have low usage in order to reduce the number of versions we need to support. This release sees the end of life for SDK 38. As usual, your standalone apps built with SDK 38 will continue to work; however, SDK 38 projects will no longer work within the latest version of Expo Go. If you want to re-run expo build, then you’ll need to upgrade from SDK 38, preferably to SDK 42 so you won’t need to update again for a while (and also because each Expo version is better than the last!).

Our next release is planned for September/October 2021 and, at that time, we’ll be dropping support for SDK 39. If your project is running on SDK 39, consider upgrading to a newer version in the coming months.

➡️ Upgrading your app

Managed workflow

Here’s how to upgrade your app to Expo SDK 42 from 41:

  • Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.7.2 or greater is required.
  • Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
  • Run expo upgrade in your project directory.
  • Refer to the “Deprecations, renamings, and removals” section above for breaking changes that are most likely to impact your app.
  • Make sure to check the changelog for all other breaking changes!
  • Update the Expo Go app on your phones from the App Store / Google Play. expo-cli will automatically update your apps in simulators if you delete the existing apps, or you can run expo client:install:ios and expo client:install:android.
  • If you built a standalone app previously, remember that you’ll need to create a new build in order to update the SDK version. Run expo build:ios and/or expo build:android when you are ready to do a new build for submission to stores.

Bare workflow

The Bare workflow lets you operate independently of the Expo SDK cycle, updating RN versions and versions of individual Expo packages however and whenever you want. However, if you do stick roughly to Expo SDK versions, these steps will help you to upgrade to Expo SDK 42 from 41:

  • Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli@4.7.2 or greater is required.
  • Update to the latest version of EAS CLI if you use it: npm i -g eas-cli.
  • Run expo upgrade in your project directory.
  • Refer to the “Deprecations, renamings, and removals” section above for breaking changes that are most likely to impact your app.
  • Make sure to check the changelog for other breaking changes!
  • Rebuild your native projects with npm run ios and npm run android.

Thank you for reading, we hope that you enjoy this new release!

--

--