text stringlengths 0 1.36k |
|---|
**John-David Dalton:** I was just gonna say that, Ember does use AMD. |
**Alex Sexton:** \[23:53\] Yeah... So I think maybe he read my blog post, which was just that, like, I don't care what you author in. If you're gonna compile, that's fine, but if we're defining a module spec that just has to work everywhere for everyone in all cases, then AMD is the superset. If you write synchronous r... |
**John-David Dalton:** There was even a build step for AMD, and that was RJS, the build optimizer. |
**Alex Sexton:** Yeah. If you don't mind authoring an AMD - which I didn't - then you might as well write it, and you're gonna build it, but... AMD worked without a builder. It was an optimization step, or whatever. |
**John-David Dalton:** I never understood those kinds of fights. If you like CommonJS, use CommonJS. If you like AMD, use AMD. If you're a library author, support both and you'll get more users. |
**Alex Sexton:** I understand you \[unintelligible 00:25:35.14\] JS were a AMD, or a UMD creator. We didn't talk about that either, but I would have been more of a fan of just like instead of UMD needing to exist, why doesn't CommonJS just compile down to AMD? Use whatever you want, and then everyone compiles down to A... |
**Mikeal Rogers:** But at what point do you compile it down? If you write a reasonable module, do you compile it down before you publish that module, or do you just publish that module in the regular Node module system and expect that somebody when they use it in the browser they're gonna compile -- |
**Alex Sexton:** I think everyone -- much like now, you can't really ship ES6... Or a lot of times you can, you have to kind of transpile that way. Everyone, no matter their build stack, can use it. So the idea is like your Dist folder would have your AMD compile. You write in CommonJS and then you compile everything d... |
**Mikeal Rogers:** I'm remembering my position during this weird fight with AMD, and the reality was we had way too many modules in the Node ecosystem that were being used by browser tools and being compiled in another browser to say "Okay, we're just gonna not use this spec anymore for publishing reusable components."... |
**Alex Sexton:** No... It was extremely early and in no way was that a thing that anyone thought would happen anytime soon, and it didn't. It didn't happen for five more years... And it still hasn't happened. \[laughs\] |
**Mikeal Rogers:** Right, right. I think the thing that nobody really saw coming was Babel taking off, and then frameworks being built as Babel toolchains, like React... At that point, you can use these new standards and just have them compile down to whatever. It's not even worth having an argument over what that's co... |
**Alex Sexton:** \[28:01\] I actually think it's still a little bit sad that -- like, it will eventually not be true anymore. Eventually, modules will work in the browser without Node, but I think it is a bad thing, and was bad for the web, or whatever - and there are tons of bad things for the web and it's fine, every... |
**Mikeal Rogers:** So this is what I'd argue with though - one, referring to it as a server-side thing is a little bit disingenuous, because when you use it this way, you're actually using it as like a front-end compile step, and you're using it as like the way you would use Python, or... |
**Alex Sexton:** On a server. |
**Mikeal Rogers:** Well no, but you don't call Python a server language when you use it to just like run a script on your local system. It's a system language. |
**Alex Sexton:** Sure, but I don't care. What I mean is that people already had Ruby-built pipelines, right? |
**Mikeal Rogers:** But they sucked... Compared to what we know now. |
**Alex Sexton:** They all could have got better in the same amount of time, if we-- |
**Mikeal Rogers:** No, they couldn't, because the people that innovated-- people that have been innovating in these toolchains get to work in JavaScript, and that's the language that they know and love, and they're part of that same community. And the reason why we have much better toolchain-- Node is not a particularl... |
**Alex Sexton:** Your bias is showing, in my opinion. I think we can parse JavaScript modules in any language that we want... |
**Mikeal Rogers:** But we were... |
**Alex Sexton:** I mean, we were in Java, for one thing... |
**Mikeal Rogers:** And in Ruby. |
**Alex Sexton:** ...and two, there were plenty of really fundamental, huge leaps in tooling that happened in Rails and in a lot of these things prior to any of this taking off, and to think that those tools would have just stagnated because Node never existed to come save the day because everyone could type everything ... |
**Mikeal Rogers:** No, no, no, that's not what I'm saying... |
**Alex Sexton:** That's exactly what you're saying! So silly... |
**Mikeal Rogers:** No, what I'm saying is that it's definitely revisionist history to say that it would have been better if we didn't have to use Node for these things, because what we get from having a toolchain that can take all of these different Node pieces and put them together, regardless of what language it's in... |
You were at it, I remember that you were here -- so in 2011 at the first NodeConf in Portland we had a panel, and one of the questions to the panel was "What should you not use Node for?" and everyone on the panel agreed - Ryan Dahl, Isaac... Everybody. I think Brendan Eich was even on it. You probably don't wanna use ... |
After that, there were so many things written in Node and so many things written in JavaScript that could be compiled down to the browser that it was like "Oh wow, we get to tap into this great ecosystem when we write this tooling. This is a much better language to do this in", and a bunch of people stopped doing this ... |
**Alex Sexton:** No, they found it required... |
**Mikeal Rogers:** Required?! Who made them do this? |
**Alex Sexton:** \[31:59\] My problem isn't that Node existed and offered these tools, my problem is that the default thing that we all chose required you to use this single language. We got away from being able to do anything in any other language because we standardized a specific tool. I'm not mad that Node existed,... |
Revisionist history is to say like "Oh, well the Rails tools aren't good now." That's because everyone had to switch over, of course! |
**Mikeal Rogers:** This has to do with those, because every tool that takes a Node module in the Node format and puts it into something compiled for the browser has to have its own interpretation of the module system. It doesn't get to leverage Node's module system... That being Node's module system is really no differ... |
**Alex Sexton:** I think that is a very simple way of thinking about that, sure. |
**Mikeal Rogers:** I think that these workflows won because they're better, honestly. |
**Alex Sexton:** I'm not saying that they aren't better. |
**John-David Dalton:** I thought they won because just -- I wanna write in JavaScript, so when the opportunity came to be able to do that and have system-level access be able to write files and load modules and reuse code, I jumped at it. That was a no-brainer for me to switch. |
**Alex Sexton:** Yeah, so I think maybe both of you are misunderstanding me. I would have immediately used all of the Node's stuff... I think it is the best tool for the job etc. etc., but I think that it is explicitly anti-web to essentially say "This is the new standard", even if it's not a real standard; everyone sa... |
**Mikeal Rogers:** How do you load AMD modules without any code to load the AMD module? |
**Alex Sexton:** AMD by default just works. It injects the script tag... |
**Mikeal Rogers:** There's a still a little loader there. |
**Alex Sexton:** You have the AMD runtime - there's even like a miniature one; it's 2k, or something... I think it's called Almond. It sets up the names \[unintelligible 00:34:59.24\] for things to be able to require and define, and then it loads your script, and then whenever you require a new script, it is asynchrono... |
It works completely without any build, and I think that's a good default, because it doesn't require people who just wanna build a website to learn Node whatsoever, or learn any server-side anything. |
**Mikeal Rogers:** So you can also do this with any module in npm. There's a thing called Browserify CDN, where you can just in a web browser say "Oh yeah, just require this module." You don't have to have a Node build pipeline -- you don't need a pipeline, you can just use it. And it's not super popular because guess ... |
**Alex Sexton:** \[35:54\] No, it's not super popular because the only thing I can think of that's worse than requiring Node is requiring BrowserifyCDN.com as the required thing to build web pages. That's not a solution to this problem generally, it is someone else doing the Node build pipeline for you, that still requ... |
**John-David Dalton:** As a sidetrack though, there is an AMD loader for Node too, so... That was kind of cool. You could use AMD syntax and have it work in Node as well, if you required the loader. |
**Alex Sexton:** AMD actually even worked in most simple synchronous cases, with a small build step that didn't need any context of -- like, you could do it with Dash... So you just need to add a line at the top and a line at the bottom, essentially wrapping it in a require function. Then as long as you had essentially... |
So you could actually author synchronously and then still ship async AMD with like a Bash build step that just concatted a line up top and at bottom. |
All I'm saying is that everything's fine and I used the tools that were the best, but I still think it was anti-web and we could have done better, and we should have done better. We should do that next time. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.