text stringlengths 0 1.36k |
|---|
• Discussion of AMD (Asynchronous Module Definition) vs CommonJS and their role in compiling modules for web use |
• The debate over AMD vs CommonJS module systems |
• The idea of compiling down to a single format, such as AMD, for cross-browser compatibility |
• The rise of Babel and its impact on the need for module system arguments |
• Criticisms of Node.js requiring JavaScript use for web development |
• Disagreements over whether Node.js improved or hindered toolchain innovation |
• Node module system limitations for web use |
• Browserify and AMD loading without build pipelines |
• Standardization of tools and features in technology |
• Synchronous vs asynchronous builds and their impact on performance |
• Future developments in dynamic imports and bundle size reduction |
• Service workers and background code updates as potential solutions |
• Discussion of web page loading issues and the impact of JavaScript parsing time |
• Criticism of current build system contributing to the problem |
• Introduction of project of the week: Lodash 5 ES6+ only loader for Node 4+ |
• Explanation of how the loader works, including caching and transpiling |
• Benefits of using the loader, such as removing compile steps and supporting multiple Node versions |
• Details on configuring the loader with options like unambiguous module grammar and commonjs carryover |
• Discussion of future plans and the possibility of using the loader in browsers without tooling |
• Using gzipped modules for Node.js projects |
• ESM (ECMAScript Module) loader with built-in gzip support |
• Benefits of using the ESM loader, including smaller package size and faster loading times |
• Potential drawbacks of using gzipped files, such as increased CPU usage for decompression |
• Lodash 5's new architecture, which will not have an index file or main monolithic include, and will instead use cherry-picked modules |
• Node.js caching behavior and its impact on startup costs |
• Lodash 5 is changing its approach from providing all functionality upfront to giving minimal functionality and allowing users to opt-in to more features |
• Rollup and Webpack will need to be updated to work with the new module system used by Lodash 5 |
• The Fantasy Land specification is being discussed as a potential standard for interoperability of algebraic structures in JavaScript |
• John-David Dalton's pick: contributing to open-source projects like Babel, MomentJS, and Mocha |
• Mapzen JavaScript API is being recommended as an alternative to Mapbox for integrating maps with websites or apps |
• Goodbye statement from John-David Dalton |
**Mikeal Rogers:** Hey, everybody! Welcome to JS Party, where it's a party every week with JavaScript. We've got a special guest today - say hello to John-David Dalton, also known as JDD. |
**John-David Dalton:** Hi! That's me, I'm JDD! \[laughter\] |
**Mikeal Rogers:** I'm Mikeal Rogers... |
**Alex Sexton:** And I'm Alex Sexton. |
**Mikeal Rogers:** Today we're gonna dive into ES modules. To kick us off, I wanna get into the history of ES modules, because I listened to this terrible podcast in the JS Party feed where yayQuery took over and Paul Irish made some interesting statements about how the Node modules did it wrong, and why do ES modules ... |
**Alex Sexton:** That was my line. |
**Mikeal Rogers:** Yeah, okay, that was your line... So that kind of argument works if history doesn't matter. \[laughs\] |
**Alex Sexton:** No, I mean... If you listen, I think we understand the situation; it was just kind of a fun time to use the "He's the one who sucks" line from Office Space. |
**Mikeal Rogers:** Right, right. But when I listened to that in my headphones, I was screaming, because I was like "We couldn't have done anything at the time because these modules didn't exist!" \[laughs\] |
We were joking earlier that we're highly qualified to do this, because Alex wrote two sentences of the AMD spec, and I wrote one sentence -- I wrote one sentence of a revision to the CommonJS spec, so we're well-qualified. \[laughs\] |
**Alex Sexton:** I mean, I can't think of people who would have written more than that... |
**John-David Dalton:** I write code that supports both. |
**Mikeal Rogers:** So to really go as far back as we can, JavaScript is like a thing you script include in your page, it's been that way for a long time. The first people to do everything are usually Dojo - they do it in this way that everybody ends up hating, but Dojo really did do modules first; they had an independe... |
**Alex Sexton:** At first it was all synchronous, right? It literally used synchronous Ajax and eval(). |
**Mikeal Rogers:** Oh yeah, that's right, it was synchronous XHR. |
**Alex Sexton:** Yeah. It would take like three minutes for your app to boot, and then that's where -- what's his name? He's one of my favorite people in the entire world; James... Wrote AMD... Oh, my goodness, this is not good. |
**John-David Dalton:** James, uh, Oh, man... |
**Alex Sexton:** \[04:11\] RequireJS... |
**John-David Dalton:** GitHub... \[laughter\] I'm doing the same thing. |
**Alex Sexton:** James Burke, that's what it is. |
**Mikeal Rogers:** There we go. |
**Alex Sexton:** James Burke was on the Dojo team, so AMD actually kind of came out of Dojo a little bit, and then was the official loader once the RequireJS kind of started to exist. But there was like the first synchronous loader, and then there was the asynchronous version of that, and then that kind of turned into ... |
**Mikeal Rogers:** So before we get into AMD though I think that we do need to rewind a little bit... I don't think that they really looked at Dojo at all when they did this, but there was this early ServerJS community where people were building a JavaScript platform for the back-end. The primary one at the time was on... |
Their module system was synchronous, and \[unintelligible 00:05:31.29\] and all that kind of stuff. So they didn't do any sync load at all, because it didn't really matter to them, so they wrote this really simple module pattern... |
**John-David Dalton:** Did it use load? |
**Mikeal Rogers:** No... I'd have to ask Chris Cowell to make sure, but I don't think so. |
**John-David Dalton:** Okay. |
**Mikeal Rogers:** This was like the first more formalized spec for how you could write JavaScript modules. Traditional NodeJS module users have seen this pattern, it's very similar. The big difference that I would note that is very important is that the module .exports equals a function, that whole pattern where a mod... |
**John-David Dalton:** Correct. |
**Mikeal Rogers:** That was something the guy added later. So a lot of people started using the spec in the Narwhal space, and when NodeJS started, it grabbed that spec. Also, CouchDB I think still to this day has CommonJS module support, so you can add them into properties on a view, and then in your view you can actu... |
So the spec kind of got around and people started using it for modules and stuff like that, but eventually Node just became so popular that the ServerJS effort kind of died off. Node started to make some very Node-specific adjustments to the module system, so it's really not compliant in any way with any spec that Comm... |
But a lot of people didn't like this module system, including James Burke. They felt like it was not quite fit for the web, because it didn't have this async loader, because it wasn't built around that stuff... |
**Alex Sexton:** They were objectively right, right? |
**John-David Dalton:** Yeah, I mean, it's synchronous versus asynchronous. Synchronous on the web is not great. |
**Mikeal Rogers:** Well, synchronous in Node is also not a thing. With Node, what we figured out was that even though everything in Node is async, it actually makes sense to have a sync module system because you need to load up your entire application before you can actually handle things. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.