Expo in 100 Seconds

Fireship
22 Feb 202402:39

Summary

TLDRExpoは、Reactを使ってiOS、Android、Web向けにネイティブアプリを開発できるオープンソースのツールセットです。複数のプラットフォームをターゲットにする開発を簡単に実現し、モバイル固有の機能にもアクセスできます。コード変更を素早く反映できるほか、連続的ネイティブ生成によりネイティブコードの管理が不要になります。

Takeaways

  • 😀 Expo is an open source toolset for building cross-platform native apps with React
  • 👉 It generates project templates so you can avoid configuration and start coding quickly
  • 📱 Apps can run on iOS, Android and web with a single codebase using Expo's CLI
  • 🔀 Apps hot reload to reflect UI changes for rapid development
  • 📂 File system based routing enables automatic deep linking on mobile
  • 🛣️ The Expo router handles navigation stacks and layouts for native platforms
  • 📷 Access native APIs like camera, maps, sensors easily with Expo packages
  • ☁️ Integrate with backend services like Firebase without native code
  • 🤖 Continuous native code generation averts Android & iOS build issues
  • 🎉 Automated testing deployment and app store submissions

Q & A

  • Expoとは何ですか?

    -Expoは、iOS、Android、およびWeb上で単一のReactコードベースを用いてユニバーサルネイティブアプリを構築するためのオープンソースツールセットです。

  • React Nativeの特徴は何ですか?

    -React Nativeは、JavaScriptの橋を用いてReactコンポーネントがネイティブUIコンポーネントを表現できるようにすることで、SwiftやKotlinの学習なしにモバイルアプリを構築できるようにします。

  • Expoを使用する主な利点は何ですか?

    -Expoは面倒な設定を処理し、開発者がすぐにコードの記述を開始できるようにするプロジェクトテンプレートを生成します。また、iOS、Android、Webでアプリを瞬時に実行でき、ホットリロードやサンドボックスでのテストが可能です。

  • Expoのapp Directディレクトリの用途は何ですか?

    -app Directディレクトリはファイルシステムに基づいたルーティングを使用し、自動的にディープリンク可能な画面を作成し、UI内で画面間のナビゲーションを可能にします。

  • Expoでのルーティングの管理方法は?

    -Expoでは、リンクコンポーネントに属性を使用するか、ルーターモジュールを直接使用して命令的にナビゲートすることで、ルーティングの挙動を簡単に制御できます。

  • Expoで提供されるライブラリの種類は?

    -Expoはカメラ、マップ、センサーなどのネイティブAPIと連携するための多数のライブラリを提供し、FirebaseやSupabaseなどのバックエンドクラウドインフラとの統合もサポートします。

  • Expoのcontinuous native generation技術とは何ですか?

    -Continuous native generationは、一連の入力から予測可能にネイティブコードを生成するExpoの技術で、JavaやObjective-Cコードの直接的な変更を避けることができます。

  • Expoを使ってアプリをエンドユーザーに配布するプロセスは?

    -Web上では、ページを静的にレンダリングして任意のウェブホストにアップロードできます。モバイルでは、Expoがクラウドでのビルドを自動化し、Google PlayやApple App Storeに提出するプロセスを自動化します。

  • Expoでの自動テストの利点は?

    -ExpoはDetoxとの統合を提供し、ネイティブデバイスやエミュレータ上での自動テストを容易に行えるようにします。

  • Expoを使うことで、どのような開発者になれますか?

    -Expoを使用することで、iOS、Android、Web上でアプリを構築できるクロスプラットフォーム開発者になることができます。

Outlines

00:00

🚀 ExpoとReact Nativeの紹介

このパラグラフでは、ExpoとReact Nativeがどのようにしてウェブ開発者がiOSとAndroidの両方でネイティブアプリを構築するのを容易にしているかを説明しています。開発者は、通常、AppleのためにSwift、AndroidのためにKotlinを学ぶ必要がありますが、React NativeはJavaScriptを使用してこのプロセスを簡素化します。Expoは、面倒な設定を自動で処理し、npmを使用してアプリを瞬時にiOS、Android、Webで実行できるようにするツールセットです。コードが変更されると、アプリはホットリロードを行い、UIの変更を即座に反映します。Expo Goなどのツールを使用してサンドボックス内でアプリをテストすることも可能です。さらに、Expoはファイルシステムベースのルーティングを使用し、React Frameworksのようにスクリーンを自動的にディープリンク可能にします。Expoのルーターは、複数のページ間でUIを共有するレイアウトを使用することもでき、より高度なルーティングパターンを実現します。Expoは、カメラやマップ、センサーなどのネイティブAPIと連携するための豊富なライブラリを提供し、FirebaseやSupabaseなどのツールとの統合をサポートします。プロジェクトにはAndroidやiOSのディレクトリが含まれていませんが、これはExpoが「連続的なネイティブ生成」という技術を使用しているためで、これによりネイティブコードが一連の入力から予測可能に生成されます。最後に、ExpoはDetoxとの統合を通じてネイティブデバイスとエミュレータ上での自動テストを可能にし、クラウド内でビルドを自動化し、Google PlayやApple App Storeにアプリを提出するプロセスを容易にします。これにより、ウェブ上ではページを静的にレンダリングして任意のウェブホストにアップロードすることができ、モバイルではクロスプラットフォーム開発者になる道が開かれます。

Mindmap

Keywords

The video is abnormal, and we are working hard to fix it.
Please replace the link and try again.

Highlights

Expo is an open source toolset for building cross-platform React Native apps

Write code in JavaScript instead of platform-specific languages like Swift or Kotlin

React components represent true native UI components, not just web views

Expo handles configuration so you can start writing code quickly

Easily test apps on iOS, Android, and web with Expo CLI

Apps support hot reloading and testing in sandboxes

File system based routing for screens with deep linking

Navigation uses stack to push/pop screens

Layouts allow sharing UI across pages

Access native APIs like camera, maps, sensors easily

Continuous native code generation from JS

Automated testing on emulators/devices with Detox

Static site rendering for web

Automated build & distribution

No Mac required to build iOS apps

Transcripts

play00:00

Expo an open source tool set for

play00:02

building Universal native apps on iOS

play00:04

Android and the web with a single react

play00:06

code base normally developers need to

play00:08

write Swift code for apple or cotlin for

play00:10

Android to build a mobile app and that

play00:12

sucks if you're a web developer because

play00:14

now you need to learn two new languages

play00:16

luckily react native fixes this by using

play00:18

a JavaScript bridge that allows react

play00:20

components to represent native UI

play00:22

components if the code looks like HTML

play00:24

and CSS but you're actually building

play00:25

truly native widgets the real deal not

play00:28

just a web view that's embedded in a

play00:29

native app and can interact with Native

play00:31

apis like the camera keyboard and

play00:33

vibrator pretty cool but here's where

play00:35

expo comes in first run this command to

play00:37

generate a project template it takes

play00:39

care of all the annoying configuration

play00:40

so you can start writing code right away

play00:42

inside this project we can use npm to

play00:44

instantly run this app on iOS Android

play00:47

and the web by simply running an npm

play00:49

command and if we go into the code and

play00:51

make some changes to the UI the app will

play00:52

hot reload to reflect the changes or you

play00:54

can test the app in a sandbox with tools

play00:56

like Expo go what's unique about this

play00:58

code though is this app Direct directory

play01:00

which uses file system based routing

play01:02

very similar to react Frameworks like

play01:04

nextjs and remix this allows you to

play01:06

create screens that are automatically

play01:07

deep linkable on mobile and you can

play01:09

navigate between them in the UI with the

play01:11

link component but on mobile platforms

play01:13

we navigate by pushing and popping

play01:15

screens to the navigation stack in Expo

play01:17

we can easily control that behavior with

play01:19

attributes like push and replace on the

play01:21

link or use the router module directly

play01:23

to navigate imperatively in addition the

play01:25

Expo router can also use layouts to

play01:27

share UI across multiple pages and also

play01:29

represent more advanced routing patterns

play01:31

like tabs and moduls Beyond routing

play01:33

though Expo provides tons of libraries

play01:35

for working with Native apis need a

play01:37

camera use Expo to install the camera

play01:39

package and simply use the camera view

play01:41

component in your UI the same goes for

play01:43

maps sensors and virtually every other

play01:45

use case and has Integrations with tools

play01:48

like Firebase and superbase to connect

play01:50

to backend Cloud infrastructure what's

play01:51

weird though is you'll notice our

play01:53

project is missing Android and iOS

play01:55

directories Expo developed a technique

play01:57

called continuous native generation

play01:59

where Native code is generated

play02:00

predictably from a set of inputs and

play02:02

that's awesome because trust me as a

play02:04

JavaScript developer when you start

play02:05

touching Java and Objective C code in

play02:07

these directories things are going to

play02:09

break now finally after you build an

play02:10

awesome app automate testing on Native

play02:12

devices and emulators thanks to its

play02:14

integration with detox now let's get

play02:16

this app to our end users on the web we

play02:18

can statically render our pages and

play02:20

upload them to any web host on Mobile

play02:22

Expo can automate your builds in the

play02:23

cloud then submit them to Google play in

play02:25

the Apple App Store you don't even need

play02:27

a Mac congratulations you're now a cross

play02:29

platform developer this has been Expo in

play02:31

100 seconds let me know what you want to

play02:33

learn about next in the comments thanks

play02:35

for watching and I will see you in the

play02:36

next

play02:37

one