7 ms·
Am I the only one who feels like this is anything but native?
by vmateixeira 10y ago
Am I the only one who feels like this is anything but native?
- oakesm9 10y agoI've worked as a "real" native Android and iOS developer for a fair few years and just started working on a project which is built using React Native (Android and iOS). You're right that the development experience is nothing like "real" native. It's using lots of web tech so it's never going to feel like Java or Swift, however, that comes with its own advantages such as code reuse and libraries. I'm actually really impressed with the quality of the apps you can create with it. They feel native and feel really smooth, but you need to be aware of the limitations. The major one is that the apps are essentially single threaded so you need to be aware what work you're doing to avoid UI stutters. That does make it less suited for very data heavy apps, but you can work around it if needed. Overall, as a "real" native developer I'm pleasantly surprised.
- caleblloyd 10y agoCan you use React Native for the UI thread and talk to another thread to get data or perform long running calculations?
- kcorbitt 10y agoYes, I do this in my app. It's well-supported by the platform and quite easy -- there are built-in primitives to call a native function from javascript that returns a promise, which can then be fulfilled/returned asynchronously on the native side once your long-running calculation or transfer is finished.
- vmateixeira 10y agoMy main concern is about the performance and overhead that whole node ecosystem brings. Despite that, it's nice to read a positive feedback :)
- Illniyar 10y agoOther then using the same package manager there is very little overlap between the node ecosystem and react's, so I'm not sure what you are referring to
- vmateixeira 10y agoMaybe I missed something.. where are all js files going to be rendered on?
- Illniyar 10y agojavascript engine provided by the OS, in iOS it's JavascriptCore, in UWP it's the chakra engine. Not sure what it is in Ubuntu, probably v8 packaged with the executable. In either case, it's not using node or v8/chromium .
- vmateixeira 10y agoSorry about my uneducation but if v8 is running standalone isn't this similar to having node running on the OS?
- Illniyar 10y agov8 is just a javascript engine, node.js is a platform built on v8. Node.js adds various standard native modules - mostly various IO (file, tcp etc...), a way to load other modules, access to the underlying OS (environment variables etc...). running v8 alone is akin to running the browser without html or the dom api, you basically can compile and run javascript functions, but can't do much with it.
- blahi 10y agoIsn't javascript really really really fast? The Julia websites has a benchmark for various languages performing some tasks. Javascript seemed pretty comparable to Java.
- loftyal 10y agoI'm not familiar with React Native but can't you use Web Workers to get multi threading, and get around the UI stutters?
- humanrebar 10y ago> It's using lots of web tech so it's never going to feel like Java or Swift I'd consider Swift to be native, but Java generally not. You can compile Java to machine code, but typically people run bytecode on a VM.
- maccard 10y agoI think by Java he's talking about Android.
- humanrebar 10y agoI think we need to find better terminology, then. The same thing happened for 'realtime'. It used to imply hard deadlines in performing actions (like applying brakes in a car). Now there are realtime web apps that certainly don't have those sorts of requirements.
- maccard 10y agoMy understanding of real time is that it can be broken into hard real time and soft real time. Hard real time systems (such as car brakes) require a guaranteed response time. Soft real time systems (games are the canonical example) have similar time constraints, however the penalty for not hitting them isn't considered an absolute failure (not hitting 16ms/frame every now and again isn't the end of the world). I'm not aware of any other definitions of real time systems?
- fit2rule 10y ago>it's never going to feel like Java or Swift .. or Lua, or Bash, or Qt, or Love, or Unity, or Tcl/Tk, or C/C++, or .. anything else that this is now sitting alongside, 'in the stack of usable components'. Its good for web developers. But in the 'native application' realm, there are .. frankly .. a lot of better ways to do user interfaces than the franken-nightmare that supports the gloss...
- deleted 10y ago[deleted]
- Illniyar 10y agoIsn't react native using one thread for uiand another for running js? Can you use service workers with react native?
- asQuirreL 10y agoYour app doesn't need to be single threaded. To begin with, the JS that you write is running on a different thread to the app's UI thread, but if you also have blocking work that you want to offload to another thread, that is possible by writing a native module [1, 2]. The story isn't perfect, there are probably some things that you want to be dealt with asynchronously, but could be written in JavaScript, but on this front React Native isn't any less limiting than native. [1] https://facebook.github.io/react-native/docs/native-modules-ios.html#threading https://facebook.github.io/react-native/docs/native-modules-... [2] https://facebook.github.io/react-native/docs/native-modules-android.html#threading https://facebook.github.io/react-native/docs/native-modules-...
- tmbsundar 10y agoTo the extent I have used RN, I find the good parts to be: - Fast & iterative development - If you are web developer, easy to switch to this (duh!) - The "React" philosophy of "diffing" and pushing changes and having a virtual DOM - Javascript - less boiler plate and easier to write (YMMV) But, with RN you hit the limits in some spots: - Handling navigation. The available navigator components are difficult to work with. The idioms are little sticky. I know they've started working on a new one - With Android SDK, you have the full set of components available and hence more choices - components, Material themes etc., - Because of the above point, you are always ahead, unless you have bandwidth to write wrappers for new components/ changes - Slightly noticeable lesser frame rates compared to native. I don;t think this is a deal-breaker though. Overall, the RN team is doing a great job by bringing the well tested RN concept to the mobile world and making "reusable code" worth an attempt. The choice depends on one's requirements and technology choices available in the project etc.,
- augustl 10y agoReact Native is a React based JavaScript runtime that renders by using React output as a base when talking to the APIs of various different native platforms. As an example, React Native for iOS renders the GUI using UIKit.
- fit2rule 10y agoI'm with you. This is "React Glommed onto its Dependencies, Because: Ubuntu". But then, platform domination is always a thing, and right now its Reacts/Facebooks' thing, so onward it rolls. For my part, I'm looking forward to React wiping out every other single, similar, framework in the repo's. (I'm not.)
- owaislone 10y agoDepends on your definition of native. If by native you mean using the native UI toolkit (QT in case of Ubuntu) then yes, it is 100% native. However, if your definition of native means a compiled language instead of a interpreted one like JS, then no it is not. That said, the actual native toolkit Ubuntu has also runs JS in userland (QTQuick) so I doubt it is much different technically.