So it was very much a complex infrastructure that never was able to update to match what the ecosystem was providing. So, eventually, Cordova kind of became a victim of its failure to update. And it really just was not a good time. If you're doing anything in Cordova now, I highly recommend that you don't. Upgrade the capacitor after this.
Now, what was interesting about Cordova, and some things that I think they had that were pretty interesting, was, again, the web was their main goal. They wanted to just be a giant polyfill to bridge the gap in what the browser was doing. The gap in what the browser could do and what native could do. They really didn't want people to know about a native IDE, which, as somebody who's primarily a web developer, every time I have to open up Android Studio, I kind of get afraid a little bit because Android Studio is very complex. Same thing goes for Xcode. It can be a very complex tool and a very confusing tool, so I think them having the idea of let's go ahead and abstract that away was a good attempt and a good goal, but implementation left a lot to be desired. And then native projects has a DIST target, meaning that your native project should be something that can be configured through tooling and then if, for some reason, you upload it to version control and then your co-worker had to clone it and set it up again, they should be able to get the same steps and get the same features and enablements, like accessing file system in camera, that stuff should be scriptable. How successful they were in that kind of depends, but it was an interesting idea at the time. But it's definitely hindsight's kind of 2020 when you think that this definitely did not work out 100% well, but at the time it was the best that we probably had.
Now at the other end of that spectrum where we have phone gap being one step removed from web development, what's one step removed from doing pure native development? And that's the compile to native, your React natives so to speak, where they have a JavaScript runtime or a runtime in another language. And then they go ahead and abstract the controls, provide you a widget or something that you can use in place of that that isolates the difference between what does text look like on iOS and what does text look like on Android. Now this is something that is a point of... It's a very contentious point where they say it's a truly native app. But there's still a JavaScript runtime in most of these and specifically we'll pick on react native. There is still a JavaScript runtime in there that is executing all of your code. Any of your app logic that you write in JavaScript is going to be executed and needs to be run. So truly native is a... It depends on how you look at it. You might be getting native controls, but native controls are literally not the most important thing. The most important thing is the app code that you are writing to actually fetch requests, to actually go ahead and handle state inside of your app. The UI is just an afterthought, in my opinion. Something that they did do well, which I really think is a good move on them, is having like a standard library around some of these native APIs. So React Native provides a core library that ecosystem has been able to build on top of that you can use to build and expand. But most of those APIs exist and are available without you having to ever install something like Expo.
Now, oh, this slide was a little askew. Now, the thing that I like to make sure that people are aware of is that architecturally, React Native and other projects like it are very similar to Cordova. Where you have your app represented in this blue square, you have this runtime, which is, in React Natives example, vajscore, they have some custom ones as well that go ahead and execute your app and then take calls inside of your JavaScript and then link them with the native modules and pass them off to this bridge that goes ahead and calls out to those features, serializes those results, and pass them back into your JavaScript. This same workflow exists in basically every solution today. There's really no getting around it. This is how Cordova works, this is how React Native works. And as we'll see, they're not alone.
Now, I'm not necessarily someone who does React Native on a day-to-day, so I'm not gonna try to show some code, but I will say, in the demos that I have built with React Native, where it kinda breaks down is having to understand that you're not necessarily working in pure web or pure Native. For instance, if you are in a pure Native environment, you might be used to having direct access to APIs. With React Native, chances are, you're going to be building a Native module, which has its own kind of steps for exposing those low-level APIs to your JavaScript. Or if you're trying to get direct access to it, you're blending React Native into an existing Native app. And then you're in this weird, what app is being running? What processes are going on? It's a very weird place to be involved in. If you're coming from a web app, or already have an existing web app, and want to use something like React Native, you're kind of out of luck right there as well, because even though there are libraries like React Native DOM, React Native web, you're not pulling in your existing web app and loading it in there. You are rewriting your app to make sure that it works in those abstractions, first and foremost, and then hope that you can re-implement what your existing web app does within React Native. How successful that is really depends on engineering power and how many hours are you willing to put up with it. I think it is less successful than people try to make it out to be. There is a lot of work that goes into getting React Native web up and running. And even then, if you're dependent on certain libraries, like one, for example, is called Quill.js, it's one of my favorite, Rich Text Editor plugins, it doesn't exist in a React Native ecosystem. So you're not able to just use that in there and throw that into your React Native app. You're kind of having to re-implement it. So leaves a lot to be desired.
Comments