1 00:00:02,180 --> 00:00:06,790 So you learned how you can use to React Native CLI to create React Native projects. 2 00:00:06,800 --> 00:00:12,260 These are projects which have no connection to expo and which are therefore totally managed by you and 00:12.260 -- 00:19.880 where you can therefore add any third-party package actually, including some expo packages which are available 3 00:00:19,940 --> 00:00:21,710 outside of the managed workflow as well 4 00:00:22,160 --> 00:00:23,980 but you need to configure everything on your own, 5 00:00:24,020 --> 00:00:28,850 that can be easy depending on the package you're using but it also can be harder. 6 00:00:28,850 --> 00:00:34,150 Now there is kind of a middle way between the expo managed workflow and the pure, 7 00:00:34,160 --> 00:00:40,120 you need to do everything on your own, workflow and that's the expo bare workflow. 8 00:00:40,130 --> 00:00:42,820 Now what's the bare workflow here? 9 00:00:42,980 --> 00:00:49,880 The bare workflow includes a React Native app as you would created with the React Native CLI, 10 00:00:49,890 --> 00:00:58,040 so not a managed app with expo as a wrapper but a native app, that however is already preconfigured 11 00:00:58,310 --> 00:01:01,470 to support a lot of the expo packages, 12 00:01:01,490 --> 00:01:06,770 not all but the expo team is working on making more and more available outside of the managed workflow 13 00:01:07,190 --> 00:01:12,560 but a lot of them are already included and you could check the supported APIs page here to get an 14 00:01:12,560 --> 00:01:17,230 idea for which features you can use in the bare workflow as well. 15 00:01:17,240 --> 00:01:23,150 The idea behind the bare workflow is that you have this raw native development experience where you 16 00:01:23,150 --> 00:01:30,140 need to use Android Studio and Xcode, so you don't have the expo CLI and the expo client helping 17 00:01:30,140 --> 00:01:33,610 you, so you need to do that manually with the help of the React Native CLI 18 00:01:34,040 --> 00:01:38,420 but where adding native functionality is easier, 19 00:01:38,450 --> 00:01:44,390 so where you need to do less configuration maybe, where you can use these powerful native packages that 20 00:01:44,420 --> 00:01:50,700 expo offers you where you can use all of that without having the limitations expo gives you, 21 00:01:50,750 --> 00:01:56,480 though I want to put limitations into quotes because you don't have that many limitations actually in 22 00:01:56,480 --> 00:01:57,900 the managed workflow. 23 00:01:58,100 --> 00:02:03,530 So let me show you how to get started with that bare workflow and of course for that, you can also check 24 00:02:03,530 --> 00:02:06,250 the official docs. Here 25 00:02:06,290 --> 00:02:11,750 you need to have the expo CLI installed and we installed that at the beginning of the course of course 26 00:02:11,750 --> 00:02:13,830 for creating our managed project 27 00:02:14,030 --> 00:02:20,810 and you also need to have the React Native CLI installed. In addition and that's also important, 28 00:02:20,900 --> 00:02:26,660 you should generally have the setup which is described here on the React Native docs under React Native 29 00:02:26,660 --> 00:02:32,780 CLI quick start, so make sure you set up your system as described here for the different platforms, 30 00:02:32,780 --> 00:02:38,300 the different operating systems you're targeting, so make sure you install Android Studio and Xcode 31 00:02:38,300 --> 00:02:43,700 and all the dependencies you'll find here because you will use this workflow, you just get a little bit 32 00:02:43,700 --> 00:02:52,720 more than this raw empty project you have here. So once you have all of that installed, you can create 33 00:02:52,960 --> 00:03:01,850 a new bare workflow package with this command or in general by running expo init and then any project 34 00:03:01,850 --> 00:03:11,390 name of your choice, like RNWithExpoBare and make sure you're running this command in a path where 35 00:03:11,390 --> 00:03:13,640 you want to create this project folder. 36 00:03:13,880 --> 00:03:20,600 So if you run this now, this will create a new expo project and this is also the prompt we saw at the 37 00:03:20,600 --> 00:03:22,110 beginning of the course, there 38 00:03:22,250 --> 00:03:24,090 I chose blank 39 00:03:24,260 --> 00:03:28,670 and please note that this of course was part of the managed workflow, 40 00:03:28,670 --> 00:03:30,500 what I chose at the beginning of the course, 41 00:03:30,620 --> 00:03:36,500 now we can choose the bare workflow by going to the bare minimum selection here and hit enter 42 00:03:36,500 --> 00:03:42,980 and what this does is it now creates a new project and we can now enter a name here for the app that's 43 00:03:42,980 --> 00:03:49,310 visible on the home screen, RNBare and here also 44 00:03:49,630 --> 00:03:51,870 RNBare. 45 00:03:51,900 --> 00:03:55,260 So choose that here, hit enter and now this creates a new project, 46 00:03:55,260 --> 00:03:57,920 I don't want to use yarn, I'll use npm instead. 47 00:03:58,050 --> 00:04:01,090 This will create a new project, a new React Native project 48 00:04:01,170 --> 00:04:09,480 pretty much like React Native init would do, so if you only used the React Native CLI but preconfigured 49 00:04:09,870 --> 00:04:16,930 such that you can already use a lot of these supported or all of these supported APIs. Now important, 50 00:04:17,500 --> 00:04:23,170 the project setup we're getting here could also be achieved with this React Native CLI created 51 00:04:23,280 --> 00:04:28,660 set up where I didn't use the expo CLI at all because the magic happens with the help of these 52 00:04:28,900 --> 00:04:31,710 React Native unimodules here. 53 00:04:31,870 --> 00:04:38,440 This is a package in the end provided by the expo team which helps you tap into the native device 54 00:04:38,440 --> 00:04:44,680 features you can get in the managed workflow outside of the managed workflow as well. 55 00:04:44,680 --> 00:04:50,230 Now important, if you visit the github page of the React Native unimodules and you can simply search for 56 00:04:50,230 --> 00:04:58,140 this name to find it, you'll also find instructions on how to add this to an existing React Native app. 57 00:04:58,190 --> 00:05:03,620 Here you find instructions how you need to configure this and all this configuration which is described 58 00:05:03,620 --> 00:05:03,980 here, 59 00:05:03,980 --> 00:05:09,170 so all these things here right, which you need to do if you would want to use this package and therefore 60 00:05:09,170 --> 00:05:13,450 the expo native features in a normal React Native non-expo app, 61 00:05:13,610 --> 00:05:17,880 you would have to do them manually for such a project created with the React Native CLI 62 00:05:18,160 --> 00:05:20,050 and that's exactly what expo init 63 00:05:20,060 --> 00:05:26,930 with this bare workflow does for us, it gives us such a React Native project as if we would have created 64 00:05:26,930 --> 00:05:32,720 it with the React Native CLI and it preconfigures it following all these steps, 65 00:05:32,750 --> 00:05:34,480 so then we don't have to do that. 66 00:05:34,640 --> 00:05:37,580 So that's something we can take advantage of of course, 67 00:05:37,580 --> 00:05:40,460 so let me open this project, 68 00:05:40,510 --> 00:05:46,660 this is now the RNWithExpoBare project I just created and there, you'll find some similarities to 69 00:05:46,690 --> 00:05:49,660 the React Native project we created with the CLI, 70 00:05:49,690 --> 00:05:57,400 pretty much the same config files, the same starting app.js content, now here actually expo used an 71 00:05:57,400 --> 00:06:01,990 older version of React Native to create this which is why this looks a little bit different but in the 72 00:06:01,990 --> 00:06:05,170 end, you'll get the same setup as with the React Native CLI 73 00:06:05,160 --> 00:06:11,230 but as I mentioned with the Android and iOS folder with these Android and iOS projects preconfigured 74 00:06:11,560 --> 00:06:15,440 as described on the unimodules page so that you don't have to do this 75 00:06:15,730 --> 00:06:24,010 and with this preconfiguration, you can now easily add third-party packages, you can add any third-party 76 00:06:24,010 --> 00:06:26,030 package, you could for example now 77 00:06:26,050 --> 00:06:29,260 also again use the React Native image picker, 78 00:06:29,260 --> 00:06:34,030 so what we added before, what we couldn't add to a managed workflow app, 79 00:06:34,030 --> 00:06:40,330 this package here, you can easily add this to a bare workflow app because this is just a React Native app 80 00:06:40,360 --> 00:06:47,770 without expo, so you can add this but now unlike in a normal React Native only app without expo, you 81 00:06:47,770 --> 00:06:54,220 can also bring any of the expo APIs which are listed here, like the expo location package which we used 82 00:06:54,220 --> 00:06:55,320 earlier in the course. 83 00:06:55,420 --> 00:07:01,600 You can now easily install this by following the installation instructions you're linked to here for 84 00:07:01,600 --> 00:07:05,950 the bare workflow, you would then have to follow the installation instructions you find here on the 85 00:07:05,950 --> 00:07:12,340 expo location package, there you learn that you can install it with this command, then run port install 86 00:07:12,340 --> 00:07:16,240 in the iOS directory and no extra setup for Android is required. 87 00:07:16,290 --> 00:07:22,360 So fair enough, not too difficult and therefore you could maybe say you get the best of both worlds, 88 00:07:22,570 --> 00:07:30,060 you have a native app with React Native CLI and you can still tap into some expo features, though 89 00:07:30,070 --> 00:07:36,370 be aware of course that if you run this app, if you do this of course with react-native run-android for 90 00:07:36,370 --> 00:07:42,900 example and therefore this requires Android Studio, it builds it locally on your system, you therefore 91 00:07:42,930 --> 00:07:48,130 take a bit longer, you need to set up everything on your system and for deploying the app and so on 92 00:07:48,130 --> 00:07:55,360 you also have to manage it all here on your local machine, so you get no convenience features which 93 00:07:55,390 --> 00:08:00,370 expo gives you in the managed workflow where this building and testing is super quick, where you can 94 00:08:00,370 --> 00:08:02,760 quickly test it on a real device and so on, 95 00:08:02,860 --> 00:08:04,560 all of that is missing here too. 96 00:08:04,690 --> 00:08:10,450 You have a React Native project without expo but using certain expo APIs is easier, 97 00:08:10,450 --> 00:08:17,580 that's the idea behind the bare workflow and since expo has many amazing APIs, that of course is a 98 00:08:17,580 --> 00:08:25,050 pretty good reason for using it because these APIs, these packages are also pretty guaranteed to be 99 00:08:25,050 --> 00:08:26,340 continued and maintained 100 00:08:26,400 --> 00:08:30,660 which is not necessarily the case for all other third-party packages 101 00:08:30,660 --> 00:08:32,700 you might be adding to your React Native apps.