Scope of Mobile Apps with JavaScript and the Node.js Ecosystem

Scope of Mobile Apps with JavaScript and the Node.js Ecosystem

Over the past few years, Node.js has grown to be widely popular for developing web applications. The primary reason for this is that it enables front-end developers to write server-side code using JavaScript. Some of the potential benefits of this are smaller development teams and faster development cycles, in part because it's no longer necessary to maintain separate teams of back-end and front-end developers. However, equally important to the rise of Node.js has been the ecosystem that developed around it and its package manager, npm. Currently there are over 110,000 and counting free modules in the npm respository. This means that, in many cases, development teams can leverage pre-built libraries to help them develop their applications more rapidly.In this article, I'll discuss the current state of bringing Node.js to mobile, the benefits that Node.js would bring on mobile and a new, potential solution to enabling Node.js development for mobile apps.

What About Mobile Apps?

What if you want to create a mobile version of your web application? Of course, Node.js will work just as well for building a responsive web application, but, in many case, you'll want an installable application iOS, Android and potentially Windows that can take advantage of the app marketplaces. Today, you can achieve this by keeping all of the application's business logic on the server. In this case, the mobile application would simply be the user interface, written in the native language or using a hybrid solution like Cordova (aka PhoneGap). This user interface would get data and perform business logic via calls to a server side API. If mobile app requires portions of the business logic, it'd have to be rewritten in objective-C for iOS and Java for Android. While Cordova offers a solution for some code reuse, it cannot leverage Node or its ecosystem directly.

What Kept Node from Running on Mobile

Technically, you can run Node on Android, but not iOS. This is because Node uses Google's V8 JavaScript engine. The V8 engine compiles JavaScript to a native code before executing it, a process known as Just-In-Time (JIT) compiling. iOS does not allow JIT compiling unless the device is jailbroken which why Node applications cannot be deployed native on iOS. Obviously, any mobile strategy that ignores iOS is doomed to fail.

Why Do I Need Node on Mobile?

Some mobile developers may wonder why they would need Node in developing mobile apps. They might say they have everything they need in platforms like Titanium or PhoneGap. Here are a few reasons: Node has the fastest growing ecosystem with well over 110,000 free JavaScript modules. Tapping into this resource can help you to develop apps faster and more efficiently. Use the same platform to develop your Server and Mobile apps. Many times your mobile app will have a corresponding browser based application for desktop access. Having one platform and one codebase for both the browser and mobile applications can make the development process far more efficient.

The JXCore Project

Recently, a project named JXCore announced that it will now be open source under the liberal MIT license. One of the key features in the recent release was the ability to run Node.js applications on mobile, both Android and iOS, while leveraging the full Node.js ecosystem on npm.

One of the ways the project achieves this is by supporting a multiengine architecture that allows developers to select which JavaScript engine to use, SpiderMonkey or V8, depending on the platform. The main advantage of the SpiderMonkey engine, in this case, is that it can be executed in Interpreter mode, which is accepted on both iOS and Windows platforms. The net result is that it allows Node.js developers to build a Node application for the server using the V8 engine in JIT mode while also moving part or all of their business logic to the mobile application using SpiderMonkey. While the project's creator, Nubisa, says that the current version is still "in development," it is currently available on GitHub.

What's Next?

The ability to run Node applications on mobile devices offers a lot of potential for JavaScript and mobile developers, opening up the whole Node ecosystem and its modules.The ability to swap JavaScript engines in Node could offer some fascinating other possibilities, such as making it possible to add other engines. This could allow the potential for embedding a light-weight JavaScript engine, like Duktape for example, that could allow the development of applications suitable for the Internet of Things (IoT) using Node.

Shahriar Kabir

要查看或添加评论,请登录

Shahriar Kabir的更多文章

  • 10 Simple Health Habits That Can Change Your Life

    10 Simple Health Habits That Can Change Your Life

    Introduction Living a healthy lifestyle can be difficult, especially when you are busy or have a hectic schedule…

  • What Is a Portfolio Website and Why You Need It?

    What Is a Portfolio Website and Why You Need It?

    A portfolio website is the ultimate way to showcase your work and let others reach out for you. It is your bread and…

  • Toptal - Promising Freelancing Platform

    Toptal - Promising Freelancing Platform

    There are several freelancing platforms out there with employment options. According to me, Toptal stands out amongst…

  • Java | Benefits of using it

    Java | Benefits of using it

    Java has increased huge prominence since it initially showed up. Its quick rising and wide acknowledgment can be…

  • Internet of Things (IoT)

    Internet of Things (IoT)

    When we talk about the next big thing we never think big enough. This doesn’t account for the lack of our imagination…

  • Go Programming Language

    Go Programming Language

    Go Programming Language | Shahriar Kabir Go, a Google-created open source dialect proposed to concentrate on…

  • SQL Server 2016

    SQL Server 2016

    Microsoft has discharged an open beta of SQL Server 2016 with better information investigation and enhanced execution…

    3 条评论
  • Demanding Programming Languages For 2015

    Demanding Programming Languages For 2015

    Java: Java is seen as the programming language of choice for IoT, enterprise architecture, and cloud computing. Java is…

  • Edge - Microsoft’s New Browser

    Edge - Microsoft’s New Browser

    Edge is Microsoft's new browser and it is an endeavor to break with the past that Microsoft constructed for itself and…

    2 条评论
  • Azure App Service

    Azure App Service

    Microsoft has propelled another cloud-based administration for Azure that gives a solitary support of building portable…

社区洞察

其他会员也浏览了