r/reactnative • • Apr 30 '22

FYI Stop Using Expo

To whoever needs to hear this: It's digging you into a hole you will have to dig out of with bad habits and dead ends. I promise.

Edit: I can't name off all the problems expo has in one go. It's one of those things you see constantly in small places and just know it is the biggest issue in development

0 Upvotes

65 comments sorted by

View all comments

2

u/satya164 Apr 30 '22

What kind of bad habits exactly?

There are no dead ends, it's possible to use a lot of native modules with a custom dev client, and if you need something that's not possible with that, you can eject to bare workflow any time and have full freedom. You're not locked into anything.

3

u/[deleted] Apr 30 '22 edited Apr 30 '22

Almost all real tracking libs don't work. How about this: add just one font file and use it in expo (instead of the whole library). Can expo do that or do I have to add a full (Huge) module? (Hint: no it can't. You have to add 4 other EXKits or whatever they call it.)

It can't do Hermes either in iOS. The new js engine.

  1. Not all iOS and Android APIs are available yet

  2. The SDK doesn't support all types of background code execution

  3. If you need to keep your app size extremelv lean, the managed workflow may not be the best choice

  4. Native libraries to integrate with proprietary services are usually not included in the SDK

  5. The only supported push notification service is the Expo notification service

  6. The minimum supported OS versions are Android 5+ and iOS 10+

  7. Free builds can sometimes be queued

Bottom line: expo is fine if you are a beginner, but as a professional, you will move on. It's way easier to control RN than expo and one hell of a job to completely remove it. I know I've done it, as you remove what it installs you realize it is all bloated stuff you don't need. Expo build times are HORRENDOUS

1

u/satya164 Apr 30 '22 edited Apr 30 '22

add just one font file and use it in expo (instead of the whole library). Can expo do that or do I have to add a full (Huge) module? (Hint: no it can't

They even have an example of how to do that: https://docs.expo.dev/guides/using-custom-fonts/#a-minimal-but-complete-working-example

It can't do Hermes either in iOS. The new js engine.

It can with bare workflow. But not every project can use Hermes on iOS given that it doesn't support things like intl. And not switching to Hermes isn't actually preventing any critical functionality. It'll probably be possible someday.

The SDK doesn't support all types of background code execution

There's https://docs.expo.dev/versions/latest/sdk/background-fetch/ depending on the use case. Though very few apps actually need to execute code in the background.

If you need to keep your app size extremelv lean, the managed workflow may not be the best choice

App size is not a problem with EAS. Only the modules that you install get bundled.

Native libraries to integrate with proprietary services are usually not included in the SDK

Neither are they in React Native. While many are already included, you'd need to use third-party libraries anyway if you don't use Expo so there's no disadvantage. Many third-party libs can be used using a custom dev client with a config plugin. And there's always the option to use bare workflow.

The only supported push notification service is the Expo notification service

You can always use bare workflow, but not every project needs to use a third-party service.

The minimum supported OS versions are Android 5+ and iOS 10+

Those are the supported versions by React Native

Free builds can sometimes be queued

You can build locally if you want like you'd do with regular React Native

Many of these are very specific use cases, so "stop using expo" isn't appropriate advice for everyone. And all of those use cases can be achieved by ejecting to bare workflow - which anyone can do if their use cases change in the future.

expo is fine if you are a beginner, but as a professional, you will move on

I'm a professional working with React Native since it was launched.

It's way easier to control RN than expo and one hell of a job to completely remove it

I have had many clients using Expo bare workflow and don't see any reason to completely remove it. But like any library/sdk you're already using a lot will be difficult to completely remove so don't see why it's specifically against Expo.

1

u/[deleted] Apr 30 '22

The bare workflow still have 50% expo packages in the Pods. What's the diff? That I don't use expo-cli?

1

u/satya164 Apr 30 '22

The bare workflow still have 50% expo packages in the Pods

It only has the packages you use. if you use 50% of expo packages then there'll be 50% of expo packages, but why is that a problem? if not those packages you'd be using similar modules from other developers anyway.

0

u/[deleted] Apr 30 '22

import { useFonts } from 'expo-font';

Is a module...not a file

1

u/satya164 Apr 30 '22

you were talking about font file, expo-font is the module for loading font files and can load single font files like in the example that you said it can't.

why is expo-font a problem tho? just because it's a separate module to use fonts? if the same code was in expo package then it'd be fine?

0

u/[deleted] Apr 30 '22

Expo-font package weighs a lot more than a single .ttf file from Google. And then the dependencies ..my god

2

u/satya164 Apr 30 '22 edited Apr 30 '22

Expo-font package weighs a lot more than a single .ttf file from Google

Why are you comparing a native module to font file? Even then it's like 100kb in total, many of which are likely build files etc. that won't be included in the bundle, for multiple platforms - and smaller than a single font face of Roboto regular which is like 168kb.

And then the dependencies ..my god

It literally has a single dependency.

Expo has some disadvantages, but you're nitpicking the least consequential thing.