Expo SDK v19.0.0 is now available

Brent Vatne
Exposition
Published in
6 min readJul 21, 2017

--

I am pleased to announce the release of Expo SDK v19.0.0. It is based off the recently released React Native 0.46, “June”. Our previous SDK, v18.0.0, is based off 0.45, “May”.

JavaScriptCore on Android gets a big update

Edit - July 24, 2017: This change has been temporarily been reverted because some bugs uncovered when running on Android 4.4. We will put it back in once the issue has been resolved.

The version of JavaScriptCore (JSC) built into upstream React Native is currently (r174650) three years old and missing many features that are available on iOS already, such as native async/await support, ES6 Symbols, and native TypedArray (which works efficiently with Expo Graphics). In collaboration with Software Mansion, a trusted consultancy based out of the lovely city of Kraków, we now ship JSC r216113 which comes with many of the new features that were already supported on iOS10+, including some performance improvements. For example, the cold start time for a large app (3M bundle) on a Samsung Galaxy S4 has been reduced by 15% with this update.

Learn more about the project on the jsc-android-buildscripts repository and in the Using Modern JavaScript guide in the Expo documentation. You don’t have to change anything in your app to use it, or even update to SDK19! You only need to download the new version or the Expo client. Or in the case of standalone apps, you will need to re-build your apk and re-submit to the Play Store.

Meet native.directory, a catalog of React Native libraries

It’s very easy to publish a package with npm, it’s much harder to maintain it and polish it. Consequently, there are thousands of React Native libraries out there but only a small subset of those are actually going to be high quality and well-maintained. Our hope with native.directory is to synthesize any data that we can for you into a “health” score that lets you quickly guess at the quality of the library, while also making it easy for you to test the library in Expo/Snack (if possible) and showing you preview images of it in action. Additionally, a common question that Expo users have is: “will this work with Expo?” — native.directory makes this easy to answer.

We were surprised by the popularity so far — our post to ProductHunt reached #4 for the day! Not bad for something as niche as this. Give it a try and join in to help us add more libraries and refine the health calculation! The project lives at react-community/native-directory, we’re really looking forward to hearing your feedback.

Double tap the “r” key to reload in the Android emulator

This works in React Native upstream but we didn’t support it in Expo until SDK19. Hopefully this makes the incredibly painful experience of using an Android emulator slightly more tolerable! A friendly reminder: you should probably use your device most of the time.

Access QR scanner from in-app menu on iOS

When you shake your device to open the developer menu when you have a project open, it now includes an option to let you jump to the QR scanner screen.

Set up Universal Links for expo.io

Navigating to https://expo.io/@community/native-component-list will open the app directly into Expo if it is installed now.

Developer tools

  • Enabled --non-interactive for exp login. This is useful for CI.
  • No more user-facing error stacktraces: an error stack trace will only show if EXPO_DEBUG is in your env.
  • QR code is now hidden for detached apps.
  • Re-enabled --clear-credentials for exp build:android. We disabled it previously to prevent users from accidentally clobbering their keystore. You can now easily download your keystore (as of last release) with exp fetch:android:keystore.
  • Improvements to exp start --offline: faster startup and it no longer signs you out.
  • Removed dependency on DTrace: which speeds up exp install by cutting out a native build step, and also sidesteps a bunch of issues that some Windows users encountered when installing DTrace.
  • XDE share input now autofocuses, thanks veswill3!

Documentation additions

Deprecations and removals

  • Expo.Components was deprecated in SDK 15 and has now been removed. All components now live on the Expo object directly. If you did not yet update your code to accommodate for the change, you will need to do it when you update.
  • Expo.Notifications.getExponentPushTokenAsync() is now Expo.Notifications.getExpoPushTokenAsync() (about time, I say). Both will continue to work until SDK 21.

New APIs

Speech

Text to speech is a lot more fun than I thought it would be, the iOS and Android APIs for this are fantastic.

Play with it here on Snack.
Related feature request.
Read the documentation.

Geocoding

Both iOS and Android expose system APIs for geocoding (address to coordinates) and reverse geocoding (coordinates to address).

Play with it here on Snack.
Related feature request.
Read the documentation.

FileSystem

The FileSystem API that lets you read, write, delete, move, copy files in a scoped file system (so you can’t access files for other projects opened with the Expo client). You can also make and navigate directories, download files from a remote URI and read file metadata. The API provides access to images saved by ImagePicker, recordings made by the Audio recording API, and databases created by the SQLite API. You can also use any of the files in the FileSystem API as audio, video, image, GL texture sources or SQLite databases.

Read the documentation.

Asset.loadAsync

In order to simplify preloading and caching assets, we introduced Asset.loadAsync, which is a wrapper around Asset.fromModule(module).downloadAsync() and accepts a single module or an array of modules. For example: Asset.loadAsync([require(‘./icon.png’), require(‘./logo.png’)]);

Read the documentation.

Universal Linking on iOS

You can now add support for universal linking to your standalone app by adding associatedDomains to your app.json. For more information on how to set this up, see the Apple Universal Links documentation. We will be adding a guide to the Expo documentation for this shortly.

Customize permissions required by Android standalone apps

A common request from developers building Android apps with Expo is the ability to customize which permissions are requested at install-time. This only impacts Android versions below 6.0, and on 6.0+ the permissions are asked at run-time. If you are an Android user and concerned about your security then you should update operating system regularly for the latest security patches. But for many people around the world this may be prohibitively expensive, so the next best thing is to be cautious about what permissions are requested by apps that you install on your phone. App developers should respect this and only request the minimal permissions that the app requires.

In Expo SDK 19 you can select the permissions using app.json, see the full documentation.

Bugfixes

It’s hard to document all of the small fixes that go into each release, but here are some of the highlights.

General fixes

  • Contacts API is more uniform on iOS and Android
  • API server and XDE agree about username formatting requirements
  • Documentation search is fixed on mobile
  • Android standalone app names can now contain ‘&’, ‘<’, ‘>’, “‘“, ‘“‘

Audio fixes

- When preparing a Recording, you can pass an optional settings dictionary to customize the format / extension / bitrate / quality / encoding, et cetera. Two high- and low-quality preset settings are provided for convenience. (Related feature request)
- Clarified that durationMillis and playableDurationMillis will be null if the duration of the media cannot be read.
- Fixed large videos on Android to not block the UI thread while loading.
- Now send the appropriate value to _setIOSFullscreen on Video.
- Fix for some android videos that don’t display initially when shouldPlay={false}.
- Clarified in the docs + record sample app that audio mode option allowsRecordingIOS sometimes makes audio come out of the receiver instead of the speaker.

Library Updates

Upgrading your app

Here’s how to upgrade your app to Expo SDK 19.0.0 from 18.0.0:

  • Close XDE or your exp CLI server
  • In app.json (formerly exp.json), change sdkVersion to "19.0.0"
  • In package.json, change these dependencies:
    - react-native to "https://github.com/expo/react-native/archive/sdk-19.0.0.tar.gz"
    - expo to "^19.0.0"
    - react did not change from SDK 18 ("16.0.0-alpha.12")
    - jest-expo to "~19.0.0" (if you use it)
    - sentry-expo to "~1.6.0" (if you use it)
  • Delete your project’s node_modules directory and run npm installagain (or use yarn, we love yarn)
  • Reopen your project in XDE and press “Restart” to clear the packager cache, or run exp start -c if you use use exp.
  • Update the Expo app on your phones from the App Store / Play Store. XDE and exp will automatically update your apps in simulators.

--

--