Expo SDK 50 was released

Expo SDK 50 was released

Expo is a framework and platform for universal React applications. It’s a set of tools and services built on React Native and native platforms that help you quickly develop, build, deploy, and iterate iOS, Android, and web apps using the same JavaScript/TypeScript code base.

Expo SDK 50 was released on January 18, 2024. SDK 50 includes React Native 0.73.

Expo Dev Tools plugins

This API provides a framework for library authors to create browser-based plugins to debug and interact with aspects of their library/application. To test and demonstrate the API, several plugins have been created for popular tools: Apollo Client, TanStack Query, TinyBase, React Native Async Storage, and React Navigation – and you can find them in the expo/dev-plugins repository. Learn more.

New and improved SQLite and Camera APIs.

  • The expo-sqlite/next library has been completely reworked to update its API and match the mature counterparts used in web and Node.js. In the updated API, implemented as synchronousso and so asynchronous methods, added support for prepared statements, update callbacks, and the Blob data type, as well as other features. The version of SQLite is now updated to 3.42.0 on both platforms, regardless of the versions shipped with the operating system, allowing the use of SQLite extensions such as CR-SQLite. A Knex dialect of expo-sqlite has also been created for those who prefer to use query builders. SQLite is becoming an increasingly important building block, especially in light of growing patterns such as on-premises application architecture. The team will continue to actively invest in the development of this library. More information about the new SQLite API can be found here.

  • expo-camera/next: Accessing a device’s camera is a fundamental capability of many mobile apps, and Expo developers believe it should be both simple and reliable. So they took one of our oldest and most popular libraries and updated it with native platform best practices. For most use cases it is expected that expo-camera/next will fit perfectly. For more complex usage scenarios (for example frame processing) react-native-vision-camera is an excellent option. Learn more about the new camera API.

import { CameraView } from 'expo-camera/next';

// Minimal example of using the new API, refer to types for more information on props
export default function Camera() {
  return (
    <CameraView
      style={{ flex: 1 }}
    />
  );
}

Presented by @expo/fingerprint

This is the answer to a common question from React Native developers: “How do I know if an app’s JavaScript package is supported with a specific app build?“.

The @expo/fingerprint (CLI) or API generates a fingerprint that represents the unique characteristics of a project, and if that fingerprint changes, then you know that a JavaScript application targeting the old fingerprint might be incompatible.

Try this via the CLI: npx @expo/fingerprint путь/к/вашему/проекту, and learn more in the README as well as the expo-github-actions README. First class integration with EAS will be available in the future!

After you create a footprint, try modifying your project so that it affects your own runtime, and use the CLI to compare it and see what changed. Learn more.

Expo Router v3

This is the next major release for universal file-based routing and enhanced support for web applications. Expo Router v3 includes many bug fixes and stability improvements, improved documentation, added web support, testing, and types. Of particular note is that Expo Router v3 has experimental support for creating universal server endpoints using the Routes API. A detailed blog post dedicated to this release is published here.

EAS Build

Improvements are being made to EAS Build continuously. Here are some key highlights from the last SDK release:

  • Now Xcode 15.2 is the standard version for macOS workers. Learn more.

  • JDK 17 and Ubuntu 20 are now the default versions for Linux workers. Learn more.

  • Now Node 18 is the standard version. The default Node version in EAS Build corresponds to the current long-term support version, and on November 27, 2023, the default version changed from Node 16 to 18. Learn more.

  • Improved warnings and errors. “Build notes” can give you the feeling that an experienced engineer is watching your work to help you understand why and what to do about specific warnings and errors in your build. Learn more.

  • Pre-warmed cache CocoaPods to speed up assembly. All your iOS builds will be slightly faster without any changes on your part. Learn more.

  • released Expo Orbit v1: Orbit for macOS makes installing and running builds with EAS faster and easier. Learn more.

  • …added support for Bun, EAS CLI will now read files .nvmrc to set the Node version for your builds (unless explicitly specified in your build profile), eas build:run now accepts the flag --profile to filter builds, added command eas build:delete on request to support certain automated workflows, and continues to improve the fully customizable collection preview that GA should make in the coming months.

EAS Update

  • A new, easy-to-use JavaScript API: u package expo-updates a new hook is now included useUpdates() (meaning during launch week in August) that will make it easier to track status and interact with the update API. This API provides convenient access to everything you need to know about the status of updates in your project. For more information about the return type, the useUpdates() documentation, and the expo/UpdatesAPIDemo repository, see the relevant resources.

import { useUpdates } from 'expo-updates';

export default function App() {
  const {
    currentlyRunning,
    availableUpdate,
    isUpdateAvailable,
    isUpdatePending,
    // and so on!
  } = useUpdates();

  // etc..
}
  • New control panel user interface features: Updates have recently been released to the control panel that allow the user to: create new channels, delete them, repost updates and delete them. Learn more here.

  • roll back: It’s now possible to tell production apps to roll back to an inline update (JavaScript created at build time) the next time they check for updates. This is useful in cases where you’ve accidentally deployed a regression as the first update of a new build and want to revert to the built-in working state rather than trying to deploy an update fix on top of that. Learn more here.

  • Gradual updates: It is now possible to gradually roll out updates to a certain percentage of your users to minimize the impact of accidentally introducing a bug into your production environment. Learn more here.

Support for basic Expo modules for tvOS and macOS

You can now use the Expo module API to create your own modules for tvOS and macOS.

Other innovations

  • React Native version 0.73 and React 18.2.0 (unchanged from SDK 49) is a significant upgrade. This release includes many improvements, details of which can be found in the React Native CHANGELOG, Release Notes, and React CHANGELOG files.

  • Configuration plugin expo-font now supports adding fonts natively to your application. This can be useful for loading fonts at runtime using Font.loadAsync or useFonts, to avoid recompiling the application binary. However, fonts in an application usually rarely change, so implementing a font in a native project using a configuration plugin can help you tidy up some of the async loading code when you run your application before building. Learn more.

  • Module expo-secure-store received several new improvements. Synchronous functions were introduced at the request of users getItem and setItem! Learn more about the changes in the changelog.

  • Module expo-dev-client now loads the newly opened project by default when starting a development build. If the development server is unavailable, it returns to the launch screen. Learn more.

  • Added command npx expo run. The Expo CLI will now prompt you to select a target platform if it is not specified in the command. This is a small improvement that is consistent with the user interface npx expo run с eas build:run. You can also use npx expo run android or npx expo run ios as an alternative run:android and run:ios.

- npx expo run
? Select the platform to run › - Use arrow-keys. Return to submit.
❯   Android
    iOS
  • Team “npx expo install --fixNow updates the Expo package to the latest version. Developers regularly update the Expo SDK using this command, but the expo package is not automatically updated. After upgrading to SDK 50, the –fix flag will update all Expo SDK packages, including expo.

  • An upgrade tool is now available for native projects. If you use CNG, this does not apply to you. To make it easier to update native projects using Expo Modules, an analogue of the React Native CLI tool has been created. It is now available in the documentation called “Native project upgrade helper”.

  • Web package distribution using Metro is now enabled by default.

  • Improved error reporting and code removal. Expo CLI now provides full stack traces for component-based errors, optimizes unused code for a specific platform, and transforms faster when packaging for Hermes. Exporting static websites is now more than 2x faster!

  • Built-in URL and URLSearchParams standards. A polyfill is now not required to use many libraries on npm that assume a URL API (as previously with the react-native-url-polyfill library).

  • Improved support for isolated modules. Now you can use pnpm or npm --install-mode=isolated for collecting local development.

  • An experimental React Native JS UI is available in the previous version. Working together with Meta has unified the debugging experience in React Native, and the infrastructure supporting this new user interface is also the basis of the JS debugger built into the Expo CLI.

Noticeable critical changes

  • Update to Android SDK 34, AGP 8 and Java 17. JDK 17 installation is required to build the project locally.

  • The minimum supported Android version has been increased to 6 (API 23) and the minimum iOS version for deployment has been increased to 13.4.

  • Expo CLI and React Native Now require Node 18+.

  • IN Expo SDK 50 support for classic updates is discontinued, it is recommended to use EAS Update.

  • @expo/vector-icons updated to [email protected]added FontAwesome6 support and changed some icon names.

  • Most JavaScript APIs expo-updates are now unavailable in Expo Go and dev builds with expo-dev-client.

  • React Native 0.73 moved from Java on Kotlin for Android Main* classes

  • ProgressBarAndroid and ProgressViewIOS removed in 0.73.

  • If using the Expo Router v3 beta, please refer to the Breaking Changes section.

🧹 Expo Go: Removed SDK 47 and 48.

New, low-usage versions of the SDK are released regularly to reduce the number of versions supported by Expo Go. This means that projects on SDK 47 and 48 will no longer work in the latest version of Expo Go, but will function fine in other cases. Older versions of Expo Go can be installed for Android/emulators or iOS simulators. Learn more.

➡️ Updating your app

Here’s how to upgrade your app to Expo SDK 50 from version 49:

npm i -g eas-cli
npm install expo@^50.0.0
npx expo install --fix
  • If in your package.json there are any permissions/overrides, make sure they are still required. For example, you should remove the Metro and Metro-Resolver overrides if you added them for expo-router in a previous SDK version.

  • Check for possible known issues:

npx expo-doctor@latest

Read more on the Expo blog.

Related posts