#buildWithLit

TonySpegeltonyspegel
2024-12-22

Friends and I share a car and sometimes you forget where you have parked it. That's why I've programmed a little web app to help us 😊

Built with: PWABuilder, Lit Web Components, Material Design 3 Components and for the first time also @lit-labs/signals

This is a car-sharing app map, displaying parking zones: unselected zones are red, the selected zone is purple. The dropdown, located at the bottom right, shows "Weigelstraße" as the active Parkzone. The map indicates the car was parked on the displayed date, 22.12.24, with a refresh button next to it.
🧿🪬🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸schizanon
2024-04-04

One thing about web components that seems to take some people a while to grok is that a WC library like Lit is just an implementation detail, and from the outside it's all just standard HTML/DOM.

ie, you don't need to use Lit to instantiate Lit components. Plain DOM APIs work.

2024-02-25

How I implemented #webmentions rendering on my #weblog? I prototyped it with lit-html #buildWithLit then I reimplemented it as a reusable #webcomponent. More in this blog post: rarous.net/weblog/2024/02/25/z

Thomas Broyertbroyer@piaille.fr
2024-02-25

Announcing Platformer: a set of libraries to help implement:

• attribute reflection in web components following the HTML specification
• WebIDL type coercions for your public JS APIs (including web component properties)

github.com/tbroyer/platformer

Comes with ECMAScript decorators (compatible with TypeScript 5.2+ and Babel) for vanilla custom elements and Lit elements.

Currently not published on NPM (as I'm still evaluating whether all of this is a good thing worth pursuing 😂 feedback welcome!)

#webdev #WebComponents #buildWithLit

Thomas Broyertbroyer@piaille.fr
2024-02-05

⬆️
Updated my post following those tests, as some code samples were wrong and I learned a few new things writing the tests:

blog.ltgt.net/web-component-pr

BTW, also added FAST implementations to the test.

#WebComponents #buildWithLit #FASTDesign

Thomas Broyertbroyer@piaille.fr
2024-02-04

For those interested, I just published on GitHub a series of tests for reflecting attributes in web components (see blog.ltgt.net/web-component-pr for the rationale, I'll update it soon following those tests), reusing the same tests as used by browsers for built-in elements.
Tests include (for now) vanilla custom elements and Lit custom elements.

github.com/tbroyer/custom-elem

#WebComponents #buildWithLit

Thomas Broyertbroyer@piaille.fr
2024-01-21

Built-in HTML elements' properties all share similar behaviors, that don't come for free when you write your own custom elements. Let's see what those behaviors are, why you'd want to implement them in your web components, and how to do it, including how some web component libraries actually don't allow you to mimic those behaviors.

blog.ltgt.net/web-component-pr

#webdev #WebComponents #buildWithLit #fastdesign #stencil

TonySpegeltonyspegel
2024-01-03

An experimental web component which can be horizontally swiped to trigger actions.

Based on code by @aerotwist

I've added some new features:
- Uses view-transitions to animate the deletion of items
- Uses pointer-events to unify different input methods
- Is a web component
- Has a "leave behind" indicator for each swipe direction
- It's possible to allow certain swipe directions only

github.com/TonySpegel/swipeabl

Thomas Broyertbroyer@piaille.fr
2023-11-15

@molily @sir_pepe Fwiw, this actually looks a lot like Lit's ReactiveElement: @property and @state-annotated properties become reactive and trigger a call to the update() method where you can update your element the way you want it.
LitElement extends ReactiveElement to render using lit-html, but ReactiveElement can be used standalone.

Btw, ReactiveElement also supports reactive controllers that are slowly spreading to other libraries: github.com/webcomponents-cg/co

poke @justinfagnani

#buildWithLit

Thomas Broyertbroyer@piaille.fr
2023-03-31

Here's a Connect 4 demo with Preact signals and Lit, based on @jaffathecake's one in Preact (piaille.fr/@jaffathecake@masto). Zero update after the first render. All changes are direct-to-DOM.

Most of the code is copied from Jake's demo; I added a small Lit directive to achieve the direct-to-DOM that's integrated into Preact.

lit.dev/playground/#gist=a9590

/poke @justinfagnani

#Preact #buildWithLit

2023-03-26

My base experience with Lit has been OK so far, but integration with and seems to be not great -- as code completion for custom properties doesn't seem to work.

The editor treats the web component as just a plain-old component, with nothing custom (and shows warnings about the properties). My searching hasn't provided a way to add extra typing info.

There are an enormous number of moving parts here .... 😖

lit.dev/

2023-03-26

Anyone here use lit.dev for HTML/web components?

(I don’t know if there’s a hashtag for it)

What’s been your experience? Anything you like better for making the experience of writing a web component just a little nicer with little overhead?

Serhii Kulykovkulykov@fosstodon.org
2023-03-02

Excited to share a presentation around the ongoing #Vaadin #WebComponents #accessibility project improvements. Do check it out if you are interested in #a11y. There's some groundwork being done and that also gets us closer to
#buildWithLit conversion!

docs.google.com/presentation/d

westbrookwestbrook
2023-02-26

@lilPWA I could use some :focus-visible states in the UI. And possibly some focus thrown into the custom context menu. I also wonder if `lit-virtualizer` support custom page sizes... the post content seems to load way after they're on the page.

BUT, it looks pretty nice! Love seeing a powered Mastodon client. 😍

westbrookwestbrook
2023-02-24

Always fun to count the apps across Adobe and their myriad frameworks that are able to leverage opensource.adobe.com/spectrum-

- proprietary internal ones
-
-
- (also, we released our first "public beta" of wrapped elements today 🤫)
-
-
-
- and more!

Can't image it would have been possible if we hadn't chosen as the exchange format by which we could support so many consumers. Looking forward to even more in the future! 🚀

Serhii Kulykovkulykov@fosstodon.org
2023-02-13

Some secrets from the #Vaadin R&D weekly update. Our #designsystem team has been working on really cool stuff lately, including #buildWithLit experiments! Also, do check out eslint-config-vaadin alpha, it's a great #eslint config:

github.com/vaadin/eslint-confi

weekly update summary that mentions eslint-config-vaadin, plus a comment about Lit conversion experiments
Serhii Kulykovkulykov@fosstodon.org
2023-02-10

Today has been a good day. Despite russian missile strikes and rolling blackouts, I managed to deliver experimental versions of 5 #Vaadin #WebComponents using #buildWithLit. Don't tell it to my tech lead!

list of commits with Lit experiments
Serhii Kulykovkulykov@fosstodon.org
2023-01-06

New additions to Web Components bookmarks:

- cypress-lit = #Cypress + #buildWithLit 🔥
- query-selector-shadow-dom by #Webdriver
- Shadow DOM support for Capybara 💎
- Shadow DOM with Java #Selenium

Check out the full list of testing solutions:

webcomponents.today/testing-so

Serhii Kulykovkulykov@fosstodon.org
2022-12-23

#WebComponentsAdvent Day 23: Starter Templates.

If you want to start creating #WebComponents, today's update is for you! Meet the list of starters kits with @vite, #buildWithLit, #vue, #svelte, FAST, Shoelace, other libraries and tools.

webcomponents.today/starter-te

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst