Comments on: How I Write Custom Elements with lit-html https://frontendmasters.com/blog/custom-elements-with-lit-html/ Helping Your Journey to Senior Developer Mon, 29 Dec 2025 16:02:09 +0000 hourly 1 https://wordpress.org/?v=6.9 By: Chris Coyier https://frontendmasters.com/blog/custom-elements-with-lit-html/#comment-51716 Mon, 29 Dec 2025 16:02:09 +0000 https://frontendmasters.com/blog/?p=8102#comment-51716

There is a much more concise way to define the above example which involves auto accessors and decorators. Unfortunately, CodePen only supports TypeScript 4.1.3 as of writing, so I’ve opted to just use long-hand syntax in the example. An example of the accessor syntax involving signals is also shown in the signal-polyfill proposal.

True. But of course I had to use CodePen 2.0, which has a much more modern TypeScript, to get stuff working with auto accessors and decorators.

https://codepen.io/editor/chriscoyier/pen/019b6ac4-cd0c-74a6-ae06-6aee8750c99f

]]>