text
stringlengths
0
1.36k
**Wes Bos:** Swept off the floor?
**Alex Sexton:** Yeah. Well, maybe not the floor, but swept off of something... \[laughter\] I think we may be a little too far into dairy, but we can come back out. There were a few things to happen in the world of the web this week -- or JavaScript I guess is the party we're having specifically. There is quite a bit ...
**Wes Bos:** Yes, I've got a ES6 series, and part of that is obviously learning about how the modules work, but currently what that is is you have to use Webpack or something to bundle it up... So I guess now we are able to use modules straight away in the browser.
**Alex Sexton:** Yeah, and that's the type attribute equaling module. One interesting thing that I think was misunderstood a little bit from the Node drama around ECMAScript modules, which was that you were going to have to use the .mjs extension - so instead of .js, you have to use .mjs... Mike, I don't know if any of...
The web doesn't give any damn about what extension you use. You could use .php for all your module files.
**Mike Taylor:** You probably should.
**Alex Sexton:** Yeah, yeah. I think it's a best practice, for sure... Just to show your mastery of your knowledge of the non-importance of extensions on the web. Mike, I asked you a question and then I answered most of the question I asked you, but is there any kind of movement in the standards space here that you've ...
**Mike Taylor:** Yeah, I mean... I think there's still problems that need to be resolved. I don't follow -- a lot of this work was done in conjunction with TC39, so they're the standards body that works on ECMAScript the language, which is what we know as JavaScript. But the actual module loading stuff happened in the ...
Alex, you were talking about some of the problems around backwards compatibility for the Node ecosystem, and you're right - we don't have those on the web, in browsers, because like any "module system" we've had, if you used a module loader like RequireJS or the other one... I think you wrote a couple maybe, Alex...
**Alex Sexton:** No, definitely not.
**Mike Taylor:** \[07:58\] That's all just like regular JavaScript, right? It all evaluated to just be like -- the exact same thing is, I don't know, a script tag, at the end of the day. So there have really been no browser compatibility constraints. But there is this issue... There's this "no module" attribute, and th...
So there will be a way for you to say like "This one's not a module. This is my fallback for Safari 9 or Firefox 38", or whatever it is.
**Alex Sexton:** Oh, I see...
**Mike Taylor:** But that said, I know like 1% of things to know about that. But if you're concerned about compatibility, like if it's your job...
**Alex Sexton:** It's Mike's job.
**Mike Taylor:** ...in theory, you should know about this. So that's on my to-do list. You know, anytime you add stuff to the web platform -- hang on a second... Is this like a PG podcast, or PG-13?
**Alex Sexton:** PG-13 is fine.
**Mike Taylor:** Okay, so I'll just say stuff is gonna break. \[laughter\] We'll save our swear words for the end, like when we put our kids to bed. Stuff's gonna break, so whenever you add to the web platform... People make all these weird assumptions. Heck, someone might have used type=module, so you're gonna run int...
**Alex Sexton:** Yeah, I don't think there's a ton of people using this in production quite yet, by the nature of how new it is.
**Mike Taylor:** Yeah, this is like this week, right? \[laughter\] They even serve like an evergreen demo-type thing.
**Wes Bos:** I'm just looking at a quick little blog post about it here, and for those listening that wanna know a little bit more about it, what this blog post is recommending is that you ship your ES6 modules to the browser, and then you use this "no module" attribute that Mike was talking about to signify to the bro...
**Mike Taylor:** Sounds like a transition phase, right?
**Wes Bos:** Yeah.
**Alex Sexton:** It's been the no-script of modules, right? \[laughter\]
**Mike Taylor:** It's the no-module, yeah.
**Alex Sexton:** I see where they came up with the name...
**Mike Taylor:** Amazing.
**Alex Sexton:** One interesting thing that I guess I didn't really consider until now - and I may be considering it incorrectly... Whenever they did the modules back in TC39, there are things about modules that are true that they were able to like, since modules are new, and if you're using a module, that must mean yo...
So this would be the first time - since this is the first native implementation of modules anywhere - that that is enforced, versus just...
**Mike Taylor:** An opt-in type thing...?
**Alex Sexton:** Yeah, a part of the compiler that you're using, that may or may not care about the strictness of your code. Because it wouldn't actually be enforced by the engine at runtime, right? So it probably actually means that to some degree there are places where modules could run faster, because they have fewe...
It's async by default, so you also can't do "document.write" and things like that, so it could very potentially allow the browsers -- like, browsers are pretty good at look ahead and all that stuff now, so it may not actually material and make a ton of difference.
\[12:09\] But it's kind of cool that because modules are a new enough thing, that we can unbreak some old things if you use them.
**Wes Bos:** Yeah. That reminds me of service workers. If your browser supports service workers, in order to support a service worker you have to implement a bunch of other things like Fetch and other things... So you only need to do one level of feature detection to be like "Do I have a service worker on the document?...
**Alex Sexton:** Yeah, there's something with the CSP that's a very similar content security policy, where things on the page break if you're in an old browser and you have the CSP, but since those old browsers don't have CSP support, then it kind of accidentally works. It's this nice accidental upgradiness that breaks...
Let's talk about... Mike, you work on low compatibility; it's kind of similar to some of the stuff that we're talking about. I've seen you give a few talks on this, and you're at it from Mozilla, but there's a lot of actual more like general... Is it part of the Standards Organization, the compatibility effort? Feels l...
**Mike Taylor:** Yeah, it's not just a Mozilla thing. I mean, Mozilla pays for my mortgage at the end of the day, which I'm grateful for, but our mission... So I guess you have to take a step back. If you've ever looked at what the Mozilla - we call it the Manifesto, the Mission... Maybe I should go take a step back an...
So with that being one of the guiding principles of what Mozilla does, we obviously want the internet to work in Firefox, but we also want the web to work in Chrome, in Edge, in XYZ, Opera Mini etc. So I think by the nature of what it is that we do, we collaborate a lot with other vendors.
This morning I was on a call with some of the good people at Google who work on the platform predictability team. Rick Byers is one, Philip Jägenstedt another, who used to be at Opera... And we were talking about ways we can collaborate and understand what are the pain points in the platform where things -- you know, l...
**Alex Sexton:** That's what happens... That's kind of the default answer, usually. Especially with very old Internet Explorer stuff, it seemed like half of HTML5 was us just standardizing internet for...
**Mike Taylor:** Exactly.
**Alex Sexton:** Is it still the case?
**Mike Taylor:** \[16:11\] It's often the case. A lot of the work I've been doing in the past year and a half, two years is just standardizing what I call "the de facto web". So you've got the web that you were promised, or the web that was written in specs and, you know, like people like Zeldman and others said "Code ...
So basically, the internet depends on this one feature, so you can either pretend, or get really upset, like "Oh, it's non-standard." You can care about that, or you can just say like "You know what? This is part of the web and it has a crappy name... That crappy name happens to just start with -webkit, so let's create...
At the same time, that kind of stuff kind of ruffles feathers. People are not entirely happy about it, both users and some other people at W3C... Some of this stuff that I worked on, the CSS Working Group, they were like "Oh, this is not our ideal design", so they're partially motivated to go make better versions, whic...
To circle back, you were hinting at this... There's an expression, "Pave the cow paths." I'm not sure if everyone's ever heard that with respect to standards or just like path-paving in general - I don't know if that's a profession.
**Alex Sexton:** I always assumed that Ian Hickson the editor of the HTML5 specs default response, like his autoresponder on his email is just "We're actually just standardizing the way things have always been, not designing a new thing." That seemed like his answer to a lot of things, which is fair, but often frustrat...
**Mike Taylor:** Yeah. I mean, that's why drag and drop is so terrible, for example, right? It's like, "Well, IE3 did this, and then Safari 2 copied it, so we might as well make everyone else do it", and then nobody uses it.
So paving the cow path is this notion that like, you know, all these cows walked this way, so that's obviously the optimal solution, so you wanna lay down some asphalt on that. So that's kind of one aspect of this work.
A part of that, my team works on this website called WebCompat.com, and that's a place where you can go if you're just like, "Oh, this website doesn't work in this browser" - it could be Firefox or Chrome...