Web Weekly #106
Guten Tag! ๐
Do you notice the performance impact of inline SVGs and are looking for solutions? Do you wonder how to evaluate the performance impact of an npm package? Or are you confused about self-closing HTML tags such as <br> (or is it <br />?) and need to know when to use which?
This week's Web Weekly includes all the answers and much more. ๐ซฃ
You might have noticed that I took a three-week-long Web Weekly break. The main reason was that I traveled to Canada to give a new talk โ Back to boring (part two). And I had such a blast with countless wonderful people! ๐
During the talk prep, I finally made it to play around with view transitions. And this stuff is nothing but incredible. Only a bit of vanilla spaghetti JavaScript (example CodePen) is needed to transition elements from A to B. I can't wait for the web to look smoother than ever before. Currently, they're only supported in Chrome; but let's hope the other browsers agree they're a good idea!

"The new web" isn't about all these Chrome-only features, though. I'm super excited about relative colors in CSS. And if you're using Safari, you can see a color palette entirely generated via CSS on the blog now.

But anyways, I've created many new web stuff demos, and I'll share them one by one in the upcoming Web Weeklys.
Now, let's get into the hottest Frontend stuff of the last three weeks!
Something that made me smile this week

From the department of useless things on the web that spark joy: Stanko Tadiฤ shared how to let a Giraffe walk next to your cursor when filling out forms. ๐ซฃ
Quick links
- For the Gmail users: did you know Gmail works offline?
- Did you ever wonder why
visually-hiddenclasses define a1px โ 1pxsize? Manuel Matuzoviฤ shared the reason. - Suppose you're on macOS: do you use the
caffeinate,networkQualityortextutilcommands? Maybe you should!
Are root container queries a thing yet?

Now that we're having size container queries, I want to reduce my media query usage drastically. Container queries are what we wanted in the first place, right?
I also plan to use container queries on the root element, but unfortunately, I discovered it's not that easy. Miriam Suzanne shares the pitfalls of container queries on the root element.
Be careful with root container queries
A massive bug in the npm registry

The JavaScript ecosystem isn't known for its outstanding security practices, but Darcy Clarke's recent bug discovery is beyond wild.
In a nutshell, you can't trust the package metadata shown on npm.
The leveled-up Node.js testing game

But speaking of the Node.js ecosystem, do you know that Node.js comes with built-in test utilities? Paweล Grzybek published a quick-to-read summary that might motivate you to drop some testing dependencies.
Node 20.4 even comes with MockTimers.
What makes interactions intuitive?

Rauno Freiberg shared tons of UI interactions that make a user interface feel natural. Get ready; there's a lot of eye candy in this post.
The wonderful weird web โ The password game

Neal Agarwal released another fun experiment โ a UI with the hardest password validation rules ever. ๐ How far did you make it?
What are your favorite internet corners? Send them my way, and I'll include them in Web Weekly!
HTML elements referenced in the global window object

Oldie but goldie: do you know that HTML elements leak into the global window object with their id? While this behavior is handy, it can lead to unwelcome surprises. Matteo Mazzarolo describes what you need to look out for.
Be aware of variable shadowing
The problem of inlined SVGs

Jacob Groร reminded me that inlined SVGs come with a cost, and I deployed a fix to my site to get around the "extensive DOM size" Lighthouse warning that's been bugging me for ages!
If you're inlining all your SVGs, this post is for you!
Self-closing HTML tags are mostly meaningless

Jake Archibald published a real banger getting into the argument of self-closing HTML elements, and it's an excellent read with lots of explanations and references.
Suppose you prefer to read a tl;dr; head over to the blog. But disclaimer: this post might affect your worldview. ๐ซฃ
Random MDN โ @counter-style

From the unlimited MDN knowledge archive...
Safari 17 (currently in beta) will start to support @counter-style, which you can use to define... well your list counter styles. It's a tiny thing, but I'm looking forward to it to spice up my lists.
TIL recap โ split separators

Here's some JS trivia: do you know that you can keep the separators when using String.prototype.split? Now you do! ๐
Find more short web development learnings in my "Today I learned" section.
Three valuable projects to have a look at
- privatenumber/minification-benchmarks โ JS minification benchmarks.
- penpot/penpot โ An open source Figma alternative.
- omnidan/node-emoji โ Simple emoji support for Node.js projects.
A new Tiny Helper

pkg-size lets you figure out how much an installed npm package will add to your Frontend bundle. And while it's not the first tool giving this info (Bundlephobia anyone?), I'm sure it's the first to run npm install in the browser. ๐ฒ
Find more single-purpose online tools on tiny-helpers.dev.
Thought of the week

Okay, okay... It might be that Addy Osmani tricked us in his new "The cost of JavaScript" talk, but this probably made-up quote is too good not to include here!
A song that makes you stop coding

I've been listening to Hundreds for a very long time now and "Happy virus" is smooth and chilled electro track that makes me bounce!
This is all, friends!
Writing Web Weekly takes me roughly five hours every week, and I pay real money for sending over 4k emails. If you enjoy it, consider supporting me on Patreon. โฅ๏ธ
Or tell your friends about it:
- Share it on Twitter.
- Forward it to someone who might like it.
If you're not a subscriber, change that! ๐
And with that, take care of yourself - mentally, physically, and emotionally.
I'll see you next week! ๐