Allowing support of the NodeJS frameowrk would allow access to a whole world of existing javascript modules and would in my opinion make fuse a more desirable platform for other developers considering developing javascript based apps.
We are not going to do this officially (at least right now). Node is made for the server and it’s a lot in there that never will work on mobile. But we are going to help start an open source effort for something like this. Sometimes you need a web/browser shim and sometimes you need a NodeJS shim. So we will try to give you all the most common low level stuff so this will be possible through FuseJS. And FuseJS will also aim to have all the mobile spesific stuff you don’t find in browsers and Node.
You will probably notice some changes regarding this soon. The first is probably that the browser polyfills we already have in there, will become an optional package. So it will be easier to have a clean environment when you want Node stuff.
Hi Anders, Thanks for you quick response and ideas of where you are heading.
I appreciate that there is a lot of Node that is not suitable for mobile. What nativescript do is basically use the NPM as a means of packaging and accessing javascript resources.
You will always have to look at the specifics of the node package to see what it is designed to achieve. For example cordova/phonegap has moved to NPM.
Having a common packaging solution makes it a lot easier for people to create and use existing functionality.
Thanks Again Peter
I can’t agree more with Peter.
What does Peter mean by support “NodeJS”, nodejs works with Fuse, NodeJS is a platform for the backend. Now NPM is different, but it will be confusing to newbies who are just starting to learn javascript through fuse. So please don’t say NodeJS and just say NPM since you are talking about the modules of Node.
Now as far as supporting NPM most of the packages on there should work as long as they don’t do anything node/browser specific like underscore/lodash should work in Fuse. (I don’t use those so I don’t know).
The reason they should work is because the way Fuse handles js. Fuse does the same thing Node does with js
Exporting through module.exports
, using require()
to import a module. So as long as they do those things and don’t do anything platform specific they should work.
Edwin Yes you’re correct. I’m talking about fuse supporting npm and allowing access to a massive collection of modules. Peter
Peter Roden: You can sort of use npm with fuse already, and in we are adding even more convenience to streamline interop with npm. More info will be quite visible on our website when it launches.
This does however NOT mean that all node modules will just work, as Anders Bondehagen pointed out above, a lot of the modules only make sense on a server, or depend on other modules that do.
Interesting Anders
When is the npm support due to launch and how will I know when it does?
cheers Peter
We are working on this right now, so if no blockers shows up, you should see something soon. We will definately highlight this. I will make sure you will be notified in some way Peter.
Just use Node as the backend, it’s really simple.