Masthash

#customElements

I keep thinking that #WebComponents are the real solution; they provide CSS isolation with #shadowDOM, and would allow third parties to integrate by simply adding <html-elements>.

Trouble is; any #JS you import runs with full privileges on your user's browsers. What's really needed is a sandbox.

I think it may be a job for #Google's #AMP, but that is so poisoned it'll be a hard sell.

#webDev #customElements

Like what if there was a library of #webComponents for building #videoGames?

What if you built #Mario like

<mario-game>
<mario-controls>
<mario-button button=a action=jump>
<mario-level>
<mario-block has=mushroom>
<mario-pipe>

You could build new levels with nothing but #HTML

#customElements

Serhii Kulykov
3 months ago

๐Ÿ“ข #WebComponents in 2023: February update.

- #Safari 16.4 beta release new features
- #Interop2023 for Web Components
- #React and #CustomElements news

https://webcomponents.today/2023-02-update/

Serhii Kulykov
3 months ago

๐Ÿ“ข #WebComponents bookmarks update: #API #design.
If you're already familiar with basics, do check it out.
You'll find some useful tips and things to consider.

#CustomElements #ShadowDOM

https://webcomponents.today/api-design/

Ryosuke Niwa
4 months ago

What else is missing from shadow DOM / custom elements API? Accessibility support needs to be improved and selection API needs to be added but anything else?

#webcomponents #shadowdom #customelements

Serhii Kulykov
4 months ago

๐Ÿ“ข Web Components bookmarks project finally got a proper Home page! ๐ŸŽ‰

- Projects about Web Components that I recommend,
- Other #opensource projects I'm proud to be part of.

Check it out and please #boost to spread the word if you like the project!

My goal is to make it an ultimate knowledge base about #CustomElements, #ShadowDOM and other #WebComponents standards.

https://webcomponents.today

Serhii Kulykov
4 months ago

Upgraded #WebComponents bookmarks to @eleventy 2.0 beta and it went super smooth! Excited about the package-lock.json getting smaller as a result.

Also, added the #rss feed - subscribe for monthly updates on #CustomElements, #ShadowDOM and other related news (there's now a link in the footer):

https://webcomponents.today

Serhii Kulykov
4 months ago

#WebComponents bookmarks got a new category: Testing Helpers! Here you can find a few useful libraries that make #testing #CustomElements and #ShadowDOM easy:

https://webcomponents.today/testing-helpers/

Serhii Kulykov
5 months ago

Did you know that #WebComponents and #React can be used together?
There are several #javascript libraries for it, these two look interesting:

- React Shadow: use #ShadowDOM with React easily;
- Remount: use React components as #CustomElements.

Check out the #frameworks recipes page for more:

https://webcomponents.today/frameworks-recipes/

Serhii Kulykov
5 months ago

๐Ÿ“ข #WebComponents bookmarks now have a Beginner's Guide section! This is a good starting point for learning how to create #CustomElements.

Thanks to @keithamus, @calebwilliams, @passle and @alangdm for great articles on this topic!

https://webcomponents.today/beginners-guide/

Serhii Kulykov
5 months ago
Zacky ๐Ÿฐ Ma
5 months ago

Iโ€™ve been working on a personal open source project in the past couple of months, and spent some time with `DOMTokenList`. Hereโ€™s a write up of what I learned from trying to use it in custom elements. https://marchbox.com/articles/2023-01/using-domtokenlist/ #customelements #webcomponents

Serhii Kulykov
5 months ago

Today's additions to #WebComponents bookmarks:

- <code-block>
- <esri-map-view>
- <mapml-viewer>
- Svelecte

Check out the growing list of standalone #CustomElements:

https://webcomponents.today/standalone-elements/

Serhii Kulykov
5 months ago

#WebKit: Alexey Shvaika submitted a PR to add support for form associated #CustomElements. This change is currently in review, hopefully it will land in one of the next #Safari Technology Preview releases.

https://github.com/WebKit/WebKit/pull/4988

Serhii Kulykov
5 months ago

#WebKit: added support for ElementInternals interface - a great contribution by Alexey Shvayka. This API is a foundation for a few features, including form associated Custom Elements (more on that later).

#CustomElements #WebComponents

https://github.com/WebKit/WebKit/pull/2690

Serhii Kulykov
5 months ago

#WebComponents 2022 year in review thread! Here is a list of notable #CustomElements and #ShadowDOM fixes and other features that landed in the browsers this year, and some proposals currently being discussed and prototyped.

Serhii Kulykov
5 months ago

๐Ÿ“ข The webcomponents.today is now #opensource! ๐ŸŽ‰

- A good old static website built with @eleventy โšก
- Only #html and #css so far, no #javascript ๐Ÿ˜Ž

Using #WebComponents, #CustomElements and #ShadowDOM?
Do check it out! PRs are welcome! โœ๏ธ

Please #boost for more visibility ๐Ÿ™ and give it a star on #GitHub! โญ

https://github.com/web-padawan/webcomponents.today

Serhii Kulykov
5 months ago

#WebComponentsAdvent Day 21: Case Studies.

Today's update is a list of real-world cases and stories shared by different teams who used #WebComponents in production. Do check it out especially if you consider using #CustomElements or #ShadowDOM in your project.

https://webcomponents.today/case-studies/

Rodion Borisov
5 months ago

@kulykov

I'm calling a #CustomElements course with #HerlockSholmes as a mascot, and he'll say his stamp phrase every time exercise solved:

"Elementary!" ๐Ÿ˜œ

Jeffrey Yasskin
6 months ago

So ... I think I have to recommend against using #Lit to build whole websites, because it doesn't seem to support fragment links (https://example/#this-is-the-fragment) well or at all. It's great at building discrete elements without user-addressable parts, but that's not enough for rendering the top level of a whole page.

Tell me I'm wrong at https://github.com/lit/lit/discussions/3524.

#WebComponents #CustomElements

Serhii Kulykov
6 months ago

@vintprox Due to historical reasons, it's more common to use #ShadowDOM with #CustomElements. This is what most of #WebComponents tutorials and articles are all about.

IMO, to some extent it's related to the original Chrome-only V0 proposal being overly complicated. I still remember how weird it was when I first met multiple shadow roots usage in a Polymer 0.5 app that I was migrating ๐Ÿ™ƒ

That said, even today you can attach a shadow root to the <body>. But you probably shouldn't.

Rodion Borisov
6 months ago

#WebComponents, #webdev, and #galaxybrain moment :jeb:

Why don't we just fuse #DataAttributes and #CustomElements? All I see in the Internet is #reinventingTheWheel of getters and setters instead of augmenting *dataset* that can already get/setAttribute for you??? It makes no sense. :KEKW:

Rodion Borisov
6 months ago

Now, you'll probably ask: "Hey, Vint, isn't it better to place your templates for #WebComponents in one HTML file, since it's a standard way to tell editors to parse file?" ๐Ÿค”

What if I tell you there is more than one document, and I would not like to violate #DRY principle? Plus it would further commit #coupling of #CustomElements to page source, effectively losing all the benefits of #encapsulation.

Well, sorry I don't do #SSG to not repeat myself. My client specifically asked for pure HTML.

Aki Rodic
6 months ago

The coolest feature of io-gui is the ability to define appearance of reactive HTML #customelements in #GLSL shader code.

Element's properties and theme variables are all available in shaders so your browser can draw complex and detailed graphics in a single draw call.

Offscreen, io-gui manages a single #WebGL context that renders and updates everything.

For example, here is a slider-2d source https://github.com/io-gui/io/blob/main/src/elements/sliders/io-slider-2d.ts

Serhii Kulykov
6 months ago

Hey #WebComponents folks! Let's share our experiences with using #CustomElements and #ShadowDOM as the State Of JS 2022 survey is now open.

Benny Powers
6 months ago

@ckundo Yes/no
You can't extend both LitElement & HTMLInputElement at the same time. You CAN apply ReactiveControllerHostMixin to HTMLInputElement & extend that, then use it w/ reactive controllers which work with #lit.

BUT since Safari won't implement #html spec, customized built-in elements are a no go. Luckily, new APIs like form-associated #customElements & element internals let you build autonomous custom elements which wrap native controls, forward #a11y features

https://bennypowers.dev/posts/form-associated-custom-elements/

Benny Powers
7 months ago

https://bennypowers.dev/posts/form-associated-custom-elements/

Form-Associated #CustomElements are a new #webStandard by which to build custom interactive form controls like buttons, inputs, checkboxes, etc. They present a path forward for #designSystems and other custom element authors to more deeply integrate with the #web platform. In this post, we'll build a simple FACE to get a feel for the APIs.

#webdev #webcomponents #html #javascript #accessibility #a11y