You could say there are around three ways of building a React Native app -
one is with expo with the so-called managed workflow,
that's the approach we used in the course and this has kind of a dashed line around it because this
is not really an alternative for building a non-expo app, this of course heavily embraces expo instead,
it is the approach we use
in the course. It is easy to use, has pretty much zero setup, it works out of the box, you can easily test the
app on a real device, you got lots of native modules built in which are super easy to install and to use.
It's controlled with the expo CLI, you just type npm start or expo start, you've got the expo
dev tools in the browser, it's easy to run on simulators and real devices and you still can get a standalone
app which you can deploy, which as I explained contains the expo client as a wrapper so to say. Since you
can also easily test it on real devices, you technically don't even need to install Android Studio or
Xcode to build an app with expo. I did install it and I kind of instructed you to also install it for
this course so that we could spin up simulators and test it there because I didn't constantly want to
test it on a real device and record that screen but you don't need to do that, you can test it on
a real device with the expo client app installed there only,
so that's something you can do. Now
this is the approach we used but of course this is then an expo heavy app, it's an app fully in the expo
ecosystem with all the restrictions or disadvantages I outlined.
Now an alternative to that is that you still use expo but the so-called bare workflow or that you
build a React Native app without expo at all with the React Native CLI.
Now the expo bare workflow thing can either be created from scratch or by ejecting from the managed workflow
and that's something I'll also show you in this module.
Now when you build an app with the bare workflow, you get a non-expo app, you build a native app as you
would build it with the React Native CLI,
so you get the same basis there,
the difference is that you can still use special expo packages. Installing them is a bit more complex
than when you're in the managed workflow, you need to do more manual wire up work, at least for some
packages but many, not all but many of the expo packages which are included in the managed workflow are
available as standalone packages you can bring to any React Native app as well
and the expo team is working on making more and more packages available outside of the managed workflow.
So you can bring that and with the bare workflow, it's relatively easy to add these packages, not as easy
and quick as in the manage workflow but still, very easy. When building an app without expo at all, with
the React Native CLI,
you can still bring these packages but then more manual setup is required. Now as I said, it's relatively
easy to configure and manage in the bare workflow,
you have to manage more in the React Native CLI workflow,
so there you really build everything without any support by expo. Regarding the native modules you use,
you can use any native module you want, also non-expo ones, you can bring these special expo packages
which you need to wire up manually but you can bring any other native module.
Now when we come to building the app and distributing it, with the managed workflow you will see in the
deployment module that's super easy to do, with the bare workflow it's a bit "harder" in quotes, it
requires more work with Android Studio and Xcode and it's not as easy as with the expo managed workflow,
you also for example and that's one important restriction, you will not be able to build iOS apps on
Windows.
That is possible in the managed workflow because the build won't happen on your machine
there but in the cloud, with the bare workflow and with the React Native CLI, you are responsible
for building the apps and therefore, you need to do it locally on your machine and therefore due to Apple's
restrictions, you will not be able to build an iOS app on Windows or Linux,
so that's one thing to keep in mind there as well.
So you do it all on your own there,
so you need these tools installed and whilst you won't use them to write code, you will need to fiddle
around in them a bit and you will use them to then build your app and deploy it at the end. These are
the alternatives. Now for deployment,
I'll have a separate module where I have a look at how that works with the managed workflow and also
without the managed workflow,
so that's not something I'll focus on in this module,
instead in this module I want to show you how you build an app with the React Native CLI, how you also
build it with expo in the bare workflow and how you can eject from the managed workflow to the bare
workflow.
We'll also have a look at how you can add some native device features in these two alternatives because
that is the part where it mostly differs from the managed workflow.
The way you write your components and so on and which components you use from React Native,
that does not differ at all because there was nothing specific about expo in that. Put it in other words
if we have a look at the project we worked on earlier in the course,
this native module project, essentially what you'll lose when you're not using the managed workflow
is all the expo related imports, everything you're importing from expo,
that basically is something which now is harder or which you now need to do differently.
If you're not using expo like in this file, such a file would not need to change at all,
only files where you use something from expo need to be adjusted or need to be implemented differently
when not using the managed workflow or to be precise, you might not be able to use certain packages anymore
or you can still use them and you probably don't even need to touch your code at all
but in order to use them you need to do more manual setup work than you need to do with expo and the
managed workflow.