text stringlengths 0 1.32k |
|---|
**Break:** \[00:45\] |
**Adam Stacoviak:** This episode features a small roundtable discussion with Sam Roberts who works on Node Runtimes at IBM, and also Thomas Watson, the Node.js Lead at Opbeat. We talked about keeping Node Core small, what to put in, what to take out, how to deprecate and everything in-between. Listen in! |
\* \* \* |
**Adam Stacoviak:** So let's talk about keeping Node small. You have some opinions, and we're sitting here with Sam... |
**Sam Roberts:** Sam Roberts, yeah. |
**Adam Stacoviak:** Sam Roberts from IBM, and Thomas Watson from Opbeat, two Node developers. Either of you have core contributions into Node Core? |
**Sam Roberts:** Yes. |
**Thomas Watson:** Nothing, really. |
**Adam Stacoviak:** Nothing really, but you've taught a lot of people about Node and you're an evangelist... |
**Thomas Watson:** I'm a heavy user of Node, I've been many years, and I'm part of the Diagnostics Working Group. I work with Node Core, but I haven't yet contributed. |
**Adam Stacoviak:** Okay. So when we talk about keeping Node Core small, what comes in mind for you, Thomas? |
**Thomas Watson:** It's about what goes in Core and what doesn't go in Core, and feature upload. Or let me say it in another way, one word: peerDependencies. Or maybe that's two words. We have a real powerful thing in Node, which is the module system. The module system allows us to have dependencies that doesn't break.... |
**Adam Stacoviak:** Right. |
**Thomas Watson:** The problem with Node Core is that it's a forced dependency on us. We just run our code inside the Node Core that somebody provides for us; if we are a module developer, we can't choose which version our module runs on. So if something changes or is added, or an API is changed in Node Core, our modul... |
**Adam Stacoviak:** So you're all for more modules, less into Core. |
**Thomas Watson:** Yeah, definitely. |
**Adam Stacoviak:** And Sam, for you - how does that clash with your opinion? |
**Sam Roberts:** That doesn't clash, I absolutely agree with that, and I'd extend it... I mean, one of the other things is that Node is a pre-packaged bundle of a set of modules, and you can't disassociate from them. If you want a particular version of child\_process because it's got the sync stuff, but you don't want ... |
\[04:03\] But Node has all of these modules compiled into the binary, and they all come together and it's very inflexible. It creates difficulties. |
**Adam Stacoviak:** How does that create difficulties inside of IBM? So you're a developer inside of IBM - what part do you play there? |
**Thomas Watson:** Well, I should be clear, I don't necessarily speak for IBM, and I don't think anybody does. I started off at StrongLoop, so I've been working with Node only about four years. |
**Adam Stacoviak:** You worked on LoopBack? |
**Thomas Watson:** No, I worked on core tooling, production tooling, production management, metrics, deployment, and also supporting Node and supporting Node Core; a lot of clustering, as well. A lot of my feedback actually comes from cluster. Cluster was added to Node to address a perceived deficiency in Node in that ... |
The problem is once you add it to Node Core, changing things becomes very difficult and it doesn't matter how good something is. It's not so much that you might add something and it's bad and you regret it; you might add something and it's great, but later it's not so good, and URL is a great example. The URL library p... |
It is what it is, it was a decent URL library... I mean, I look at that and I say, "Well, why do we have a URL library in Node that we expose to users? It's just JavaScript, it doesn't UV by an instance, it's not system-dependent, it doesn't have to be written in C++ - and it isn't... Why is it there? I mean, it's ther... |
I look at many of the current APIs as being in that category. They didn't have to be there. We added them because they were useful. I mean, thankfully, Promises were taken out. Can you imagine where we'd be now if the Node API was still promised, but obviously with a non-spec-compliant Promises from, you know... |
**Adam Stacoviak:** What would happen? Speculate for me. |
**Thomas Watson:** I don't know... What would we do? We'd have to wrap it, right? \[unintelligible 00:07:02.24\] |
**Sam Roberts:** We would be really incompatible with modules that also have to run in the browser, because in the browser we have the native Promises now that we also have in Core, but if we had the old Promises in Core, those modules would not be able to run in both the browser and in Node. If you wanna embrace the f... |
But if I may play devil's advocate for a second with the URL example that you gave... If we remove URL from Node Core, we have suddenly another problem, which is a lot of Node Core depend on having that dependency available. |
\[08:00\] So when you install Node, you don't pull down all the modules from npm; you expect Node to come packaged with everything Node itself needs. So the URL module, for example, is needed by the HTTP module. If it's not available, how would the HTTP module work? There are solutions for this, but it's a problem that... |
**Thomas Watson:** Well, actually not only are there solutions, there are easy solutions right now. Up until just a year -- or very recently (post-1.0) \[unintelligible 00:08:38.12\] there was no way that Node could have a JavaScript library in it that was not also visible to users of Node. Node had no choice - every l... |
**Sam Roberts:** And then when you compile Node, you would basically pull that in and have it internally, so it would actually be the same module that you could also install from npm if you wanted to. |
**Thomas Watson:** Yes, which is what's done with... I could be wrong here - I'm pretty sure there's a punycode, so we didn't need an internationalized DNS handling, so that module is actually... I guess nobody wanted to write it. This all predates my time, I just see it how it is now. But very sensibly, they're like "... |
I have mixed feelings about whether we should actually delete the URL library that exists in Node from its public API. |
**Sam Roberts:** I think actually punycode was just deprecated in the recent version - it was in 7, I think... So in Core. |
**Thomas Watson:** Deprecated as in it's no longer used, or it's no longer exposed externally? |
**Sam Roberts:** Deprecated as you're not supposed to use it, I think. I can't remember... Or was it fully removed? I don't think so. |
**Thomas Watson:** I don't know, I haven't looked at it. I mean, it is still used internally, but that's an example, so probably what happened there is not many people used it from Node, it wasn't documented as an official API. But URL is -- I mean, I personally have a fair amount of code that uses it. |
**Sam Roberts:** But punycode was documented. |
**Thomas Watson:** Oh, it was? |
**Sam Roberts:** Yeah, yeah. |
**Thomas Watson:** Oh, okay. I take it back then. There you go, it's there. |
**Sam Roberts:** Deprecated. Version 7. |
**Thomas Watson:** Right. So we do have the ability to deprecate things. Punycode is really easy, it's just gonna sit there forever, probably. Maybe sometime in the future we'll run a search over npmjs.org and be like, "Okay, look, nobody is using punycode; not from Node anymore. They're all npm-installing it because t... |
\[12:01\] James has written this - and this is in no way a criticism of James; I mean, we needed a good parser, so he's written a WHATWG compliant parser, but the question is should we show it to users? Should they be allowed to use it merely by npm-installing Node 8? And what about those poor suckers on Node 6? Many o... |
So that's what I propose. First of all, I think we should be limiting things as much as possible, and if we can make our own Node APIs obsolete by making sure that there's a better one on npmjs.org that people can use, and during what's happening with punycode - and punycode is a low-hanging fruit; I do not think it wa... |
**Sam Roberts:** Yeah, I think what they did was, as you said, they probably went over npmjs and looked at, "Okay, is anybody actually depending on this? How many is it?" I think if it's a low amount of people, it is actually feasible to reach out to these module owners and say, "Hey guys, we're gonna deprecate this in... |
I think punycode probably falls into that category, nobody is really using it. But URL on the other hand, it's something that a lot of people are using... Though I agree with you that it shouldn't have went into Core in the first place and, as you say, you could have vendored it in on compile time, then I think if we t... |
But suddenly if we pull out URL from Node Core, we're gonna get a lot of modules breaking that are working really well, and it's an unfortunate fact of Node being as popular as it is now, and I don't see any good solution to this, unfortunately. And I don't think pulling URL out is a good solution. I'm not saying that ... |
**Thomas Watson:** Right, so I believe the URL should be removed from Node; I don't believe it should be removed now. I definitely wouldn't propose that. I think that the punycode model is a much better one. What I'd like to see is that Node does not expose a WHATWG compatible URL library from Node, that we do make sur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.