4 ms·
I have, but you glossed over my point. What's wrong with a compatibility layer with npm if it's implemented properly? His views on package.json and implementi
by MrOwnPut 4y ago
I have, but you glossed over my point.
What's wrong with a compatibility layer with npm if it's implemented properly?
His views on package.json and implementing a compatibility layer to help others transition from node are not mutually exclusive.
The support for node is pretty simple. Using NPM packages is straight forward. Reading a package.json file and using those mappings isn't complex either. Deno does not use node_modules in any of those instances...
- joshmanders 4y agoHis point was that the mere ability was the issue, not some implementation. This is why Deno has gone so long without a true package manager. The problem here is now they're fighting for adoption so they're going against their original values because they know what they wanted isn't what the broader community wants.
- MrOwnPut 4y ago> His point was that the mere ability was the issue Can you elaborate? > so they're going against their original values because they know what they wanted isn't what the broader community wants. No, they are still sticking to everything, but added support for the existing ecosystem. Yes they are adding this to combat the network effect that node has, but it doesn't really go against anything. You simply prefix npm in front of npm imports. Now you could use a package.json file if you already have one, but you don't have to.
- tsimionescu 4y agoNo. They are adding "deno:package@version" native imports, and they are adding a deno.json file to specify them. They are adding dependency resolution logic for these native deno packages to deno itself. The fact that all this interoperates with NPM as well is just an added bonus. But even if NPM died tomorrow, deno would go on having a package system, because they have realized how important it actually is (to fix things like what they call the "duplicate dependency problem").
- MrOwnPut 4y agoYes and that is nice, it'll allow future import map support, like in the browser, which is inline with Deno's goal of using browser APIs instead of proprietary ones. But the package.json format part is a backwards compatibility feature. The preferred import maps will be the ideal solution (if you do need dependency management). None of that really goes against direct imports, which work well for single file scripts, workers, etc. Choose what fits.
- hbn 4y agoThe blog post didn't make it sound like this was implemented just for the sake of backwards compatibility, it sounds more like an admission that Deno's take on package management isn't a superior solution to how Node did it before.
- MrOwnPut 4y agoCould you point out a few things in the blog that made it sound that way to you? It states many times it was added for backwards compatibility. Even at the bottom of TFA they annotate the ideal solution (which will be implemented soon) is to use import maps instead of package.json, the same format the browser uses, which is in line with Deno's main goals.
- tsimionescu 4y agoYou're ignoring the fact that, originally, deno wanted to eschew the concept of an import map entirely. They weren't against the format of package.json itself, or even against the fact that it's not a web standard. They were against the idea of having to specify imports sepeartely from your code, and against the idea of bundling multiple files into a concept of a module. Fast forward a few years, and they are now adding these two things natively to deno, just as the web ecosystem did. Turns out, Node was right to have modules and an import file all along, and at worst there were some minor implementation quibbles to argue about.
- MrOwnPut 4y agoPersonally I don't really care about the faux drama. I'm glad I can use direct url imports in simple Deno scripts. I also see the need for import maps for larger projects. I do think node_modules is an abomination and glad I don't have to deal with them anymore. I prefer writing everything that works in Deno and the browser, not Node specific APIs. I like the tech, I don't really care about the drama, and I doubt the Ryan does either lol.
- tsimionescu 4y ago