r/reactnative • u/[deleted] • 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
5
u/knilf_i_am Apr 30 '22
Running on Expo with 60 or so screens and thousands of users. I’ll give you that Gesture Handler and Reanimated compatibility is a huge bitch, especially on Android, but other than that we’ve been pretty happy.
1
1
Apr 30 '22
Forget about env vars. I like to use the same packages as the web devs at my job. I don't see react-native-config working with Expo
3
u/knilf_i_am Apr 30 '22
I have env vars set up through react-native-env 🤷♂️
0
Apr 30 '22
Yes I use that now for a large company. It's not as good as the alternative. You can't access the vars from Xcode with that lib. Easily
1
May 01 '22 edited May 01 '22
[removed] — view removed comment
1
May 01 '22
I'm honestly just trolling other devs. Mostly to learn thru discussion. Idc. We all do the same thing
4
u/_SyRo_ Apr 30 '22
Holy war is about to start
Btw, I would agree, I see it as an unnecessary abstraction as well. But I think it's ok to use Expo for an app with just 3-4 screens
1
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
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.
Not all iOS and Android APIs are available yet
The SDK doesn't support all types of background code execution
If you need to keep your app size extremelv lean, the managed workflow may not be the best choice
Native libraries to integrate with proprietary services are usually not included in the SDK
The only supported push notification service is the Expo notification service
The minimum supported OS versions are Android 5+ and iOS 10+
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
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
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-fontis 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-fonta problem tho? just because it's a separate module to use fonts? if the same code was inexpopackage then it'd be fine?0
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.
2
u/SSJRedxlll Apr 30 '22
Seems like an ignorant thing to say as a whole, sure you may have had your issues but it's a great tool for many use cases, one example being you don't need a Mac just for compiling an iOS build, another being love development etc...
1
Apr 30 '22
Lol how do u build an iOS app on iOS device without a Mac? That feature you are talking about doesn't work for apple devices. The qr code on expo.io where you let expo bundle ur app?
1
u/SSJRedxlll Apr 30 '22
So the process that I use is I have a test iPhone where I can use the expo go app for live development and then use eas build to create the ios app, eas submit to push it to Test Flight and then can download to my device as a standalone build 👌
1
Apr 30 '22
Yeah. Is eas new? I recently began using Fastlane. It sounds similar
1
u/SSJRedxlll May 01 '22
Eas is somewhat new yeah it allows for proper native building where you can use native code etc which is a lot closer to normal react native so less restricting which has helped a lot for issues I had in the past and you may have had too
2
u/kbcool iOS & Android Apr 30 '22
Expo is great for getting started.
Not going to work for you if you're anything more than a one man free lance team though.
God bless their souls they are trying to be more but you can't solve the need for an open platform with a closed (or rather fixed) one. That is, be everything to everyone.
The people defending it for all its worth just haven't hit the level of maturity to see it for what it is, unfortunately that makes the conversation a bit gutter everytime it comes up. People are always going to talk from their own experience.
1
2
Apr 30 '22
Currently struggling to get react-native-gesture-handler to work with expo
3
8
u/eridr880 iOS & Android Apr 30 '22
Any specific reason? With EAS and expo-updates I see no reason why I wouldn’t use expo.
2
u/reddittidder Apr 30 '22
You're telling this to reddit where a whole generation of mouth breathers grew up jacking off to Haskell.
Good luck!
3
1
u/averageFlux Apr 30 '22
I am no expo user and don't plan to anytime soon. But I think you should elaborate just to be fair.
1
Apr 30 '22
React native is a npm package. I should do all the same things the same way as any other node developer. Expo make you donworkarounds for EVERYTHING.
Even thing that are easy. Like environment variables
1
u/Blueghost512 Apr 30 '22
Well, sometimes you need a soft easy start before digging deep into your project.
I used expo as a P.O.C to check if my app idea is doable. Then at early stage I copied my code to a new bare workflow rn cli project
Edit: I have an iphone and windows 10 and I hate Android Studio, so that’s reason #2
1
Apr 30 '22
2
u/Blueghost512 Apr 30 '22
Thanks
1
Apr 30 '22
I love it dude. I use it ALL the time just to test custom components or backend stuff in node for RN apps
2
u/bleah2 Sep 21 '23
What I don't like is that I can't make as many builds as I want.
I have to wait 45 minutes between builds in a "Free User Queue" which I literally hate. They also don't tell you this. I've learned this after developing my app and starting testing with real builds.
I've started using EXPO to learn React Native mobile dev and it was nice in the beginning... well, except for the routin, because their router documentation doesn't make any sense.
Then I've started building APKs for my app and it uses nothing from EXPO. You can only debug using ADB.
It's a wrapper on another wrapper that prompts you to use other tools to test and debug your app.
Now I spend 90% of my time on waiting in build queues and then figuring out how to debug APKs, because what works in Expo GO, doesn't work in the actual build.
Also, definitely worth mentioning that the documentation is poorly written, the forum barely gets you any response and the Discord server is absolutely dead. I've asked tons of questions on Discord and never have I received an answer.
Why use Expo if I can go straight to Android Studio and have every tool I need there ? Sure, it will take more time to learn Kotlin and so on, but I will have everything I need in one place.
Starting with EXPO is easy and straightforward.
Building, deploying, testing and debugging ? Choose something else.
1
u/codegodzilla May 23 '24
expo business strategy is to lure people into their eco system, make them dependent, and then rack up the pricing. Expo is a billion dollar business built on open source community.
1
1
u/mshenoy May 01 '22
Expo should be used for learning react native concepts faster.
It's not ment for production usage. I know they are working hard to make sure everything works in it and it's production ready.
But we gotta remember that Native Android development > React Native Development > Expo.
0
u/Jiua May 01 '22
This is a classic case of the following:
"The best way to get a correct answer on the internet is to post an obviously wrong answer and wait for someone to correct you."
2
u/kbcool iOS & Android May 02 '22
Except it's not wrong. Just not very well argued.
1
1
u/Jiua May 05 '22
Claiming “it’s not wrong” is a definite statement to a debate that isn’t specified. It’s a black and white statement without context, where the context creates the distinction. Some cases, yes, it’s wrong, and others, no. It depends.
Is it okay to suggest Expo managed flow to a beginner? Sure, for similar reasons as others here mentioned. What about for a big corp’s principal revenue source? No way.
Some Expo packages in isolation can be great options depending on the need. One of the best examples where Expo shines right now is with expo-dev-client, which can adhere to an existing react native project propelling development velocity.
Anyhow, my point is being black and white on this subject will only restrict the overall benefit one could bring in.
-3
u/mms13 Apr 30 '22
Expo is to React Native as training wheels are to a bike: use ‘em if you need ‘em
1
-1
24
Apr 30 '22 edited Apr 18 '24
[removed] — view removed comment
-3
Apr 30 '22
Give me one example of an expo app you use everyday that we all know and use
5
u/Sibyl01 Apr 30 '22
Why It should matter? You still build it with react native. Who cares If expo is used in any production app or not?
-5
3
May 01 '22 edited Apr 18 '24
[removed] — view removed comment
1
May 01 '22
Thank you for the insight (<= couldn't fit this at the bottom of the comment bcuz screen size)
This was the best opposing argument I have heard. I believe u. No I have not used expo since EAS came to popularity so I don't know it. It sounds like what I had to learn to do with Fastlane and Ruby.
I also build RN apps for a large-ish company. Starting my second with them soon. Tried the first one with Expo. Left Bad taste in my mouth a year later. I try not to use it now. It reminds me of Norton antivirus
6
0
Apr 30 '22
[deleted]
2
May 01 '22
[removed] — view removed comment
1
u/satya164 May 01 '22
Agree. Also, realistically non of the projects I worked were really bleeding edge, upgrading RN took quite a while due to project complexity so we always stayed on the older versions until we manage to upgrade. At least upgrading isn't such a pain with Expo managed workflow.
6
u/JohnnyHopkins77 iOS & Android Apr 30 '22 edited Apr 30 '22
Like.. which part of the Bare workflow made you switch?
Edit: Expo SDK APIs are the industry standard in some cases, saying to not use Expo like at all is a bit wild