text stringlengths 0 1.36k |
|---|
[91.34 --> 92.18] Yeah. Correct. |
[92.26 --> 92.38] Okay. |
[92.38 --> 100.82] Uh, everyone else seems to be, uh, normal. Um, and whenever we talk to you, it takes you like a long time to reply. |
[100.82 --> 110.38] Well, I apologize. Um, Alex, why don't you tell us what web components are and what the whole deal is with custom elements and what the hell is a shadow dumb? |
[110.38 --> 126.20] Um, um, web components are the web standards, um, version of kind of the, the popular component driven model that people like to develop web applications in today. |
[126.38 --> 137.26] So the best way to think of web components, in my opinion, is to think about the current web platform, um, and think about how the things are implemented behind the scenes. |
[137.26 --> 144.62] So in the past, we've had a button element or a radio button element or a checkbox or a select menu. |
[145.86 --> 160.40] And, uh, in the really early days, this wasn't true, but for the last long time, if you were to go look at the browser implementation of a select box or an input element, it's just HTML, CSS, and JavaScript behind the scenes. |
[160.40 --> 168.68] It's, it's, it's implemented in the web platform, but it's behind this, uh, opaque thing called a button or this opaque thing called a select menu. |
[169.30 --> 177.24] Um, and so because of that, there was this disconnect on what the browsers could offer you versus what, uh, other web developers could offer. |
[177.72 --> 185.16] Um, and because of this, um, we wanted to shorten, uh, and small in that gap. |
[185.16 --> 188.98] And, uh, that's what web components are for. |
[189.18 --> 204.90] So, um, web components are so you could make your own button, um, that has not quite an opaque, uh, of an API, but you, you can make your own components that are standalone that you can pull into a page and use just as if you were using a button or a select. |
[204.90 --> 213.24] You could use the Alex button or the Michael button or the Michael select or the clock or the social widget component. |
[213.50 --> 226.02] So kind of like, uh, the react world or the Ember world where you're making these, uh, discrete components that have their own APIs and then using them, uh, as units, uh, of development. |
[226.16 --> 226.94] You can do that. |
[227.02 --> 228.10] It didn't necessarily come from that. |
[228.10 --> 236.44] It came before, um, I think both of those were super popular ideas, but it certainly has taken a longer ramp time as the standards track normally does. |
[236.80 --> 240.70] We can get into some of the technical implementation details of how this works. |
[241.28 --> 252.28] Um, but I also think you might've mentioned the shadow DOM already, and that's really just the DOM that, uh, exists inside of the component rather than to the developer once they're using your components. |
[252.28 --> 261.46] So if you think about the old button, technically there's a span and a div or whatever inside of there, inside of the button, but that's not exposed to developers. |
[261.70 --> 272.06] And so in that same way, whenever you build the clock, uh, component, you don't have to expose all the different spans and divs and, uh, things inside of your clock component. |
[272.18 --> 277.18] It just is a clock and it's not necessarily like CSS selectable from, from outside. |
[277.18 --> 286.98] So is it just rendering these components in a cleaner way than having to, um, you know, like append all of those other things that exist inside the regular component? |
[287.66 --> 289.56] Well, everything still exists. |
[289.62 --> 296.98] It's like, you could take away the idea of, uh, web components, um, and, and shadow DOM or whatever. |
[296.98 --> 308.20] And it would just be a larger DOM with a lot more stuff in it with a lot more like, uh, like CSS scoping and, and, uh, there's a lot more chance for bleeding together of certain things. |
[308.20 --> 316.38] But yeah, uh, like there's nothing like super special about them, which is why they're so important, I think, for the future. |
[316.38 --> 330.18] Um, right now, uh, a lot of the, uh, like React and Ember model relies on whole massive libraries being able to run and execute and, and stuff prior to be able to see or use anything on the site. |
[330.24 --> 343.74] Whereas these web components can, since they utilize more of the web stack, the web stack can, uh, do a better job of rendering them instantly without, uh, as much work and execution of JavaScript and all that kind of good stuff. |
[343.74 --> 358.24] So it is more of the web platform, um, which isn't to say that like, as time goes on, I think, uh, Ember and, and React can start to kind of merge their different strategies to where you can write React like code and end up with web components. |
[358.42 --> 360.30] Um, which, which I think is totally possible. |
[361.06 --> 361.16] Cool. |
[361.88 --> 370.72] So I'm like trying to read this as you go through, because I've honestly, you know, like I hear the term shadow DOM thrown around a lot and. |
[370.90 --> 371.80] It's a very cool word. |
[372.40 --> 372.74] Yeah. |
[372.74 --> 372.78] Yeah. |
[373.58 --> 375.64] I mean, I could, you have to whisper it. |
[377.06 --> 382.74] It's one of those things that like, if you asked me what the shadow DOM was, I could make up a lot of stories about what it definitely isn't. |
[383.54 --> 396.58] Um, is, is there a way, I guess I'm, I'm, I'm, the site that I'm looking at right now is from the, like the developers.google.com site about, um, the, the primers and getting started with the shadow DOM. |
[396.58 --> 397.58] Um, and they're talking about light DOM. |
[397.58 --> 400.48] Um, and they're talking about light DOM versus shadow DOM. |
[400.48 --> 410.58] Um, and they're showing, you know, um, an example that has a little bit more robust writeup or markup in it for the light DOM version. |
[410.58 --> 417.86] So with the shadow DOM, are you even seeing of the other components? |
[417.86 --> 422.76] If I was going to like use dev tools and inspect it just like out of the box? |
[423.76 --> 423.88] Yeah. |
[423.98 --> 430.36] Dev tools, I think allows you to currently inspect shadow DOM of, of web components, not of native browser components. |
[430.36 --> 438.18] But yeah, kind of the whole, the whole idea is that like you can have a CSS class in, in there called button. |
[438.86 --> 448.22] Um, like it literally just updates all the button tags and that you no longer have to have like a super specific, uh, CSS class name added to that. |
[448.28 --> 449.22] I mean, you probably should. |
[449.36 --> 449.72] Yeah, yeah, yeah. |
[449.82 --> 450.48] Maybe whatever. |
[450.48 --> 454.88] But like the whole idea is that it's completely scoped to inside that web component. |
[455.16 --> 458.56] That way, uh, everybody can style their own web components however they want. |
[458.56 --> 461.24] And there's no worry about collision of those things. |
[461.88 --> 462.28] Okay. |
[462.52 --> 462.78] Yeah. |
[462.86 --> 465.52] I guess that does make a lot more sense if you're thinking of React. |
[466.12 --> 468.46] Especially if you're pulling in components from other people. |
[468.94 --> 477.68] So if so-and-so styled this button and so-and-so styled this clock and whatever, there's like in the React world, there's a, there's a higher chance for collisions. |
[477.68 --> 486.40] And, uh, like the, even like the box model, like one relies on the newer box model, one relies on the, you know, things like that, uh, are going to all change. |
[487.18 --> 487.30] Cool. |
[487.30 --> 492.62] So why is this stuff important to know for people that don't know what it is? |
[493.58 --> 508.38] Um, I think web components, uh, are definitely like, I think it's, uh, unfortunately a longer term vision for the web than it would have been if people didn't make such good user, uh, land libraries to do similar things. |
[508.38 --> 518.64] So I think there's like this very similar world to where we live in alternate universe where React didn't come out and Ember didn't do the component kind of version of their views. |
[518.64 --> 521.40] And web components really takes off. |
[521.40 --> 525.36] I think Polymer, uh, and web components get confused a lot. |
[525.46 --> 532.38] Polymer is kind of like a, uh, a library on top of web components that allows you to, to do a bunch of extra stuff. |
[532.38 --> 541.54] Um, like the React and Ember libraries would kind of offer you, including like building and, and, uh, fallbacks and all sorts of, uh, fun stuff. |
[541.54 --> 560.54] But I think, uh, if we want to get to a world where the web works as well as native applications on bad internet connections, uh, in slow mobile browsers, uh, then I think the web components vision is one of the only ones that literally can do that as well as a native application. |
[560.54 --> 568.12] Because it is using like native, uh, code in order to do the initial renders and it can do layout better. |
[568.28 --> 574.40] It can do less, far less JavaScript execution, um, before it can render and all sorts of things. |
[574.40 --> 582.82] So it's able to utilize the web platform in a much more efficient way, which means that you can serve a wider audience and have a faster, better experience. |
[583.54 --> 583.64] Cool. |
[584.58 --> 590.16] So you mentioned that like, you know, React and Ember and a few people do stuff kind of like this, right? |
[590.16 --> 593.00] Um, well, it's fundamentally different. |
[593.26 --> 593.36] Yeah. |
[593.38 --> 593.50] Yeah. |
[593.50 --> 597.80] But you can like create a class and then you get a constructor that happens when you create these elements, right? |
[597.82 --> 598.54] Which is great. |
[598.80 --> 604.66] Um, and you do, you have ways to do that in all these different abstractions, but you didn't have a way to kind of do it natively. |
[604.98 --> 611.02] Other than the, the CSS scoping stuff, which is brand new, you can't really do that very effectively with tooling. |
[611.12 --> 611.96] It's really, really hard. |
[611.96 --> 619.16] Um, are there any aspects of web components that actually just give you abilities that you just never had before? |
[620.16 --> 631.56] Uh, there are things like people talk about element level media queries instead of like window level and the shadow DOM can kind of give you a, an approximation of that, which is nice. |
[631.56 --> 639.40] Um, trying to think there are different like lifecycle events that like don't necessarily occur anywhere else except for in these components. |
[639.40 --> 645.58] Like a lot of the things that are available to you outside now were created for the purpose of web components. |
[645.70 --> 652.76] Like the template tag was created for the purpose of this as well as the shadow DOM is separate from the, uh, web component spec. |
[652.76 --> 656.12] And so you can kind of use it outside of web components. |
[656.20 --> 657.66] I, I assume, I don't know. |
[657.76 --> 659.70] It kind of can land in browsers beforehand. |
[659.84 --> 660.46] So I assume you can. |
[660.98 --> 663.78] So some things we already use are part of that. |
[663.88 --> 664.64] So I don't know. |
[665.02 --> 667.66] Some of it leaks back into the, the top level. |
[668.16 --> 670.94] Um, I need to look it up, but I'm sure there are a few things. |
[671.84 --> 671.88] Yeah. |
[671.92 --> 676.00] I'm actually using some shadow DOM stuff in it, in a thing that I'm not using web components at all for. |
[676.12 --> 680.24] Um, and it's, it's really useful just for that, that element scoped CSS stuff. |
[680.24 --> 680.68] Yeah. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.