News for hackers. Stuff that matters.
Re:Switching From React To Vue.js by TekMol on Sunday May 28, 2017 @09:11AM (#14434257)

    Options like React-Native
When you use React for a web app, how close are you to turn it into a React Native app?
Re:Switching From React To Vue.js by nathan_f77 on Sunday May 28, 2017 @02:34PM (#14435511)
It's difficult to convert a React web app into a React Native app, but you can use many React Native components on the web (via react-native-web. [1]) In other words, you can't run a web app on mobile, but you can run a mobile app on the web.

I just launched a little game that I built with React Native [2], where I have a single codebase that supports iOS, Android, Windows, and web.

[1] https://github.com/necolas/react-native-web

[2] https://sudoblock.com

Re:Switching From React To Vue.js by dabit3 on Monday May 29, 2017 @12:35AM (#14437420)
It's less about code reuse across a full featured web application and a mobile application. The value comes in that once you master React or React Native, you can easily switch across platforms and be just as efficient. If you learn the ins and outs of Vue and gain depth of best practices / domain knowledge, you are stuck building only for the web.

If you do the same with React, you are then able to take those skills and build VR, Web, iOS, Android, Windows, and soon TVOS ++ many more in the future.

This, along with what has already been stated, is the value of using React vs Vue imo.

Re:Switching From React To Vue.js by gustojs on Sunday June 11, 2017 @06:25AM (#14531440)
I don't see an issue of learning Vue and not being able to write native apps for iOS and Android as a valid one.

Weex quickly gets better and is maintained by Alibaba, a company of the same scale and with development resources comparable to Facebook or Google. NativeScript recently started work on Vue port, the project is already available for testing. That's excluding the Cordova solutions like Onsen and Framework 7 having official Vue ports.

To that, PWA slowly becomes the new trend for mobile development, native apps are not necessarily the optimal solution to every use case.

The "++ many more in the future" is an optimistic assumption. As much as I wish it to be fulfilled, same can be said about any other framework.

Re:Switching From React To Vue.js by chii on Sunday May 28, 2017 @09:34AM (#14434320)
the hearsay is that if you used only components that are available for both, it'd take very little extra boiler plate to get it working on both native and web. But all non-trivial apps have their own components and that's what makes native difficult.
Re:Switching From React To Vue.js by zackify on Monday May 29, 2017 @12:28AM (#14437406)
This really isn't the case. I have built apps with lots of code reuse on native and web.

Abstract all data logic and you can use the exact same code for both apps. This of course does not include your view layer. If you do it correctly, all you have to do is make a new set of view components. Stateless ones. Because you are injecting the state from your non platform specific components.

It makes it extremely fast to build for other platforms. It just takes a few apps to fully understand how to abstract these things perfectly.

Re:Switching From React To Vue.js by nathan_f77 on Sunday May 28, 2017 @02:41PM (#14435546)
This is not really true, the react-native-web project provides compatibility for all of the fundamental components that you need, such as View, Image, ScrollView, TouchableOpacity, etc.

There are still some missing components [1], but nothing I really needed (or couldn't work around).

[1] https://github.com/necolas/react-native-web/issues/91

Re:Switching From React To Vue.js by k__ on Sunday May 28, 2017 @10:26AM (#14434468)
I'm a freelancer, so I do different projects. Web, Mobile, etc.

Now I can do them all with one framework.

Re:Switching From React To Vue.js by t1amat on Sunday May 28, 2017 @11:07AM (#14434652)
If you stick to using `react-native-web` components to design your web UI then your app is likely compatible with React Native and can be run as a mobile app in addition to deployed as a web site.
Re:Switching From React To Vue.js by Double_a_92 on Monday May 29, 2017 @02:42AM (#14437757)
Do you remember when the first iPhone was released and one of its main marketing points was that it could browse the REAL web? ... Nowadays we are crippling the real web (or at least it's design) so we can have a version for small screens. Oh the irony :(