7 ms·
I don't really see the size of it all, or the dependency count, as a problem considering what Electron+React are doing. It's a modern framework with its bundler
by onion2k 5y ago
I don't really see the size of it all, or the dependency count, as a problem considering what Electron+React are doing. It's a modern framework with its bundler, plus a browser engine with a bunch of wrappers for interacting with different OSs, and all the tooling necessary to build apps for Windows, OSX and Linux. That's akin to downloading the salient parts of Xcode, Visual Studio, and gcc and complaining about how many dependencies they're all built on. That probably runs into the tens of thousands. Modern software has many moving parts.
The wall of warnings, deprecations, messages, errors you can apparently ignore (fsevents and iltorb, I'm looking at you) is the real issue for me. I want confidence in what I build, and NPM does not give me very much at all. I'd be fine downloading 1861 packages if they all worked together properly without telling me there might be problems.
PS Colin - I think we've met a few times in the Town Wall long before lockdown. Hello from the other person on HN in the NE. :)
- the_duke 5y agoThat's not necessarily a good comparison. Electron comes as a binary, so it already has all its own hundreds of dependencies integrated. The dependency hell wit JS projects is real, and upgrading can become a major timesink and pain if you are not maintaining and upgrading the project constantly.
- krono 5y agoThere also exists a surprising amount of ridiculously unnecessary packages that many worthwhile ones depend on. One such example is `is-odd` that is hovering around 500k weekly downloads https://www.npmjs.com/package/is-odd https://www.npmjs.com/package/is-odd
- pb82 5y agoIt's even worse in this case. Following the Github link, you'll get to an archived repository inside an org that the author created as a joke. In his own words: 'This is a joke. You'll only see this org if you are attempting to troll me about repositories I created when I was learning to program.' It got in there and is now part of the foundation of tons of other projects. Maybe it doesn't matter but at the very least this ecosystem seems very immature (in the psychological sense).
- 2muchcoffeeman 5y agoThere was a lot of discussion about this when left pad broke the internet. One of the arguments for it was that it’s easier to reason about what a one line module does. Until you have 2000 of them and can no longer reason what the system does or what the interactions between them are.
- bellyfullofbac 5y agoOn that page there's a related project called is-even . I pray for maximum laughs that is-even depends on is-odd, and just negates the return value of is-odd... Edit: it actually does! Hah! https://github.com/i-voted-for-trump/is-even/blob/master/index.js https://github.com/i-voted-for-trump/is-even/blob/master/ind...
- nemetroid 5y agoWhat definition of ”dependency” are you using to estimate that GCC has tens of thousands?
- jcelerier 5y agoI guess any individual function defined outside of main() can be considered a dependency, the question is just whether it's you or someone else who's in charge of maintaining it
- z3t4 5y agoYou are correct that in Node.JS a module is just a function that can be re-used in more than one app. But as making a module is the only way to separate your code into several files and folders in Node.JS - Node.js developers also make "modules" that can not be re-used in other apps - so while one app depends on them, other apps can't depend on them and they are not published on the NPM registry... One cool thing about Node.JS modules is that you can import/require them inside main! So whether or not a function is in main or not only says how the developer likes to structure/place the functions. It's rare, but the best programmers I know likes to have all "dependencies" inside the same file - so basically they do not use any dependencies ...
- orwin 5y ago> I guess any individual function defined outside of main() can be considered a dependency No its not. I don't think even people naming their object list "DEPS" in their makefile don't think object files are dependencies.
- onion2k 5y agogcc alone doesn't. xCode, Visual Studio, and gcc probably do. Although I don't really know that for sure.
- nemetroid 5y agoOkay, but still thousands for gcc then?
- ColinEberhardt 5y ago> Hello from the other person on HN in the NE. Oh wow, small world! Looking forwards to returning to the Town Wall at some point in the future.
- danielheath 5y agoDependency count isn’t a good measure because different ecosystems have different default sizes to split something out. Number of unique maintainers, on the other hand, is more consistent across languages and represents a real risk re supply chain safety, since compromising any maintainer is a route to a hack.
- hsn915 5y agoIt's a huge problem because when you consider what it's really doing (what people want from it) it's not much. All people want from Electron is a GUI system that works on all platforms. In theory there are several libraries that do that but they lack the features people want (QT, GTK). In a sane world, it will be a single dependency: the GUI library. You have to be careful when you consider what the system is doing before you justify its complexity. It might be doing a lot of useless work. For example, what does webpack do? esbuild has proved that webpack is useless and spends its time doing useless work. Bundling with esbuild takes a fraction of a fraction of a second, where as webpack can take anywhere from 30 seconds to several minutes. Yea, it's doing "work", but it's not the work you actually want to do. All people really want from Electron is the render engine from Chromium and the V8 JS engine, but without the sandbox, so that it can access the file system and do a few other things. How many of these hundreds of dependencies are contributing to that end? Very very few, if any. The "modern" web frontend development environment is really bad. Making excuses for it does not help.
- z3t4 5y agoChromium also comes with a lot of API's, for example webGL and WebRTC.
- junon 5y ago> All people want from Electron is a GUI system that works on all platforms No. What those people want is web tech as a GUI library. That's two very different things. A cross-platform GUI library with good customization and theming options and support for custom controls that isn't reliant on the (Google) Web Specs (w3c) is what's really missing from the ecosystem.
- native_samples 5y agoJavaFX meets that requirement. A GUI app that uses JavaFX requires exactly one dependency: the GUI library itself (OK, JavaFX is split into a few different modules). Often you'll add a few open source helpers, e.g. if you want a Material Design theme.