An internet radio show about the internet starring Dave Rupert and Chris Coyier.

Subscribe on iTunes or RSS

Twitter:

276 Web Components

00:56:48 Download

Show Description

On this episode we're discussing web components, what happens when a project goes wrong, how to teach Javascript from the beginning, and what to do when someone steals your code?

Show Sponsors

Interested in sponsoring?

Time Jumps

Comments

  • ben

    Do we actually need react-like componets for css and js in native browser or React? I don’t really see the requirement on modulising (that a word?) css and js like this for small projects.

    CSS global cascade enabled separation on concerns from html back in the day; do we need to bake it back in and duplicate effort when styling… seems like an issue that may not need solving (although I mostly work on small CMS based sites in small teams)

    • Dave Rupert

      Good question. I think if you’ve ever needed a jQuery plugin, you could probably use Web Components (WC) and modules.

      “`

      “`

      This could replace some “ code. It’s purely syntactic sugar, but also produces readable code and more importantly that “containment” thing we talked about. Small CMS based sites probably need encapsulation less, but WC work like WordPress _partials, except they don’t need to be stitched together by backend, it can all be done client-side.

      Re: react-like components, I think the simplest example is a Shopping Cart Icon. You want the cart icon and price to update when items are added to the cart. Your cart component could look like:

      “`

      “`

      That HTML could be generated by the CMS or programmed to update and calculate every time something is added to the order. Depends on your situation tho but I definitely think it’s a problem worth solving. Resulting in cleaner, much more readable, and maintainable HTML.

      • ben

        Dave, all of those sound ace. I think in my mind the way people have been talking about WC and other modulized systems like react it sounds like everything is becoming sandboxed in this way unnecessarily, but if that’s not the direction and we can use tiny addon syntactical containers, then all is good.

Job Mentions

Check out all jobs over on the Job Board. If you'd like to post a job, you can do that here, and have it mentioned on ShopTalk for a small additional charge.