4 ms·
Preface: I am a dinosaur. I know I'm a dinosaur, with a tiny dinosaur brain. But I couldn't help but wonder as I read this whether much of the complexity of th
by krapp 9y ago
Preface: I am a dinosaur. I know I'm a dinosaur, with a tiny dinosaur brain.
But I couldn't help but wonder as I read this whether much of the complexity of the JS ecosystem isn't a consequence of the fact that whatever Node.js uses isn't really javascript. It's apparently a fork of javascript that has includes and is intended to run natively.
Now, modern javascript packages for the web also use includes because it's part of NPM and the Node ecosystem. And as a result, there has to be a transpiling/build step to convert "Node" javascript to "frontend" javascript, or some other language to frontend javascript.
But, to me, includes shouldn't be part of the "code", because they aren't really part of the language - that should be separated to the packaging directives and handled entirely by the package manager. Javascript package management meant for the web would just pull in javascript, maybe minify it, and dump it into a file. No need for transpiling, building or webpacking.
Although I suppose you could if you wanted to, but that should be the exception, not the norm. But, no. We have to have a million packages written in pseudo-js or typescript or coffeescript with a single function each and a separate test suite and build step for each.
I appreciate that the modern JS ecosystem works, and works well for many people, but... I still feel like it doesn't need to be as complicated as it is. It could be much, much simpler and still be better than just pasting in script tags. Not that there's anything wrong with that. In the end, that's what happens anyway.
Sometimes the ways of the warmbloods confuse and infuriate me.
- natecavanaugh 9y agoI'm the same kinda dinosaur, but I have to disagree with the following: > Now, modern javascript packages for the web also use includes because it's part of NPM and the Node ecosystem. And as a result, there has to be a transpiling/build step to convert "Node" javascript to "frontend" javascript, or some other language to frontend javascript. At first, I would agree, but with ES2015+ the import system isn't too different or at least shares a lot with CommonJS. Since that's the future of JS modularization, I think it's important to embrace it. However, there is one area where the TC39 committee, along with browser vendors/Node, really messed up is the releasing of the module system with so much undefined or all over the place. For example, the lack of a bundling strategy. Every person I've talked to about this has just said "oh, http2 will take care of it". Really? Even if http2 supports multiple connections, there will either need to be multiple round-trips to the server for further dependencies (which, physics puts a limit on the speed that can happen at), or you need to calculate on the server and send over what's needed. So I think these module bundlers are essentially doing that at build time (which sucks for runtime dynamic inclusion of resources). Then there's the whole .mjs fiasco with Node. Since committees are so often slow to update (for valid reasons, many times), and miss many valid use cases, I think the new world of frontend development will include some sort of tooling like this. It should, God willing, start to simplify (maybe kind of like how npm scripts are becoming more preferred to gulp and the like).