June 08, 2020
By Jaime Bernardo
In our ongoing quest to improve Node.js for Mobile Apps (a.k.a Node.js Mobile), we have just completed a series of major improvements and made them available in the latest release. Of course, in delivering these improvements, we have paid close attention to the desires and feedback of our valued users, as always.
Probably the most noteworthy update is the use of the V8 JavaScript engine on iOS. This replaces the ChakraCore engine that was used previously on Apple devices. With this update, Node.js relies on the same engine on both Android and iOS, ensuring consistent behavior and reliability across all devices.
Previously, when we used V8 on Android and ChakraCore on iOS, some specific code cases behaved differently due to implementation differences between the two engines. Some APIs were available on one platform and not the other. These issues are now eliminated.
The use of V8 on iOS was made possible by the engine now supporting a JIT-less mode, since its 7.4 release.
The latest release is based on Node.js 12.16 LTS (Long Term Support), and has all of the latest security fixes patched into the software. Node.js 12 is the active LTS version, until Node.js 14 enters LTS on Oct. 20, 2020.
This also offers access to more recent APIs, such as 'worker_threads', which make it possible to run JavaScript on more than one thread. This is an innovation that has been strongly desired among the Node.js Mobile community, and we're delighted that we can deliver it as required.
There is also ES6 JavaScript module support included, and the system now contains a more recent N-API version, which ensures improved module compatibility.
The Node.js Mobile codebase is now rebased on the main Node.js repository instead of node-chakracore. This will make it easier to keep up to date with future LTS versions and security vulnerability fixes.
The new release has been built with V8 snapshots for the Android version. Since V8 and Node.js internal JavaScript code are pre-initialized to be directly loaded into the heap, faster startup and run times are possible. Users on our community channel have reported application launch time reductions of 50%.
The challenge in building Node.js Mobile with snapshots was the cross-compiling of V8 and Node.js, while also having to build the snapshots to run on a different OS and CPU architecture.
With this recent release, Node.js Mobile is more powerful than ever. Check out the new changes, and we would love to know what you think!
Interested in exploring the possibilities of Node.js on mobile devices or Node.js application development? If so, contact our consulting services team to find out how we can help.
Ready to discuss your software engineering needs with our team of experts?