The Missing Link for Web Components
If your project uses web components of your own making, you could be auto-generating a Custom Elements Manifest that can be ultra-helpful, like powering a VS Code language server.
If your project uses web components of your own making, you could be auto-generating a Custom Elements Manifest that can be ultra-helpful, like powering a VS Code language server.
Holy cow there are a lot of JavaScript engines. These are the big ones like V8 that Chrome uses or JavaScriptCore that Safari uses, but also purposefully lightweight engines like QuickJS for “embedding”. (I’m also just realizing that domains like this, zoo.js.org, anybody can have because js.org is literally for JavaScript-based projects and you can […]
Huh. Today I learned (from Alex MacArthur): you can access the current <script> element from a script (if it’s not type=”module”) with document.currentScript. Meaning you can put configuration data as attributes on it and pluck them off and use them. Like:
Mousing over an element and watching it tilt in 3D space is a beautiful and compelling effect. Let’s bring it to mobile and use the phone itself rather than a cursor.
Despite some not-great recent news about security vulnerabilities, React Server Components (RSCs) are likely in pretty high volume use around the internet thanks to default usage within Next.js, perhaps without users even really knowing it. I enjoyed Nadia Makarevich’s performance-focuced look at them in Bundle Size Investigation: A Step-by-Step Guide to Shrinking Your JavaScript. The […]
Bramus wrote this almost a year ago, but I’d still call it a relatively new feature of JavaScript and one very worth knowing about. With Node.prototype.moveBefore you can move elements around a DOM tree, without resetting the element’s state. You don’t need it to maintain event listeners, but, as Bramus notes, it’ll keep an iframe loaded, animations […]
You can use a smaller part of Lit to build web web components that still take advantage of some of it’s best features, particularly if you’re cool with Light DOM.
Matt Smith with wonderfully straightforward writing on why default parameters for functions are a good idea. I like the tip where you can still do it with an object-style param.
A satisfying little rant from Justin Fagnani: Stop Using CustomEvent. One point is that you’re forcing the consumer of the event to know that it’s custom and you have to get data out of the details property. Instead, you can subclass Event with new properties and the consumer of that event can pull that data […]
Alex MacArthur shows us there are a lot of ways to break up long tasks in JavaScript. Seven ways, in this post. That’s a senior developer thing: knowing there are lots of different ways to do things all with different trade-offs. Depending on what you need to do, you can hone in on a solution.
Frontend Masters donates to open source projects through thanks.dev and Open Collective, as well as donates to non-profits like The Last Mile, Annie Canons, and Vets Who Code.