What are the real differences in creating a project with Expo and without Expo?

Asked

Viewed 5,261 times

6

Recently I saw several items that differentiated a project with or without Expo, but currently the Expo includes many things where before we needed to touch native modules: Sqlite, image manipulation, camera, splash screens etc..

So I’d like to know the following:

  • It is worth today to start a project without Expo?
  • I can generate a file .apk with the Expo? Without being attached to it and/or pay nothing more for it?

2 answers

9

Project with Expo

Expo plays the role of compiler of your app: it replaces the Android SDK and Xcode with its own method, so you don’t need to configure anything. However, the Expo limits us (makes it difficult) in the part of changing settings or insert packages that modify specific Android or Ios files. Therefore, it can help a lot since nowadays gives access to numerous native functions but, on the other hand, may end up limiting the installation of some dependencies that need the app to be 'ejected'.

Project without Expo

It is the project that will be compiled using the SDK of each platform. Allows to customize many aspects of build and is my favorite because I use some dependencies that need access to OS settings when building.


  • I recommend creating a project without the Expo as numerous packages you might want to use in development have problems with it. What’s more, you’ll have full control of the app build and won’t rely on a platform to compile your app.
  • Yes, you can generate a file . apk with Expo.
  • 1

    Thank you for the answer, one last item if possible, I was thinking of starting with the Expo and last case, if I needed changes in native code, eject the app, is a good idea or this ejection can bring me problems?

  • 2

    Yes, you can eject your application at any time during development, just keep in mind that your application’s behavior may change depending on how certain features are made. For example, I had some layout problems when I ejected my application and there are more serious cases where functionality based on what the Expo provides might look like problems when interacting directly with the SDK’s. I do not have enough experience to say that it will cause problems or not, just keep in mind that inconveniences may arise, so it is recommended to use native.

8


Summary

Whether or not it’s worth starting a project with Expo depends a lot. Depending on your app’s needs, will need go only with React Native. Depending on, you may or may not choose Expo.

In 2021, the Expo is working to allow native dependencies are added, then maybe in the future there is no more project that is not possible to do with the Expo, if it also allows you to modify native code, as in a RN project without Expo.

In general, you can use everything from the Expo for free, later performing a expo eject and following their own life. The only point here is that the builds carried out in the Managed workflow if done through a free account, you will have a queue (never seen it take more than 30 minutes in the queue).

There is a summary with table in this answer indicating the limitations of the Managed workflow. The Bare workflow will not have many limitations, as you can see in the table, but it is not worth starting an app in the Expo if you already know you will have to eject to the Bare workflow. I wrote my experience with Expo and React Native at the end of the answer.


What is the Expo?

I would like to explain what the Expo is here, but I would leave the answer even bigger. However, I must summarize to contextualize the rest of the answer:

The Expo (Github) is a open-source framework and a platform for universal React applications. It’s a set of tools and services built around native and native React platforms to help from development to upgrades Over The Air (OTA) and the generation of .apk, .aab and .ipa so that you can place your app in the Play Store and App Store.

The Expo allows the development of iOS, Android and web applications from the same code base Javascript / Typescript.

The two approaches to building applications with Expo tools are called "managed workflows" (Managed workflows) and "simple" (Bare workflows). Below is a brief summary, since it is necessary to understand this to answer the question.

Workmanaged flow

With managed workflow, you just write Javascript / Typescript and Expo tools and services take care of everything else for you. Apps are built using expo-cli, the Expo app (Play Store, App Store) on your mobile device, as well as services such as notifications push, build and Over The Air updates.

Bare workflow

In the simple workflow, you have full control over all aspects of the native project, and the tools and services of the Expo are somewhat more limited. The developer has total control, but with great powers comes great responsibilities, so he has to deal with the complexity that comes with it. You can use most Expo SDK Apis, but build service and easy setup with app.json / app.config.js are not yet supported.

You can get out of Managed workflow to the Bare workflow using expo eject.


When not using Expo?

Since there is no "When to use the Expo?" situation, it is easier to understand when not to use it. If your requirements do not fit into any of the situations below, it is up to you to use the Expo or not. If your app is very simple, doesn’t fit the limitations below, and you’re starting with React Native now, the Expo can help you a lot - this happened to me.

In Limitations you will find an updated list of Expo limitations. I will summarize below what is in the documentation, since it is in English, separating between Workmanaged flow and Bare workflow. Note that the limitations of Managed workflow are not limitations of Bare workflow (no intersections).

Workmanaged flow

  • Not all iOS and Android Apis are available. Example: Bluetooth.
  • The SDK does not support all types of code execution in the background. Example: audio with operating system playback controls.
  • Limitation on minimum app size. For iOS is 20mb and for Android 15mb.
  • It is not possible to add third-party libraries involving native code. Some dependencies like this are included in Expo, such as react-native-reanimated, but you cannot add one that is not in the SDK.
  • The only notification service push supported is the Expo notification service.
  • The minimum versions supported for Operating Systems are Android 5 (API 21) and iOS 10.0.
  • As builds free are usually queued up. But you can generate the builds in your own IC.
  • The updates (JS and Assets) for OTA updates and builds are limited by size (up to approximately 50mb).

Bare workflow

  • The service of build only works in the Managed workflow. However, you can perform the build as it would in a common RN project, on its own.
  • Configuration should be done on each native project (e.g. Android and iOS) instead of once with the app.json.

Comparisons: React Native puro vs Expo

This table was developed by me, aggregating information from several different places, so does not contain all the possibilities, only the ones I found or remembered.

Functionality React Native Expo
Programming with Javascript / Typescript
Modify native code (Android / iOS) Bare workflow
Add third-party libraries with native code Bare workflow
Bluetooth API Feature Request 1
In-app purchases Feature Request 1
Webrtc Feature Request 1
NFC support Feature Request 1
Audio playback with OS controls Feature Request 1
Hermes on Android v0.60.1+ Feature Request 1
Hermes on iOS v0.64.0+ unknown, probably equal above
Permission ACCESS_BACKGROUND_LOCATION optional on Android SDK 40+
Supports iOS 10.0 2 SDK 41+ iOS 11
Supports Android API 16 ~ 20 v0.64.0+ API 21 API 21 on Workmanaged flow 3

1. In general, what possesses a Feature Request to the Managed workflow works in the Bare workflow, because you can modify/include native code.
2. I did not find the version of React Native that supports iOS 10.0, in README.Md only the minimum requirement of version 11 is mentioned, according to that commit of Jan/2021.
3. The Bare workflow Expo supports the same Android API as the version of React Native used.

Services

As mentioned above, the Expo provides some services. This means that by simply using the Expo you already have easy access to all this, while without the Expo you would need to use some third-party resource.

Service Description
Updates Over The Air (OTA) Javascript code update without updating in store (Play Store / App Store).
Build apps in the cloud The Expo holds the build of apps on Managed workflow on their servers, both iOS and Android, so you can perform the build for iOS even without a Macos.
Push notifications You can send notifications push with the Expo using the package expo-notifications.

The Expo will include more things?

If you use Expo, it will depend on Expo to update dependencies, React Native version and have new features. The Expo team is well trained and works in new features, some suggested by the community. The team also performs active work on Github and in the forum of the Expo, besides the blog where they advertise. So yes, the Expo is constantly evolving and including more as it progresses in its SDK version.


My Experience: Expo vs React Native

I published an app made with Expo and one made with React Native (without Expo). Before developing each app, I made a test app to understand how it works (the Expo and the RN) and how I could do what I needed (reading files, writing, API call, navigation etc.), and recommend those who want to learn how to do the same thing with RN.

Developing an app in RN was very quiet, I had to learn some things beyond what I knew when I did with the Expo, which I also needed to learn some things, since it was my first app like this. This is the way I recommend to those who have time, you will have more knowledge to make the real app and the development process and usability will probably be better.

Now, choosing between Expo or React Native is to the liking of developers. If the Expo allows you to do what needs to be done and you have no experience with RN, the development will be faster. If you prefer to understand things better, have time, want more flexibility or the limitations of the Expo bother you, follow the React Native "pure" :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.