Use Vue.js to develop native applications, choose Weex or NativeScript?

Vue.js is a great framework! It has a friendly learning curve and combines the best of React's component approach with Angular's templating. Nonetheless, Vue.js still has a limitation, it is not yet like React Native, Vue.js currently does not have a stable, widely adopted method to develop native applications.

However, that will definitely change! There are two frameworks currently in development that can open the door to creating native applications with the Vue.js framework, and we all love: Weex and NativeScript. In this article, we'll compare the two frameworks and make you feel like they're interesting enough to at least try one of them!

Weex

Weex is a project created by Chinese e-commerce giant Alibaba. Its slogan is "write once, run anywhere", which means you can use the exact same codebase to build websites (HTML5), apps for Android and iOS. There are currently several Weex production projects and potentially millions of users in China. The core of Weex is under active development, with weekly PRs. Weex has some components and plugins that interact natively with the platform, as well as a somewhat crude set of tools.

Unfortunately, Weex developers don't think making the platform usable is a priority for the open source community. Make sure the documentation, github, etc, something is getting better, Weex is under the Apache Incubator (ASF). But... there is no clear way to build a Weex project from scratch native code is not subject to a lot of hacking. Also, forgot to speak English in the official gitter channel ( https://gitter.im/weexteam/cn)…

NativeScript

In April, Igor Randjelovic opened up another possibility, using Vue and NativeScript. Nativescript-Vue ( https://github.com/rigor789/nativescript-vue) is a NativeScript plugin, a bridge between Vue.js virtual DOM and NativeScript components, allowing you to build cross-platform applications with Vue.js . Although this project is still in its early stages and not very suitable for production applications, it has a lot of potential as it leverages all the tools, components and plugins of the NativeScript framework, the huge number of libraries available. With WebPack, you can even use .Vue single-file components (see this template https://github.com/tralves/nativescript-vue-webpack-template).

The community is great and very supportive! If you participate in the official Slack, you will find many friendly people willing to help, including the developers on the NativeScript core team, the creators of NativeScript Vue, and others involved in the project. Someone wants to do more work for Nativescript-vue!

Overview of pros and cons

Summarizing the pros and cons of each framework, I think:

  • Weex:
  1. Already used in production environment (though only in China);
  2. Builds available for web, Android and iOS;
  3. good community;
  4. The tools are still a bit rudimentary;
  5. no clear path to know how to start a project;
  • NativeScript Vue:
  1. Great community!
  2. All NativeScript platforms are available;
  3. Not ready for user production environment;
  4. Currently only user builds for Android and iOS (although someone shares code in web builds);

final verdict

In open source projects, community trumps technology. Weex has been around for a few months and is backed by a large company, but we haven't seen anything that has made big strides in the community. On the other hand, NativeScript + Vue has been getting more and more attention. Of course, there are some rough spots, but once they clear things up, we'll have a solid framework for developing native apps using Vue.js.

我赌NativeScript!

Link

Weex

  1. Official website: http://weex.incubator.apache.org/
  2. How about Weex: https://hackernoon.com/how-to-create-a-weex-vue2-project-6b94981bee4e
  3. List of apps built with Weex: https://github.com/tralves/weex-todo-list

NativeScript + Vue.js

  1. NativeScript Vue:https://github.com/rigor789/nativescript-vue
  2. NativeScript Vue:https://www.nativescript.org/blog/a-new-vue-for-nativescript
  3. NativeScript's slack channel: http://developer.telerik.com/wp-login.php?action=slack-invitation
  4. NS + Vue template: https://github.com/tralves/nativescript-vue-template
  5. NS + Vue template with webpack (ready for .vue single file components): https://github.com/tralves/nativescript-vue-webpack-template

Hmm... how do you know this stuff?

I have been using Weex. Some of the experiments I did, built a demo program, walked through videos, wrote articles, presented Weex's local events, etc. Then, I boarded the Nativescript Vue train! I also wrote a stupid app, won a competition, and built a couple of templates to smooth out the startup process.

Share a Vue.js 2 family bucket series tutorial:

1. vue.js 2 entry and improvement: http://xc.hubwiz.com/course/vue.js

2. Getting started and improving vuex 2: http://xc.hubwiz.com/course/vuex

3. Getting started and improving vue-router 2: http://xc.hubwiz.com/course/vuerouter

4. vue.js 2 + webpack engineering practice: http://xc.hubwiz.com/course/vuegch

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324413672&siteId=291194637