Sentry – Get 30 days free when you sign up with the code
Toptal – Hire the best freelance developers and designers with Toptal. Email
email@example.com for a personal introduction.
Fastly – Our bandwidth partner. Fastly powers fast, secure, and scalable digital experiences. Move beyond your content delivery network to their powerful edge cloud platform. Learn more at fastly.com.
** If we missed any links let us know.
- yayQuery podcast
- Buy the yayQuery soundtrack on Bandcamp
- Lighthouse — an open-source, automated tool for improving the quality of web pages. You can run it against any page on the web. It has audits for performance, accessibility, progressive web apps, and more.
- Getting Started with Redux by Dan Abramov
- You Might Not Need Redux by Dan Abramov
- The Most Explosive Modal on the Web
- Progressive Web Apps Training
- Webpack: It's Not Magic
- The Manager's Path: A Guide for Tech Leaders Navigating Growth and Change by Camille Fournier (Rebecca Murphey)
Paul Irish shared this image as his pick.
Alright, welcome to episode 24 or so... Of the yayQuery podcast, a takeover of the JS Party podcast. It's been a couple minutes, maybe a few weeks here now since we've had a yayQuery episode, but for JS Party listeners who don't know yayQuery - yayQuery is myself, and then... In order, introduce yourselves: Paul, Rebecca, Adam.
Known for his ability to communicate well, Paul Irish.
Not like Family Matters?
Yea, exactly. Pretty much exactly like Family Matters. [laughter] Normally, I'm joined by Mikeal Rogers and Rachel White, but they're in Germany, or something... I have no idea where they are. Who knows, who could possibly know that information? So this week we've decided to have a little yayQuery reunion for everybody. So let's jump in, since we have a little bit to talk about. What has changed since the last episode that we've had?
I think Rebecca and I both have children now...
That's no big deal...
I mean, 2.0...
Yeah. You know, it never occurred to me until now that we never put dates on the yayQuery website, so it seems kind of evergreen...
It's evergreen until you listen to [unintelligible 00:03:39.27] and we're like "jQuery 1.4.111, commit 93870 came out today..."
It seems so important...
Hold on! [unintelligible 00:04:41.04] put down my Margarita to listen to this... [laughter]
So the interesting here was ReactJS actually launched at JSConf in Florida... Were all of us there at that one?
Didn't we do yayQuery reunion?
We were already doing yayQuery reunions when React came out. [laughter]
Yeah, and I remember from that the vibe that day at the conference... Like, "Facebook just showed this thing where they wanna put XML in JS. That is crazy! This framework... Why are they doing this? Why don't they just work with one of the existing frameworks? This is so against the community, or something." I felt like there was so much concern and being like "I don't like this!" that day.
There were two tweets from close friends of the yayQuery podcast... I think Rick Waldron and Ben Alman both had tweets that were pretty much like "Facebook is belittling all best practices that have ever existed in the face of..." - just a so very serious tweet... But to be fair, I think Tom Occhino - I don't know if he was ever on a yayQuery show; he definitely spoke at the first TXJS, because he was friends with us... But I think they focused on the wrong stuff in that first talk. Because later they did the talk (six months later at EU) and everyone loved it.
I think they were trying to focus on the autobindy-type stuff, because that was really hip, and they were glossing over the fact that they had added this ES4 feature of JSX back into the language, and didn't necessarily -- like on-click handlers, and all that stuff.
And Pete Hunt talked about that at TXJS 2015, about the mistakes of that rollout. I remember there was probably alcohol involved, because it was the end of the day and it was like the big reveal, but I just remember the room being appalled at this thing that they were seeing... And yeah, it was a long time before it kind of recovered from that.
Yeah, there was a good at least six months where everyone had a really bad opinion of it, and it was just like "Ugh... Don't like it!"
But Dojo though, guys... Dojo is totally still... [laughter]
I often think about our arguments back in the day, Rebecca, of rolling your own large application with jQuery or using Dojo. I think Paul one time said something along the lines of like "Alex, I think you won that argument in that people agreed with you and went that direction", but Rebecca was right and then we were all wrong... None of those things occur anymore.
In that you were right in the argument of rolling your own is just more feasible and kind of easier...
Rebecca was right in that Rebecca was a bizarre voice for another three years after Alex rolled his own...
Oh yeah, for sure.
...and left us. [laughter]
Moving on... [laughter] You're at Indeed now, correct Rebecca?
Do you guys use types? Do you use Flow or Typescript or anything?
Oh god, do I have to answer this?
Well, I mean, that's the next thing that I was gonna talk about, because FlowType - another Facebook thing, but also Typescript...
The actual answer is yes, but we mostly use Google Closure... But we're fixing that.
Yeah. Google Closure itself, Google Closure the library, and then the Closure Compiler.
Oh, I see.
Oh, you use the Closure library?
Yeah... But we have some teams that are -- people really like the strong typing of that, so we have some teams that are moving away from Closure because no one uses it except Google (no offence), but moving to things like Typescript and Flow; we haven't really settled down on one, but people like their types because they're Java people.
Yeah, that's a really interesting segue, because Closure had type annotations in comments in order to do way better building back in the day. I added them to YepNope and I would double minify YepNope with Closure, and then with uglify it would come out smaller...
And it would take ten minutes...
...except Brian LaRue.
Yeah, we don't use Babel... I think part of it is because -- yeah, in the DevTools case, we only run in Chrome, so we make sure that what we're writing today and lands essentially in Canary will work in Chrome stable; that's what we have to operate under. But yeah, compiling the source has some ergonomic downsides, so we're not really interested in it.
Cool. And one of the news segments on the show that we did was talk about when Node was released at JSConf EU...
We seemed excited about it, but I think none of us really understood what it was, and we were all just excited because Twitter was so excited about it.
I had my favorite story about it...
Node.js... I like it.
Can I ask another question on this topic? Because I think one of you guys know the answer better than me... Around ES modules and .mjs extension. Because I don't really know where things are completely, but I just remember being slightly infuriated that we're gonna have to adopt .mjs for all the ES module files, for this whole load compatibility, and I was like "Come on! The people that have been doing it wrong, they get the real extension, and now the real thing gets kicked off...? This is so stupid! It's stupid!" And then at some point I was hanging out with Alex Russell and Domenic Denicola, and I was like "Guys, isn't this so stupid?!" and they were like "Why? What's the problem with it?" They were like "It seems okay..." and I was like "Well, if they think it's okay, then probably I guess it's okay..." [laughter]
We don't have a ton of time to get to the beginning of this, so we're gonna move on a little bit. There was an io.js release and fork, and a few other things, but Node.js 8 is coming out soon, so I don't think we can cover all that... Plus Mikeal's not on the show and he'll want to have opinions.
The next section we have in here is things that used to exist when we had episodes, but don't anymore. I only put two things in here - YepNope... I deprecated YepNope, but people still use it; it's still very popular, for some reason. And JSConf US is something we talked about a lot... Maybe it'll come back though.
I wanted to intentionally rush through that section because it wasn't that interesting. [laughter]
Yeah... The last thing that I wanted to talk about was a little background behind some of the language we used on the show. I don't think we ever...
Some kind of behind-the-scenes action, yeah?
Yeah, a little bit of -- I don't know a different word from behind-the-scenes, actually... [laughs] Paul, people may have seen us talking about "editing on a clap" or "this is what's on the clap."
Can you give me some background on that?
[laughs] Okay, sure. So the way that we put together yayQuery episodes - we would get together, and I think we'd get on video chat, we would get on a little EtherPad document... EtherPad was like an Ajax app with collaborative editing where everyone's edits is highlighted, so it's very clear who wrote what. And then we'd just get on there, and start drinking, and then figure out what the hell we were gonna talk about, and then two hours later actually record an episode, eventually.
But anyways, that EtherPad instance that we had was hosted on OkSoClap.com, and this was hosted by our friend Vlad, who set the whole thing up for us. It was the coolest little instance, and it worked so good for us. Now, the history of that OkSoClap is pretty much because in the beginnings of yayQuery I think it was my fault that -- it was that just when I was getting tired of a topic, or...
Yeah, it was at the beginning of every segment... [laughter]
Oh, right! And I'm starting to be like "Okay, this is how it went", and I'd be like "Okay, so... [clap] This is how the story goes." I'd say "Okay, so" and then I'd clap my hands; it was just like a nervous tick, but it turned into a thing that Alex picked up on and made it into a thing.
And that all the DNS entry doesn't resolve...
I'm a guy who knows when things are things, and that was a thing. I think we're running up on the first break, so we're gonna take a break right now and come back with a few classic segments.
I remember, it's a symbol of how different that whole standards process is than when we started yayQuery. It's a lot more open, and I think that that is a nice thing to point out.
I think it was Rick that was the crossover between yayQuery backchanneling and taking notes at TC39 meetings. And he did that through the jQuery Foundation seat that we bought on TC39 for him and Yehuda. So it was actually -- the popularity of jQuery was able to raise enough money to create a foundation that was able to buy seats on TC39 to put real developers and open up notes and do those things.
I think a lot of that history of the community - getting more involved and stuff - was really nifty, and nice, and I'm glad to have seen it happen.
I forgot... Mikeal and Rachel are gonna be gone next week, and I need to get Rick on the show maybe... We'll see.
You could just do this again.
I can shave my head, or something. [laughter]
We'll just fully take over the podcast, lock Rachel and Mikeal up in a closet every Friday.
I could do a part where I talk about steak, or something... I don't know.
The steak that you flew home with you?
Oh, that's a different story!
I'm lost. There's a soundboard... Sometimes we get Rachel talking about cat hair, which is probably my favorite one. Can we play that?
"Hold on, I have cat hair in my mouth..." [laughter]
Yeah, it's really good... Don't say anything you don't want to be turned into--
"Oh wait, that happens on an episode of Gilmore Girls... I know what that is."
That was about Node.js' forking into io.js... That was the Gilmore Girls, season two, episode three.
[00:24:01.20] Let's get into a classic segment. This is a little segment... It's about little, tiny things that you never thought you knew. It's something that we like to call
[all together, loud] "Hideeeeenhancements!" [The Little Tiny Things/ You Never Thought You Knew]
If we're lucky, we'll edit some audio for our old song to be there.
And if you're unlucky, then you heard us yelling it. Maybe you got both. Cool. So the hiddenhancement this week... Adam, why don't you introduce the concept?
Okay, so the concept of a hiddenhancement - it's an enhancement that's hidden; kind of like the first syllable of the word "enhancement" is hidden and the last syllable of the word "hidden". [laughter] So this is a segment where we would talk about cool stuff that was around and you didn't know you could use.
Like, in jQuery.
Primarily in jQuery, but now most of that is in the DOM... Right, Paul? [laughter]
Yeah, sure. Okay, so there was at least two hiddenhancements that I wanted to share... Actually, they're both kind of new. You might be familiar with document.elementFromPoint(), where you provide an x, y location and it tells you the element that is right there. But there is another method which is more useful in some cases. If you know about that one, you might have some code where you're like, okay, we take the first one and then we're gonna set pointer events or just hide it and then find out what's underneath it. The other method is document.elementsFromPoint() (elements - the plural), and this returns an array of nodes from top to bottom that live at that x, y coordinate, so you can just see exactly what the stack is.
Is it a NodeList or is it an Array?
It's an Array. God damn... Well, you know, there's an interesting distinction between Arrays and NodeLists, right?
What's that, Paul?
[laughs] A NodeList is like this Array-like thing, but it's kind of -- it's been frustrating, because we always get back NodeLists from [unintelligible 00:26:29.28] and in NodeLists you can't do things that you'd normally do with an Array, right?
If I recall, there's like prototype methods missing...
Yeah, it's always been frustrating, so that's why we always do that arrayed prototype slice deal. So number two hiddenhancement is that the NodeList object is now iterable.
Yeah, it is everywhere. I think probably IE10 is where it bottoms out. But yeah, iterable NodeList available on all modern browsers. You get back the result from querySelectorAll, and you have four each sitting on that.
Speaking of IE10, I just wanted to let you know about this other browser that came out... It's called IE9. It's gonna have CSS3 support, and you can hear us talk all about this in the South by Southwest (???) episode of yayQuery. [laughter]
[00:27:41.09] Yeah, me and Paul -- oh, that's a good story. Paul and I were given, via yayQuery - because we were on the yayQuery podcast, for some reason, we got VIP press badges to the IE9 launch party at Sout by Southwest, and we sat at press tables as they did the press announcement. We were next to Wired. Wired was writing the article on IE9 being launched, and me and Paul were just writing tweets about how IE9 was just gaming all of their demos. It was a really good time.
Then we got to go see yaySayer at the after party, in the VIP section. We were there with -- who was it...? Werner Vogels from Amazon, the CTO of Amazon. It was a wild ride. IE9... Good old days. [laughter] Yeah, yayQuery press badges were a thing at some point... [laughter]
That was so legit!
That's funny. So one other hiddenhancement that I wanted to bring up... I saw an Addy Osmani tweet maybe a few bits ago; there's a new feature in DevTools -- Paul knows a little bit about DevTools, Chrome DevTools specifically... And we're always talking about splitting up your code, and only uploading the code that you need for the initial load and stuff like that - and this is actually a pretty difficult thing to know. You can have really cool, good dependency management and try to figure it all out, and do trees and some sort of something, but DevTools can tell you now exactly what code runs... I think splitting it up still might be difficult, but it's a really good indicator of that. Can you tell us how to find that, Paul?
Sure. In DevTools, what you can do is -- it's in a place that we call "the drawer", which is the little console at the bottom, when you hit Escape and that pops up... So you can definitely hit Escape to bring up that, or you can go through the top-right, the little three dots menu, go to More Tools and click Coverage. Either way, you're gonna click a little menu, the three dots, and go for Coverage. From there, there's a little Record button; start recording, and stop if when you're done.
We're also thinking of making it more like live, so all those results would be streaming, and maybe you would be able to rewind to certain interesting points, like at DOM content loaded it was this, but then you scrub the slider forward and see what it was at window load, so you can get the history of all that coverage, so you can get a better idea of how it kind of changes over time, as each file was loaded and each thing happens. So those are some ideas there; if anybody wants anything in particular, just holler at me.
Is this available as data from Lighthouse, or anything like that?
Yeah, we have it available... We have some audits for this in Lighthouse 2, and we just kind of summarize it at a high level. You can also build some tooling around this on your own, if you wanna dig into the DevTools protocol. It's pretty raw data over there, it's gonna need some massaging, but if you are interested in building a tool that automates looking at this, then you definitely can.
Sure. I think you have a tool that was my pick last week... It's pw-something, right?
[00:31:55.25] Pwmetrics - it's a command line tool that will automatically run Lighthouse locally in a Chrome instance... So if you wanna hook that up to your build process to get metrics out, and then kind of like test that pass. I think it could be a really nifty test to say that like "You can never ship more than some bottom line of like 80% of the code that gets loaded must be executed, otherwise the tests fail", or something. Does that make sense? It could be a really nifty build-time check that causes you to never go over that... Because once you go over too far, it's much harder to fix.
Cool. That's really nifty, good job! Good job at your job! [laughter] Next up we have probably the most famous segment... It's the [unintelligible 00:32:50.22]
What would we have today? Would we have like the Webpack loader of the week? [laughter]
The Babel transform of the week...
The React [unintelligible 00:33:16.25] of the week... [laughter]. Today's plugin of the week - I picked this, but Rebecca, I don't know if you've actually looked at it... So why don't you go ahead and actually take this one for us?
Wow... That's really -- I mean, it's an explosive modal... It's the most explosive modal on the web.
What is it called?
It's called Explodal - duh! Like, what else would you call the most explosive modal on the web...? This is in the true spirit of jQuery plugins, I feel like.
It's just CSS. [laughter]
Well, I was gonna say it's functionality that you probably don't need on your website, but there's a plugin for it, so why don't you add it? It's good.
It's a modal that explodes up!
I think some good use cases for this like the Add To Cart button on Amazon would be good; so you click Add To Cart, and instantly, Amazon's like "Boom!!!' with flames and fire... Yeah, it's those little touches that really add to that user experience.
Only 97.32% CSS, so I don't think we can say it's CSS.
I think the other part is a gif though, right?
I don't know, I have to look at this on GitHub really to see...
It's onclick handler...
Yeah, I mean, they're using a straight up on-click handler, like in-line onclicks. That's pretty classic.
I also... As part of the plugin of the week - I don't think it was ever the plugin of the week, but this felt like the right place to talk about it... One friend of the podcast, Ralph Holzmann, let me know recently that there was recent activity in the LABjs project. LABjs, if you remember, was one of the many entrants to the script loader wars back in the day, the good ol' wars, for asynchronous...
He lost a lot of good devs out there... [laughter]
[00:35:38.12] Yeah... LABjs was Kyle Simpson, or getify, as you've probably seen streams of consciousness fly by your Twitter stream from him... Really bright dude, but I definitely did not expect a 3.0 or any late updates to the script loader entries. So yeah, 3.0 is in the works... I think it actually is somewhat in relation to actual standards that I've gotten through.
Kyle did some work with the standards bodies to do some of the async false stuff, in order to guarantee in-order async loading... So if you inject a script with async false after the DOM was already loaded, it means that it must execute in order, and that is like a thing now.
It's a thing.
Yeah, I think yeah.
Alex gets to say when things are things.
I believe him.
If he says it's a thing, it's a thing.
If he says it, okay...
Yeah... But specifically, <link rel="preload"> Another one of Paul's co-workers, Eric Bidelman, recently tweeted about <link rel="preload"> for scripts and styles landing. So you can preload critical resources... But you can also do that with service workers and stuff too, so choose your tools wisely.
But yeah, I thought it was interesting... A little LABjs update for everyone, in 2017.
Next up, we were going to have "Paul Irish's jQuery anti-pattern for performance of the week. Whump-whump!" Yeah, whump-whump is correct, because I think Paul just decided that jQuery is the anti-pattern for performance of the week...?
We'll move on quickly... [laughter] Next up is a less oft used segment that we add in yayQuery, called "the yayQuery beginners corner", and I would implore us to not sing this one... Okay, Adam can sing it. [laughter]
Jonathan Neil is dying somewhere in the JS Party Slack.
I think he started an octave too high... [laughter]
Yeah, also a shoutout to Jonathan Neil for all the music that hopefully you're hearing again... There's a band camp with all of this music out there from John.
Yeah, just google "John Neil band camp", and all the music is right there; it's so good.
Yeah. I remember back in the day, we were like "Hey, John, you had written some jQuery song once... Do you wanna do a theme song for us?" and then a day and a half later he's like "Here's 21 songs..." [laughter], all of different lengths, all perfectly recorded, for segments you didn't even know you had yet.
With like Dan's Beachboys-esque vocals... It wasn't just like he turned on his tape recorded and let his melodica rip... [laughter]
Bizarre in how fast and good the turnaround was on that.
Amazing... Truly amazing.
Anyway, let's get into the beginner's corner. Rebecca, I think you were talking about...
Yeah, this was always my segment, of like "say things that maybe you didn't know."
It's a different segment, actually.
The things you maybe didn't know - that's the hiddenhancement... [laughter]
Is this the throwdown here? [laughter]
Yes, he did! [laughter]
So check it out, it's 45 minutes or so long, but it was super approachable. I sat in a room with a bunch of other devs watching it, and could see them like "Oh, I get it now...", so I highly recommend it.
On the topic of Webpack - I do some Webpack work and have configured some crazy Webpacks in my day, but there's some of it that's weird, right? Does anyone fully get why it's query parameter based configuration in parts? Is there a reason for that?
It's like anything else -- somebody needed something, so somebody wrote code to make that thing; it wasn't like a design review behind it, I imagine, like "Here's how we should do it." [laughter] But you don't have to pass it -- the query parameters are a nice, string-based way to express configuration, but you can also set those as an object in the loader config on your Webpack config.
I don't now, it's a cool hack... Do you wanna write JSON strings by hand?
No, right? So query strings - here we are.
I added something to this section too, so I might as well mention it. I think everyone shared it a million times, but if you ever wanna learn Redux, I really like the Getting Started With Redux course on Egghead.io from Dan Abramov, who wrote Redux. It's very good. He takes you through the concepts of Redux by more or less building Redux for you; that sounds actually way scarier, but he's like "Let's do this thing where we have this very simple thing; it turns out we need this tool" and then he builds that tool in front of you. He's like "Yeah, it's already in Redux." It's kind of a good way to do it.
Can I say something about Redux?
You might not need Redux.
Do you have a web page for that?
I don't, but I will by the time this podcast is over.
"I will by the time my company sponsors need to write one, so that we get some sweet marketing buzz." [laughter]
No, we were rewriting a thing on [unintelligible 00:42:54.08] that I can't really say much more about, but we were rewriting it and we were using Preact and Preact Redux and Redux, and I did the Webpack bundle analyzer thing, and it was like 7k of my 21k bundle was for Redux and Preact Redux... And it was like, you know, this is actually really simple and totally not worth one-third of our bundle. We'll just do old school React [unintelligible 00:43:22.03] management, and it's like, it's okay... You don't have to use all these tools.
Just like they did in the articles of confederation... [laughter]
Jeez, the deep hole... [laughter] And I already praised Eddie once in this episode, which is more than enough, but he just informed us of an article written by Dan Abramov, who [unintelligible 00:43:45.21]
Oh yeah, great! "You might not need Redux."
...called "You might not need Redux."
That's a good way to get out ahead of things... Ship something on your own and then write the "You may not need this" post for [unintelligible 00:44:00.18]
For sure. Alright, I think we running up on a break, so... Yeah.
And we're back! One segment that I believe only happened one time - I don't think it was officially a segment, because in the episode we didn't know it would become a segment, because - a lot of becauses in this - Adam intro-ed it. There was some show on The Food Network, Adam...? Throwdown - is that what it's called? Or is it like [unintelligible 00:45:14.24] Exactly! I think Adam and Paul had planned an argument to have, and Adam gave it The Throwdown section, but... I recently got into a pleasant, friendly argument with a friend about function binding in the new world, especially in the world where we're not compiling fat arrows. Fat arrow functions cause a function to be bound to a lexical this. It would be very similar to a function that at the end had a .bind(this), but not exactly, because you don't actually have to do the binding; it literally just uses lexical scope, or whatever... Versus a function that doesn't use "this" inside at all, and also is not a fat arrow and it's not bound, so an unbound function. So there's not such thing as an unbound fat arrow function, because it's always bound to a lexical "this".
This friend was saying that by default now we should use fat arrows that way; everything is always bound to a lexical "this". Let's lint for that, and let's not allow us to use the function keyword anymore. Thoughts?
In the code that I write, I feel like we do this a lot, but not always, but it's because we need the --
So there are a few cases where it's fine, like constructors - there's no constructors with fat arrows, and a few other edge cases. Those would be perfectly fine to lint for. But I can definitely understand the argument where the fat arrow -- like, in my mind, unbound functions are the default, and if you don't use this, why would you bind the function? And I pretty much agree, that was my argument - I'm smart enough to know if I use the word "this"... But let's add the team aspect, and the fact that we already lint for semi-colons and all these other things, but I can definitely see the argument that if everyone just uses fat arrows for everything, then this is always what you expect it to be; even in the unbound case, everything is always bound to a lexical "this", and it kind of like smoothes over maybe that confusing part of the language.
Yeah, that's kind of what I'm saying. I think that we tend to do this anyway, but we don't lint for it, but I think it's more out of laziness that we tend to do it, because it's less typing. Whether we need the "this" or not, we just do it because it's a really handy way to write.
[00:47:58.02] We do this all the time with arrow functions that you pass to map, or something like that; we don't NEED the "this" binding, but it's just a handy way to do it.
Right, yeah. So I guess I lose. It seems like...
But I don't know if there's a reason to do it...
Some of the stuff with fat arrows is inside classes can get a little wonky. You have to do an equals fat arrow rather than do the shorthand, because then things aren't bound to a lexical "this". So there are some tricks and stuff that don't make it super easy, but I don't know... I think I'm kind of sold.
I think that you could rephrase this as like "Kids these days" or "Get off my lawn!".
Sure, sure, sure... Nay Query.
Well, I mean, there's no better time for the kids to get off your lawn than right f****n now. [laughter]
We're gonna have to beep that out, aren't we? Family-friendly podcast.
I think every once in a while we get an explicit tag, so... We'll see. Even back in the day we used to curse -- I mean, not a ton, but a good amount. But how many sparkles and ponies and rainbows were presented definitely did not give a fair indication of the amount of curses [unintelligible 00:50:20.28]
I have one... Somebody's gonna tell me why I'm wrong...
It's the point of having a podcast.
In five years - maybe less, but I don't know how much less - Brave is gonna overtake Firefox.
Brave prediction. [laughter]
For what it's worth, my primary browser has been Brave on mobile and desktop for maybe the last month, and most of the time it's fine.
What's the rendering engine? What's Brave built on?
You knew the answer to that.
No, for some reason I actually thought they built it on Gecko.
No, it's Chromium.
It definitely looks more Firefoxy in a few places, and I dislike a lot of those rough edges, but I think they've got a pretty small team, especially working on that type of stuff, so I forgive them for now.
Yeah, I use it as my primary personal browser, I don't use it for -- like, I have a Chrome for work, that I use for Gmail, but then I use Brave for browsing.
[00:52:00.20] Yeah. I was talking to Brendan a little bit on Twitter about new features... One weird thing, Paul, is that DevTools in Brave can't be doc-ed. It has to be a separate window, because of some -- I think it has to do with sandboxing, or something like that.
Process sandboxing. There's two separate processes, so putting them in the same thing is kind of painful, I guess... But interesting...
Yeah, and they're looking into doing some stuff where you could put Brave as your native runtime - Webkit native, or something like that? Electron - that's the one. Electron is like the Webkit native thing, and some people are looking into getting Brave as the browser that by default is more user secure.
And my last tidbit there is private browsing - it's something that I think users get wrong a lot of times. They think that you can log into your Twitter account in private browsing mode and no one knows it's you... They don't realize that your identity is tied to them a hundred different ways, and just not having your cookies there isn't going to stop literally everyone from knowing your IP address and everything you do. It doesn't force HTTPS - none of those things, so they're looking into doing -- [unintelligible 00:53:33.22] I think has a wiki page on the Brave GitHub for a Thor mode. So when you open up a new tab in private mode, it's Thor-ed. Your regular browser isn't Thor-ed, but if you open up a private thing, they delete all your cookies and there's no -- like normal private mode, but also it runs over Thor... Which I think is kind of brilliant, in the sense that that's what users expect whenever they think about private mode.
I think private really is...
Yeah. I mean, still you can then leak information via a hundred other different ways, but that's kind of on you. The browser actually is doing it's job if they had a Thor private one. I think it'd be really nifty, but also the Thor infrastructure needs some work before that can necessarily become a super reality. Anyways, that was a long time on...
Well, that's my prediction.
Yeah, [unintelligible 00:54:27.26] I don't know if I believe it... Anyone else have a prediction?
I don't know if I believe it either, but...
Yeah, sure. Even if Brave doesn't beat Firefox, I think Brave will influence the other browsers for sure.
For sure, yeah.
I mean, I just think that eventually their coding is gonna get easier on things that are bot keywords - and I don't have any insight into when or how, but it just seems kind of unsustainable. Especially like a generation of people have their primary internet access on their phone, and it's in a world where you're used to having your terminal next to your editor, next to your browser... Like, how do we make this work for people who are primarily developing without that? And maybe -- I can't imagine it's gonna be as bad as it is now, in five years.
Yeah. I also have no idea what it would be, but I guess that is ripe for all you entrepreneurs out there to fail a few times on some touch-something, or other holograms...
The Pinboard guy was just talking on Twitter about how programmers don't think they can be replaced by automation. I wonder -- like, we won't be using keyboards because we aren't doing anything at all... [laughter]
[00:55:53.08] I was gonna throw out a prediction along those lines, which was that more basic web design is going to be handled by our AI overlords. And especially, it makes a whole lot of sense with Wix and Squarespace etc. to be using -- whatever that startup is that I think didn't really...
Yeah, it failed. It's like the AI-generated...
Was it The Hive, or something?
It was like The Grid.
The Grid, yeah. There you go. And I think that the idea is compelling and would actually work for a bunch of websites. That would work for a lot of small business and all those sorts of things, but we'll see.
It was a failed startup, but my manager - I feel like they sort of had a cool idea that maybe will work in the future. It was user testing with AI - kind of matched those two together. So rather than writing your tests, it's like an AI knows that there's a button and that it might fill out a form and then do these things and act like a real user would act on a page...
Yeah, that's compelling.
So you could kind of just like give it a web page and then it would use it like a user would use it, rather than... I mean, obviously it'd probably still write other types of tests, but I thought that was kind of cool as an idea.
I think my actual prediction that I was gonna say for this though is that there will be -- like, the React model of things might still be around, but I think my prediction is that it will be React-like, but the underlying technology will be Web Components. So you may author in something that's not Web Components, but I'm betting on it a little bit for performance reasons. If someone can build something with the experience of React and all that stuff, and then... Like, I know some of this already exists and you guys are all gonna send me Tweets or whatever, but something will come along that actually gets people to change their mind. I think it will happen sometime.
I think Alex [unintelligible 00:57:56.26] just kind of tool over your body there for a minute...
Oh... No, it happens for five minutes a day.
Live through me... [laughter] Someone asked a question, Paul, in the JS Party Slack channel, which you guys can all join (changelog.com/jsparty), and you kind of perked up, and I was a little bit interested in why you perked up so much... [laughter] Because the question seemed like a joke. The question was "Why is querySelectorAll() so long?" and then you also mentioned [unintelligible 00:58:39.22] Why is that funny? Do you have a story about that?
Yeah, the question seems pretty valid, because... To go back to our yayQuery roots, it is getting elements and doing things with them. And I write code with querySelectorAll() every single day, so I still do feel the listener's pain... So why they're actually so long - 1) because naming is hard and 2) because standards is hard, so put those together and you always end up with really big names.
But there were conversations on both of these cases, to introduce shorter APIs for them. So taking querySelectorAll() there is a published spec called Selectors Level 2 that has an element.Find and element.FindAll method, which basically are the exact same things as querySelectorAll(), but with one key fix, which is the really weird behavior where you do element.querySelectorAll() and it can actually return an element that is not a descendent of that rooted element that you're using...
...which is really unexpected.
I was like, "Wait, what?!" [laughter]
[01:00:04.02] Yeah, you can do -- I think what it is is let's say that you have this small item container, and then you say querySelectorAll(), and then you pass it a hash ID, and then something else, and it will actually just reach out above this whole item container and return it from another place in the DOM.
So the context doesn't matter...
What if I wanted the context to matter, because that's DOM?
Yeah, exactly. I mean, basically it was a bug in --
Context stopped mattering a long time along now... [laughter]
There was a bug in how they designed the feature, and it just messed it up. I think John Resig has like two blog posts around 2007-2008 saying "Hey, there's this API that's about to come out that has this massive bug", but I guess nobody decided to pay attention and fix it before every browser souped it. So that happened... So Find and FindAll actually fixed this bug.
But it shipped. It exists.
Find and FindAll.
No. Find and FindAll do not exist, other than in a spec, and they're just sitting there in the spec looking so pretty, and it was like "It would be nice to type something a little bit shorter." I was looking into it, and as far as I can tell, spec-wise it's in decently good shape, it's just browsers have not actually committed to -- they just haven't gotten around to it yet, and no one's pressured them.
But is there a different story for Add Event listener?
Yeah, a slightly different story there, which is that there are a lot of conversations around introducing an On method to the element prototype, which would just be nice to shorten things up. And there's some hesitation there from the editor of the DOM spec, who basically says "Yes, it's kind of nice for developer ergonomics", but if we're gonna go and introduce this new method, we might as well introduce some next generation event listening functionality into it while we're at it... So not just copy the exact same API, but handle more observable support for listening to events. So let's wait until all of those primitives exist before we introduce it. And that's kind of been the position for about like seven years, so that's just gonna hang out there for a little longer, I think. [laughter]
For sure... Sounds like it. I think some of my favorite predictions from the channel were that we wouldn't get element media queries, which have been predicted for a really long time; it's the Linux of the desktop of CSS features. For those of you who aren't familiar, you can make media queries based on the size of the entire browser window, but not based on the size of the individual elements. Does that change a little bit with Shadow DOM, does anyone know? I assume you can do media queries inside of a Shadow DOM; or is it like full -- maybe no one knows.
It's not scoped to the Shadow DOM, it's still the full thing. It doesn't change [unintelligible 01:03:22.07]
Still full window... That's rough. Ugh!
I know that the biggest concern - we have people listening who know this better than me. I know the biggest concern with element queries was that doing height element queries can go into a recursive loop and that's a big problem. I actually sit pretty close to one of the CSS spec editors and I was like "Hey, but what if we just do with just the width element query and just ignore height? Because developers don't need it, and it's hard for you guys as spec editors to figure it out, so what about just width?" and he was like, "Yeah, but it's like..." I don't know what he said. [laughter] But that would be ideal.
You did not listen to his response.
I have a suggestion, Paul.
Cool. We normally end the episode with picks - do you guys have picks by any chance? Did any of you do that? I gave you some homework... Anyone have one?
If I say yes, is that gonna be pressure for other people? Or would that just give them time to...
I've got one.
Okay, cool. We're gonna do two picks - Rebecca and Paul - because we're a little bit short on time... So Rebecca, what's your pick?
Cool. Paul, you said you had a pick?
Yeah, my pick is a slide from a presentation that I've picked up on I think the WebDev Subreddit late last night, and I like this...
This is an old joke, for what it's worth, Paul.
This is what?
I've never seen this! Oh my god. Okay, well I'll just tell it, like... Maybe I -- oh... [laughter]
You heard it here first! [laughter] Paul Irish didn't know something before someone else. It happened! [laughter]
It's a cheat sheet for HTTP return codes. Return codes are 100s, 200s, 300s, 400s and 500s. The 100s return codes translate essentially to "Hold on!" So straight up to 100 it's the "You're all good." 200s is "Here you go." 300s - "Go away!" 400s - "You f****d up." and thr 500s - "I f****d up."
... server errors.
Yeah, yeah. Seeing it like that makes it really, really clear.
I feel like somebody just explained a joke to me.
Yeah... [laughs] It made it really clear to me in 1997, remember that joke? [laughter]
We love you, Paul.
Yeah, if you're interested in some of the funnier spec stuff... A lot of people -- the joke that I think I see get made the most... The thing that's reminding me of this is the 418 "I'm a teapot" response, but the spec joke that I see made the most is that HTML should add a sarcasm element to the specification, right? You guys see that one all the time. I think GF3 had a tweet about it. It's in there, there is a sarcasm element; it's in the spec, go check it out.
Yeah, that's official; a sarcasm element.
That kind of gets us into a trick though, because they did reply to GF3's tweet with "Oh yeah, we should totally add that."
I'll find a link, or whatever. Maybe I'm wrong... Me and Paul could both be wrong at the end of an episode, or whatever. [laughter]
If people wanna stay up to date with the freshest WebDev memes and jokes, what they should do is just follow the @IAmDevloper Twitter account. [laughter]
Actually, it got shut down.
Yeah?! Oh, man! [laughter]
[01:07:59.19] Yeah, for those people wondering, there was a Twitter account called @IAmDevloper; it was like a Napoleon Dynamite...
Wait, it's there... It's up though. I see a tweet as of two days ago.
We're just wrong left and right.
It was gone for a while. I saw tweets like...
I'm blocked! @IAmDevloper blocked me. [laughter]
We're all blocked. [laughter That's funny. Yeah, someone was tweeting a celebration on that account being gone recently; I betcha they were blocked, too. [laughter] So never mind... This is a Twitter account that just steals jokes from other developers, and then a million more people favorite it whenever they tweet it without any attribution.
So yeah, my pick was to pick on @IAmDevloper, you joke stealing *beep*. [laughter]
I think we're extremely out of time, but it was lovely getting to catch up with y'all.
Our transcripts are open source on GitHub. Improvements are welcome. 💚