Native UIs using Vue.js and NativeScript
nativescript-vue.org
nativescript-vue.org
Maybe they should build some sample apps before telling others to use the framework.
from what i hear, native script is more native than react native, 100% cross platform from ios and android, and much more performant than React Native.
i can see this becoming a real contender very soon.
Could you elaborate? If true that's amazing!
var context = ...;
var button = new android.widget.Button(context);
button.setText("My Button");
To achieve the same in RN, you have to drop down into Java/Swift/Obj-C and link back to your JavaScript. Same result, different means.See https://docs.nativescript.org/core-concepts/accessing-native...
There are so many ways in which this is inferior to native code. And I say this as someone who works primarily with JavaScript.
Unfortunately though, so many developers do not know how to write in the platforms preferred native language and you end up with components, like most of those listed on awesome-react-native[1], where they're entirely written in JS which:
* sometimes emulate the native look and feel (often poorly), not _are_ the look and feel, and,
* as a result, often perform super poorly compared to their native counterparts, and,
* if emulating the native look and feel, and not implementing their own design/UI (which most do), that look and feel can break between OS upgrades and feel out of place, and,
* often don't distinguish between platforms (i.e. the developer won't bother implementing the look and feel for Android, where the component is entirely compatible).
These apps are about as native as the Java based Eclipse IDE whose SWT based UI uses native GUI elements for display.
So if you want a big grid of items, you're not using a UICollectionView, you're reimplementing it yourself or finding someone else's attempt at that.
Maybe this is because a UICollectionView doesn't have an identical counterpart on Android so it's easier to just redo it from scratch? But I'd be surprised if the performance of these things is as good as the real native ones, even if they make it out of UIViews.
My other big complaint is that it doesn't help you with UI size classes. iOS apps change their layout depending on (generally) whether you're on an iPad (fullscreen / large split), or iPhone (and iPad small split, which is iPhone sized but much taller). The two weird exceptions being the iPad Pro having two full sized splits, and the Plus sized phones acting sort of iPad-like in landscape view.
Anyone have an example of a React Native app that follows those conventions correctly? Last I checked the Facebook app (which I assume is something of a canonical example) doesn't even support split screen, and iOS 9 came out in 2015.
This was a year or so ago that I was poking around at it, things may have improved since then?
The issue with web apps is more about the UI and performance, but I really doubt that the JS VM will kill performance.
When one says truly native, that is an even stronger claim that, in my opinion, directly communicates we are talking about byte code. On iOS, for example, native means Obj-C and Swift. When I read someone has created a framework/library that provides truly native apps using X and Y, my immediate expectation is we are talking about X and Y compiling down to platform-native byte code, with no VM, unless the platform itself is a VM. An example here is Elixir compiling down to truly native BEAM apps.
For the web, JS is truly native. There are a host of other non-JS technologies that compile down to truly native code for the web. I’ve yet to see any JS technologies that compile to truly native platform code for desktop and mobile (except mobile platforms which use web technologies as platform-native code)[0].
[0]: A quick perusal of NativeScript claims it does not use web views. If it actually lets you directly create and use a UITableView, UIButton, UIListView, and the rest, then perhaps it can qualify as native UI. But there’s still a bridge to cross from there to truly native app, and I’m unsure if it actually becomes 100% platform-native code without a JS VM involved the way, for iOS, Obj-C and Swift are.
Absolutely.
I see a difference between this and discussion about transpiling vs compiling. One of the things I appreciate about transpiling is that it is a different word that does not attempt to take a word with established meaning. I obviously don’t think it’s a pointless distinction—but then I don’t find myself bothered by technicalities when it comes to technical things that need clear meanings.
I think the JS community has brought this problem upon itself by trying to lay claim to the word native when talking about web apps or apps built with web technologies for platforms that don’t rely on web stack as core/native tech. If they’d just choose/create a word that doesn’t already have established meaning on the target platform or technical space, I don’t think there’d be disagreement or confusion.
It’s the same thing when people claim Electron apps are native apps. We all know they aren’t really—they’re web apps wrapped up in a native window, relying on a full browser stack and JS VM to do what they do. I think it’s awesome people are working on things like Electron, because it’d be amazing to have an easy toolchain to create cross-platform native apps that is accessible to everyone. But they aren’t going to be native, and definitely can’t claim to be truly native until someone turns it into platform-native code that doesn’t need a VM.
Ultimately, we wouldn’t need to have this discussion if particular words loaded with extant meaning weren’t being misappropriated by the JS community. At least where mobile/desktop platforms are concerned, native means building with and using UI, threading, performance, libraries, APIs, and a whole host of things directly. I don’t look forward to the day where the JS community co-opts the term to the extent the platform-native tech has to start calling itself by some word other than native.
EDIT: Full disclosure—I like native technologies on various platforms, and don’t particularly find myself interested in building mobile/desktop apps in JS, HTML, and CSS.
Yes, it matters. Levels of indirection matter. Doubting performance or not doesn't change the definition of the term which is admittedly ambiguous.
There are two forms of "native" IMO now. There is "system native" which I define as AOT to processor instructions. VMs, even with JITs, don't count (yup, this includes Android's JVM). Then there is "platform native", which I define as AOT-compiled to platform-suggested instructions. This does include Android JVM bytecodes.
This falls under neither. It may not matter what language something is coded in depending upon your requirements, but we shouldn't keep ascribing even more meaning to the term native.
I guess I don't see your point here.
A Java compiler takes Java code and compiles it to JVM opcodes.
Presumably this package (I haven't looked at the details, so could be wrong here) takes JavaScript code and compiles it to JVM opcodes.
I see no prima facie reason to assume that one would be more "performant" than the other. That's the whole idea behind things like LLVM and CLR, right?
[1]: https://duckduckgo.com/?q=nativescript+vue&t=hf&iax=images&i...
This is a showcase for NativeScript in general, but AFAIK what you can do with NS, you can do with NS+Vue.
The one thing I really like about NS is that it give you full access to native platform APIs in JavaScript.
You can also use Angular with NS, which workes much different than Vue.
https://weex.incubator.apache.org/
Not nearly as mature as RN though.