2019年7月30日火曜日

Expo v34でAndroid 64bitサポートとかiOS13向けとかBare workflowでもExpo Client使えるよ的なお話

  • このエントリーをはてなブックマークに追加

Expoがv34にアップデートした。
今回は前回から2ヶ月以内とかなり早めなアップデート。
特にAndroidの64ビットサポートがやっぱメインとなる内容だよね的な。

Expo SDK 34 is now available

ということで今日は変更点的なお話をば。

■Androidの64ビットサポート

SDK 34 includes support for 64-bit-enabled Android builds that also make use of Android App Bundles (AABs). 64-bit support will be required for new updates to apps on the Google Play Store starting August 1st.

We introduced 64-bit support for SDK 33 projects a couple of weeks ago, and support will continue for SDK 33 projects. This means that starting August 1st, in order to submit new app updates to Google Play, your project will need to be built with SDK 33 or 34.

AABs, while not required by Google Play, can make your final user-facing app size significantly smaller. With AABs, Google will serve multiple different APKs optimized for individual devices, meaning each user will download only the code and resources they need. To create an AAB, run expo build:android -t app-bundle on an SDK 33 or 34 project. (No additional flags are needed for 64-bit support.)

もちろんSDK33でも64ビットサポートしてるけど、SDK34でも64ビットサポートしてるしさらにAndroid App Bundles (AABs)もサポートするよ的なみたいな。
AABsは必須じゃないんだけど、AABを使うとデバイス毎に最適なAPKを作るから、最終的にアプリのサイズを大幅に小さくすることができる的な。
expo build:android -t app-bundleって感じでビルドすればAABs対応する的な。


■iOS 13 compatibility

SDK 34 also includes support for iOS 13. Apps made with React Native 0.59.8 or below crash when launched on the current public beta of iOS 13. This includes apps made with any previous Expo SDK release.

We’ve patched this crash in SDK 34 so your app will be ready for the iOS 13 release. We’ve also backported the patch to our SDK 31, 32 and 33 Turtle builders, so if you’re still on one of these SDK versions, you can run expo build:ios now to get the fix.

If you have a production app, we highly recommend that you release a new build with this fix as soon as possible, even if you don’t immediately upgrade to SDK 34. This will future-proof your app from possible issues when iOS 13 releases to the public in September.

We will continue to actively monitor iOS 13 compatibility in Expo apps and address any issues as they arise.

iOS13のベータ版において、React Native v0.59.8とかそれ以下のアプリを走らせようとするとクラッシュしちゃうんだけど、SDK34ではパッチを当ててiOS13でも使えるようにしたよ的な。
ちなみに後ろで走らせてるTurtle CLI上にもパッチを走らせたから、SDK 31でも32でも33でも大丈夫だよみたいな。
iOS13が9月に一般公開されることだし早めにSDK34にしてビルドしちゃおう的な。


■Required modular imports

In SDK 33, we deprecated imports from the monolith expo package in favor of installing and importing from individual module packages like expo-file-system. With SDK 34, we’ve fully removed the ability to import most modules from the expo package. This means that if you try to import { FileSystem } from 'expo';, you’ll now see an error instead of a warning.

To remedy this, you should use the expo install command to install modules; this command is a wrapper around npm install/yarn add that automatically installs a module version compatible with your SDK version. For example, for the FileSystem module, you should run expo install expo-file-system and use import * as FileSystem from 'expo-file-system';.

This change paves the way for tree-shaking and smaller JavaScript bundles. It also makes moving between Expo’s managed and bare workflows simpler. To make the transition smoother, we’re providing expo-codemod, a command line utility that will parse your JS and automatically update any affected imports. Instructions are on the linked README page.

If you still see an error screen after fixing all of the imports in your application code, one or more of your dependencies may still use the old import style. In that case, you’ll need to upgrade those dependencies to versions that support the new import style. If none are available, unfortunately you’ll need to wait to upgrade. (If this is a package we manage, please let us know, or send a PR!)

SDK34ではimport { FileSystem } from 'expo'みたいにインポートするのを完全に禁止したよ。
SDK33ではwarningだったけどerrorを出るようにしました的な。
だからexpo install expo-*みたいにやって必要なモジュールをインポートして使いましょう的な。
ちなみに全部そうしてるのに関わらずエラーが出てしまうときは使っているパッケージとか依存しているパッケージが対応していないから的な感じなので、対応してくれるのを待つかどうかするしかないよねみたいな。
もちろんExpo製のパッケージだったらPR送ってね的なみたいな。


■Snack is tri-platform

In the previous SDK release, we announced the first beta release of Expo web, adding a third platform that all Expo projects can target. Now we’ve added web support to Snack, too!

This means you can get the ease and simplicity of starting a project on Snack, and instantly be able to see how it looks on all three platforms, in real time, in the same browser window. Check it out now! (If you don’t see the Web button right away, make sure to pick SDK 33 or 34 in the lower right hand corner.)

SDK33でも案内してたけど、snackでwebも指定できるようになってる的な。


■Improvements to Expo Web

While Expo’s web support is still in beta, we’ve made a number of improvements for this release. We’ve added experimental web support for react-native-gesture-handler, a universal jest config that works with all three platforms, and increased babel stability and testing to reduce future breakages.
Regarding navigation, while react-navigation works great for many apps on iOS and Android, for web projects we currently recommend that people look at other libraries like react-router that are better suited for web routing and navigation.
Please continue to try out Expo Web and let us know as you run into any issues! We’re continuing to improve the stability of web support, and we hope to bring it out of beta in an upcoming SDK release.

Expo web対応はまだベータ版なんだけど、いっぱい改善したよ的な。
react-native-gesture-handlerとかjestの設定とかbabelとか諸々ちゃんと動くようにしたよ的な。
ちなみにwebでのナビゲーションはreact-navigationよりかはreact-routerみたいなのを使ってみた方がいいんじゃないかな的な。
今後ベータ版じゃなくてちゃんとしたバージョンでアップできるようにするよ的な。


■A note on proprietary analytics modules

Back in April, we removed the Branch module from the managed workflow for Android. This was in response to a number of cases where Google removed apps from the Play Store without warning, due to including Branch native code without a sufficient Privacy Policy. While we don’t generally remove modules in production like this, we felt it was justified in this case because of the scope and seriousness of the actions by Google Play.

Recently, we’ve received a number of questions regarding support for the Branch module, and we want to reaffirm that nothing is changing in the foreseeable future. Like other modules that connect to proprietary third-party services, the Branch module is best supported in the bare workflow, and we do not anticipate adding it back to the managed workflow. Aside from being costly for us to maintain, these modules can have side effects like increasing your app size and causing issues like App Review.

While we support a few other widely used analytics modules in the managed workflow, each has been the result of a carefully considered decision. Generally, we aim to provide non-proprietary primitives in Expo, upon which companies like Branch can build Expo modules. If you’d like to read more about the reasoning behind this decision, check out this post.

4月にAndroidのExpo SDK上からBranchを削除していたんだけど、これはGoogleがPlay Storeから予告なしにアプリを削除したのが原因だったんだけど、というのも十分なプライバシーポリシーがないBranchのネイティブコードが含まれていたからだったりするよ的な。
Bare Workflowではよくつかわれてたりするんだけど、アプリのレビュー問題だったりアプリのサイズが大きくなったりとかもあるからExpo SDK上に再度追加するということは考えてないよみたいな。
詳しいことを知りたい場合はこちらの記事をチェックしてね。


■Using the Expo client and web in the bare workflow

The updated bare workflow template project has built-in support for running your project inside of the Expo client and for Expo for web.

The “Using Expo client in Bare Workflow” guide gives more information on the motivation behind supporting the Expo client in this context, the limitations, and tips to make your bare workflow apps work well in the Expo client (such as the new .expo.[js/json/ts/tsx] extension).

The “Using Expo for web in Bare Workflow” provides brief instructions for how to get started from initializing a new project. If you have an existing bare workflow project that you’d like to use Expo for web with, we recommend initializing a new project and then copying any different configuration over to your project.

If you’re not yet clear on what the bare workflow is, have a look at the Bare Workflow Walkthrough and compare it with Managed Workflow Walkthrough!

Bare workflowのテンプレートでExpoクライアントサポートを追加したよ。
Using Expo client in Bare Workflowを見てくれ的な。
もちろんネイティブのコードが入っているものは走らせることができないんだけど、その部分のファイルだけ.expo.[js/json/ts/tsx]みたいに分けちゃえばそっちが処理されるから大丈夫的な。


■Using the Expo client and web in the bare workflow

The updated bare workflow template project has built-in support for running your project inside of the Expo client and for Expo for web.

The “Using Expo client in Bare Workflow” guide gives more information on the motivation behind supporting the Expo client in this context, the limitations, and tips to make your bare workflow apps work well in the Expo client (such as the new .expo.[js/json/ts/tsx] extension).

The “Using Expo for web in Bare Workflow” provides brief instructions for how to get started from initializing a new project. If you have an existing bare workflow project that you’d like to use Expo for web with, we recommend initializing a new project and then copying any different configuration over to your project.

If you’re not yet clear on what the bare workflow is, have a look at the Bare Workflow Walkthrough and compare it with Managed Workflow Walkthrough!

Bare workflowのテンプレートでExpoクライアントサポートを追加したよ。
Using Expo client in Bare Workflowを見てくれ的な。
もちろんネイティブのコードが入っているものは走らせることができないんだけど、その部分のファイルだけ.expo.[js/json/ts/tsx]みたいに分けちゃえばそっちが処理されるから大丈夫的な。


■先を見据えて

・Xcode 11 and iOS 13 targeting

We aim to release our next SDK version, with full iOS 13 and Xcode 11 support, around the time of the public iOS 13 launch in September. This will allow us to iron out any other kinks in supporting these new versions and give developers enough time to upgrade and stay up-to-date with the latest iOS.

9月に出るiOS13とかiOS13とかXcode11サポートを次のSDKではフルでやるよ的な。


・Hermes

We know the React Native community is very excited about Hermes, Facebook’s newly open-sourced JavaScript engine, and we share your excitement! We’re starting the process of working towards supporting Hermes in the Expo client now, and we hope to provide full Hermes support in an upcoming SDK version.

今話題のHermesも次のSDKバージョンでサポートしていきたいと思っているよ的な。


・ExpoKitを非推奨にしたい

We’re continuing to invest in building tooling and documentation around the bare workflow. We believe that this workflow is strictly better than ExpoKit and has lots of advantages for developers, such as full compatibility with libraries in the React Native ecosystem, easier upgrades, and more modular native code that doesn’t include all of the libraries in the Expo monolith. The bare workflow is the easiest and quickest way to achieve optional modules — that is, including native code for only the Expo modules you actually use.

That said, there are still a few modules and capabilities — notably, OTA updates and push notifications — that are still not supported in the bare workflow and require ExpoKit. We’re actively working towards solutions for both of these and hope to have them ready for an upcoming SDK version, allowing us to fully deprecate ExpoKit in favor of a superior workflow.

通知とかOTAアップデートとかそういったものはまだreact-native-unimodulesには対応していないからExpoKitを使わざるをえないけど、そのうち対応していくから的な。


・Dropping older SDK versions

今回はSDKの切り捨て行っていないけど、SDK35がリリースされたら、SDK31と32のサポートを終了する的な。


■APIの改善

ImagePicker: added support for video recording in launchCameraAsync. (Related PR.)
LocalAuthentication: added fallbackLabel option to iOS to allow customization of the system’s passcode fallback dialog. (Related PR. Thanks changLiuUNSW!)
SplashScreen: added native mode on Android to fix various issues with splash screen images. (Related PR.)

BarCodeScanner: fixed issue where UI thread was blocked when defining custom barCodeTypes on iOS.
FaceDetector: moved to MLKit library for face detection in order to fix compatibility with react-native-firebase. (Related PR.)
ImagePicker: fixed issue on Android where picking an image larger than 2000px would automatically resize it. (Related PR.)
SQLite: fixed BOOL interpretation on 32-bit iOS devices. (Related PR.)

色々と改善したりバグフィックスしたり。


ってな感じ。
AndroidのAABs対応でさらにファイルサイズ下げれたりとか、完全にexpo-*としてパッケージをインポートしようとか的な話。
expo-*を行うときにエラーだから使っているライブラリ的に下手したら使えないとかあるからそうした場合にどうするか?っていうのが悩みどころになるんじゃないのかなぁと。

個人的にはreact-native-unimodulesがExpoクライアント上で走るようになったことがとても嬉しい。
bare-minimumでexpo startってやると実際に動いたから感動。
ネイティブコードを走らせてるコンポーネントだけ別で差し替えることで走るわけだからViewの確認とかがシミュレータ使わずでめっちゃ簡単になるっていう。
早くreact-native-unimodulesがプッシュ通知とかOTA対応してくれればなぁと思ったり的なみたいな。

0 件のコメント:

コメントを投稿

Adsense