Relation between Node.js and FireFox - node.js

I knew that node.js based on V8 Javascript engine of Google Chrome.
And I want to know If Node.js can run on FireFox ,then how?
What version of firefox support V8 javascript Engine or Node.js?

You are mixing up JS Engine and browser.
V8 is the JS Engine of Google Chrome (also used by Chromium, MongoDB among others).
SpiderMonkey is the JS Engine of Firefox (also used by GNOME and Adobe as examples).
Chakra is Microsoft's JS Engine, by Internet Explorer, old Edge (new one is Chromium based, and as such use V8) and some other Microsoft projects.
Node.js is based on V8, which you confuse with Google Chrome. They use the same JS Engine, but you don't need any part of Chrome itself to use Node.js.
There has been project to port node.js to SpiderMonkey, like SpiderNode or JXcore, but aren't actively developed anymore.
On the other side, Microsoft had worked on making node-chakracore. It has been archived at the end of 2019. It even had some really interesting options on it (Reverse Time Travel for example).

Related

What are uv and v8 in nodeJS

There are 2 directories uv and v8 in deps folder
First question : what is the definition of deps directory?
My second question: What are uv and v8 utilities in Node.js?
To add a bit more detail:
libuv is a library for asynchronous I/O, originally developed for Node.js, and by now also used by a number of other projects. See https://github.com/libuv/libuv.
V8 is the JavaScript engine that powers Google Chrome, other Chromium-derived browsers (Opera, Yandex Browser, the Android versions of Firefox Focus and Microsoft Edge, and a bunch of others), CEF-derived desktop software (GitHub's Atom, Microsoft's Visual Studio Code, Valve's Steam, and others), Node.js, and many other embedding applications. See https://developers.google.com/v8/.
deps or dependencies: that contains things that are built outside of nodejs but are a part of node js.
UV and V8 are C++ dependencies for node JS

Can expressjs be faster if I compile it?

There are tools that help us now to compile or node.js apps into executable such as "pkg". But I am interested If this can improve a web server written in expressjs?
No, web servers based on the Express framework will always require running on the V8 JavaScript engine of Node.js, which is also used by the Google Chrome browser.
You cannot compile a JavaScript program to machine code and run it standalone, like you can with programs written in C++.
If you create an executable program with JavaScript, for example using Electron, it's actually just a modified Chrome browser that runs the JavaScript, so the JavaScript is not actually compiled, it is still code interpreted by the modified Chrome's V8 engine at runtime.
Chrome and its V8 engine are written in C++ and compiled to machine code, so they can be run standalone.

JXcore vs Electron

question
I am wondering what the main differences are between Electron and JXcore.
background
I was thinking about how I could make a NodeJS server into an app and I came across both of these. They seem to do the same thing, except that JXcore supports mobile and Electron doesn't.
side question
If Electron doesn't support mobile then how was the slack mobile app created?
Thanks in advance!
From the JXCore site(http://jxcore.com/tech/):
JXcore is a fork on the open source Node.js project
It uses LLVM to compile javascript as opposed to V8 which NodeJS does.
In terms of what are the main differences- Electron is a framework for building native, cross platform desktop applications, where it appears JXCore is a javascript engine forked from NodeJS.
Electron is built with NodeJS, and Chromium. So to make it fair, the comparison would be better stated "How does Electron work with NodeJS vs JXcore". Since I don't have any experience with JXCore, I can't answer that question. I would venture to say the only way to know that is to fork electron and replace Node with JXCore.
Based on your background, I would assume you are thinking about making one application that works cross platform across mobile and desktop environments. To that, I would say it is possible, but you are going to have 2 different projects. There are things in Electron that you wouldn't want included in your mobile app, since they are working with completely different operating systems. You are right that electron does not support mobile (it wasn't built for that).
As far as your side question goes, there are any number of technologies that slack could have used to create their mobile app. They could have used Java , Swift, Objective-C, .NET, Ruby, or Javascript.
There are cross platform tools such as RubyMotion, NativeScript, React Native, and Xamarin that could also be used to create native mobile apps, that all compile down into the native language the mobile OS understands.
A final approach could be the use of tools such as Cordova/Phonegap which create mobile apps via a "web view". Essentially, this is like creating an app that launches a web browser to interact with your phone.
If you are looking for an example on how to build once and use everywhere, I would look at the github repo found here https://github.com/NathanWalker/angular-seed-advanced. This shows a common codebase that can be used in Electron, Web, and Mobile.

What is the browser engine used by HTML5/Javascript Universal Apps in Windows 10?

In Windows 10, it is possible to create Universal Apps using HTML5 and Javascript (as an alternative to C#/XAML).
I'm wondering which browser engine is used to execute those apps. Is it the engine of the Edge browser? Or IE 11? Or something different?
Knowing the engine would make it easier to check for compatibility of frameworks and Javascript features.
Yes, JavaScript/HTML5/CSS3 is native to the Windows Universal Platform.
Here is a very first tutorial :
Create a "Hello, world" app (JS) (archive)
Microsoft Edge and the Universal Windows Platform share the same core components, mainly Chakra (The JavaScript engine) and EdgeHTML (The HTML/CSS rendering engine). You'll get more details here :
Using Chakra for Scripting Applications across Windows 10 (archive)

Cross-Browser Extensions API?

There are tools for developing cross-platform browser plugins.
Are there any similar tools or APIs for browser extensions (i.e. toolbars, or filter systems like AdBlock)?
Yes, but unfortunately each one has significant drawbacks.
Kynetx supports IE, Firefox, Safari, and Chrome, but extensions are dependent on the Kynetx extension to work. In addition, Kynetx apps are built using an odd, proprietary Kynetx Rules Language. There is no cost to use the Kynetx platform. UPDATE: Kynetx has shut down
WebMynd supports IE, Firefox, Safari, Chrome, and is in private beta. From what I have been able to determine, WebMynd is a very small San Francisco-based startup that is still getting off the ground. Their library is standalone and provides a Javascript API, and they use a monthly billing model. UPDATE: company pivoted, now for mobile, trigger.io
Crossrider supports IE, Firefox, Chrome and Safari. Recently out of beta (as of June 2012), Crossrider is free and offers a jQuery-based development experience. Publishing methods for your extensions include an embeddable website widget, download links, and a customized windows installer. However, CrossRider does not allow you to self-host your plugin files. UPDATE: As of 27.09.2016, CrossRider is terminated and it will be available only until 27.10.2016.
KangoExtensions supports IE, Firefox, Chrome, Safari, Opera. Seems very new and bleeding edge, like Crossrider, also looks promising. UPDATE: No updates in over two years.
IE and Firefox seem to be the hardest to develop for, although Mozilla JetPack aims to greatly simplify Firefox extension development.
There is also very young framework for cross-browser development called BabelExt, from the author of Reddit Enhancement Suite. I like that it builds restartless Jetpacks for Firefox.
See more on github, https://github.com/honestbleeps/BabelExt
Mozilla has recently introduced WebExtensions API. For now it's actually almost a copy of Chrome Extension API (but some APIs aren't implemented yet). It has been introduced just a few days ago so it still has a lot of problems and unsupported APIs. But if you're interested in writing extensions for Chrome, Opera and Firefox you should pay attention to the state of WebExtensions API.
UPD 27.10.16. There is a page Are-we-WebExtensions-Yet which summarises the current state of WebExtensions. By their current estimate 44.99% extensions from Chrome store should work in Firefox.
ExtensionMaker is another one project related to cross browser extensions development. It is not a real framework. It is kinda IDE that allows you to design basic extensions.
Of course, it is not suitable for a serious projects. But I like the idea.
Full featured version is available for free. There is just small limitations on the way of using generated extensions.
Yes, the browser extensions development company has a framework-one code for all browser views

Resources