Masthash

#customelements

Joe Pea
3 weeks ago

@westbrook As in React, Vue, Svelte, Solid.js, and Angular web components?

Or #CustomElements? :)

I hate that #html attrs are the first path we teach people to pass data into #webComponents. They are so dumb; can only be strings, names can't have upper case letters, etc.

#webDev #customElements #web

Brian LeRoux ๐Ÿ’š
2 months ago

"there is no use case for extending built-in elements"

aside form elements, picture element, table element, list element, video element, others I'm probably missing

and no, element internals isn't the solution. it requires boatloads of client javascript to replicate built-in behaviour which is exactly the problem we're trying to avoid these days.

#webcomponents #customelements #webstandards #webkit

Hasan Ali
2 months ago

๐Ÿ“ข New post alert! The latest addition to my Web Fundamentals series takes a deep dive into Custom Elements, marking the beginning of our Web Components journey. My research so far has already changed how I look at frontend UI frameworks like React. Check it out now!

๐Ÿ”— https://dev.to/hasanhaja/web-fundamentals-web-components-part-1-3nlh

#webdev #webcomponents #customelements #html

Ben Hollis
2 months ago

Starting to play around with Lit for a custom element project Iโ€™ve started, but I donโ€™t think I can handle going back to class components after having experienced React hooks. The ability to extract complex behaviors into reusable hooks is just too useful. I would rather avoid class-based code where possible. #lithtml #customelements #WebComponents

@ilovecomputers Another cool thing about Custom Elements is that on Firefox Developer Edition dev tool, you can click the custom elements tab under HTML panel and it will show you codes of that web components, feel like this is what #web shouldโ€™ve been like. People new to custom elements can just poke around the dev tool and learn stuff. Plus, #CustomElements specs is constantly improving. I have been building web app using vanilla web components at my last job, and itโ€™s really fun.

Zacky Ma :favicon:
4 months ago

I wish thereโ€™s a way to assign text node to named slots. Right now you have to use the "defaultโ€ slot to do so, e.g.

```
<my-comp>
<template shadowrootmode="openโ€>
<slot></slot>
</template>

Some text
</my-comp>
```

But sometimes I need to assign different pieces of text to different slots and they don't necessarily need any semantics. Using `<div slot=โ€œfooโ€ role="noneโ€>text</div>` doesn't feel right. Using attributes isnโ€™t always clean either. #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
7 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
7 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
8 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
8 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
8 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
8 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
8 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
9 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
9 months ago
Zacky ๐Ÿฐ Ma
9 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
9 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
9 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
9 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
9 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
9 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
9 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
9 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
9 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
10 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
10 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:

Serhii Kulykov
10 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.