Node.js Compiler – Compiling your Node.js application into a single executable
github.com
github.com
What I'm looking forward to is lightweight electron that will allow us to use the native browser-engine for each platform.
QT/GTK for Linux, WebkitView for macOS, Edge for Windows.
Hope the effort of node-compiler, zeit/pkg will be beneficial for the future of desktop apps.
Leveraging existing OS engine will reduce file size but at the cost of not having a stable and known platform that your code will run on.
Having all those polyfills / babel / webpack tools you can be quite safe about your app.
Nevertheless having a nice test suite also makes a benefit.
Besides what's the point when most people would only use just a few Electron apps anyway.
App developers also have to ask users to download versions between this and that system library only causing confusions for users.
https://github.com/bloomberg/chromium.bb
https://github.com/weolar/miniblink49
The latter is around 9MB. The author is working on a electron wrapper.
Blink is a fork of webkit, by your logic, most softwares based on webkit can not execute javascript???
This information is readily available on, e.g. Wikipedia, so I'm not sure why you even try to argue about it.
Node.js doesn't include Blink, it only includes V8. Node.js Compiler doesn't include Blink into the build result — it includes Node.js.
50MB is nothing and if it enables you do have a single standalone binary that you're easily able to deploy I'd say it's worth the extra disk use.
https://hub.docker.com/r/library/node/tags/
Regular images are ~260MB and "slim" images are 85MB, but Alpine-based images are a paltry 18MB.
So it seems something in the Node.js compiler is ballooning up the size of the code, by a factor of about three. I wonder what.
Who likes to download Java on desktop anyway? It's absolutely the wrong way to distribute Electron apps.
It's so annoying for App developers that they have to ask what version of shared Electron the user has and install that for themselves and debug instead of just be done with it with the exact version developers tested and distributed.
[1] http://www.syntaxsuccess.com/viewarticle/closure-compiler-vs...
And then one could probably go even deeper in search of performance and instead of compiling JS to JS, compile it to C or even straight to native CPU assembly.
> Pkg hacked fs.* API's dynamically in order to access in-package files, whereas Node.js Compiler leaves them alone and instead works on a deeper level via libsquash. Pkg uses JSON to store in-package files while Node.js Compiler uses the more sophisticated and widely used SquashFS as its data structure.
I'm not sure why Facebook decided to stop maintaining hiphop. Perhaps manageability wasn't great.
Edit: IncludeOS does not offer thread support, so it's unclear how the GC of the JS VM is supposed to run.
[0] Compiler is just a program that transforms code from one representation to another.
http://www.damnlol.com/the-adventures-of-technically-correct...
First install the prerequisites:
SquashFS Tools 4.3
Python 2.6 or 2.7
Visual Studio 2015 Update 3, all editions including the
Community edition (remember to select "Common Tools for
Visual C++ 2015" feature during installation).
Why not just Node.js and Git for Windows as requirements? Python 2 and a specific VS version, really? Is using npm command to get further packages too uncool?As someone who has spent a lot of time with npm (not even as a webdev), it appears to solve all of my common use cases while also dealing impressively well with various versions of specific dependencies. (Like, A depends on B@0.0.1, C depends on B@0.0.2, etc.)
Node module syntax is non standard and can't be tree shaken, with a little more forethought it could have been designed to support static analysis and they wouldn't have needed to reinvent the module syntax for ES6. You can't reliably tell if a piece of code is using a given package until you run it.
The dependency resolution sucks. It's better now that they finally made it so nested dependencies aren't duplicated, but why the hell do I have to run a manual dedupe command to do so? What that tells me is that npm doesn't actually track dependencies, its hardly more than a fancy file downloading tool.
The repository curation sucks. I'm not sure if you've used Python's package manager, or Java's, or C#'s, or Perls, but npm has zero package curation and is filled to the brim with garbage compared to the others. I have published packages for C# and Java and the semantics are well defined and reasonable, you even cryptographcally sign your code and the system checks to make sure you upload documentation etc... In the case of java, which has the best system I've seen, they even use something similar to DNS validation to make sure you control package namespace.
The above point is the absolute worst thing about npm and drawfs the other problems. Let me give an example by pasting the package publishing guidelines for Maven(Java) vs npm:
Publishing an npm package: >Use npm publish to publish the package. >Note that everything in the directory will be included unless it is ignored by a local .gitignore or .npmignore file as described in npm-developers. >Also make sure there isn't already a package with the same name, owned by somebody else. >Test: Go to https://npmjs.com/package/<package>. You should see the information for your new package.
I had to condense the Java guidelines but it's roughly this: create JIRA account apply for access review requirements verify namespace ownership generate crypto keys package coordinates/versioning project description URL and license info developer info SCM info package deployment generate binaries revolve package dependencies crypto sign package generate documentation online verification
Sounds like a lot of work right? It takes a few hours to setup and verify your domain/keys the first time but after that all of these steps are automated. The signing/building/doc generation/ deployment is totally automated. Npm is a toy in comparison.
from their docs: Why Do We Have Requirements? In order to ensure a minimum level of quality of the components available in the Central Repository, we have established a number of requirements your deployment components have to meet. This allows your users to find all the relevant details about the components from the metadata provided in the Central Repository. The following sections will detail these requirements.
Left-pad is a perfect example of why npm sucks. Nuget, Maven, Phython, and CPAN would have never let something that stupid happen.
O RLY?
* https://mvnrepository.com/artifact/coldnew/left-pad/1.0.0
* https://www.nuget.org/packages/left-pad/
* https://pypi.python.org/pypi/left-pad/
* http://search.cpan.org/~dagolden/LeftPad-0.003/lib/LeftPad.p... (LeftPad - Why should Node.js have all the fun? - comments on the package)
-- UPDATE
About package removal...
* http://stackoverflow.com/questions/20403387/how-to-remove-a-...
And by date of project creation you can assume that others are parodies too: "LeftPad - Why should Node.js have all the fun?"
I think it's worth noting that with Java at least, besides not allowing package removal, the namespace is tied to a unique identifier with ownership verification, so the cause of the left-pad fiasco (kik wanting his namespace) is extremely unlikely to happen in the first place.
- dynamic require()'s can't be tree-shaken: same is true of other langs, e.g. Python. Perfectly understandable IMO as Node was designed for the server, in a time tree-shaking (largely desirable for front-end code) wasn't a priority. Also it is a standard (CommonJS).
- long pathnames is a Windows only issue and afaik fixed by npm 3's "flattening".
- npm is worse than Maven because 'npm publish' is too easy?
- you don't need to run dedupe.
- you say npm isn't curated but I'm not aware those other registries are curated either?
- 'left-pad is a perfect example of why npm sucks' ... except the ability to delete packages has been fixed, so should that be 'sucked'?
(Edit: how on earth do you format lists correctly on HN?)
Perfect in that it was fixed over a year ago?
Shrinkwrap does have known issues (mainly w.r.t. platform-specific modules and verbosity), though I've never had any problems with it, but if you want a better lockfile I suggest the Yarn client.
(Believe Python's pip behaves similarly to npm in that issue).
I prefer Yarn's lockfile handling, but saying npm is 'broken by design' is wrong.
And yes, Yarn is the sane option for package management for Node. Why isn't it the default one yet?
If you're taking about deployments, that's definitely unusual. Outside of deployments, what's a scenario where deterministic builds are important, but it would be considered normal to manually install them anyways?
Great, then you should be able to mention at least one solid normal usecase as an example. I don't think there is one.
NPM has issues but most criticism of it is really complaints about bad dev practices (like not pinning versions correctly).
There are literally no worse major package managers.
A good package manager can be misused and still work reasonably well; a bad one doesn't even work all that well when used correctly.
https://github.com/npm/npm/issues/9633
I especially like the part where it says "This is most likely not a problem with npm itself", even though it clearly is a problem with npm itself (as evidenced by non-deterministic nature of the bug).
Again, bad dev practice.