Optimizing JavaScript packages for tree shaking

Geoffrey Dhuyvetters from madewithlove on how authors of (open source) JavaScript packages can optimize their builds for tree shaking: How do we create a package that exposes both CommonJS & ES modules while making sure we don’t break cross-platform support? Publishing 2 separate packages is an option (e.g. lodash/lodash-es). But there is a nicer, more …

Bash/Shell Autocompletion for Composer

The other day I opened up a PHP project that I hadn’t worked on in a while. No longer remembering which Composer Scripts I had defined for it, I needed to take a peek inside composer.json to see which ones were available to me. Then it hit me: why is there no autocompletion for composer …

Making Future Interfaces: ES Modules

Once again a highly entertaining video by Heydon Pickering. This time he’s tackling ES Modules: how and where (e.g. in which browsers) can you use them? 💁‍♂️ Even if you already know how to ship ES2015 JavaScript to browsers the video still is worth your time, as it’s very fun to watch!

Disable Hardware Media Keys Support in Chrome

A new feature that landed in Chrome 73 is support for hardware Media Keys. Whenever you press one of the play/pause/next/prev buttons on your keyboard, Chrome can now respond to this and will pause/play the actively playing element. Whilst this might be a good addition for many, it doesn’t work me, as I’m constantly playing …

Not your typical map: “Where is all the poop on the moon?”

Ever wondered what the astronauts that landed on the moon did with their waste? Well, they ditched them on the moon itself. It’s been nearly 50 years since the Apollo 11 moon landing. Neil Armstrong’s iconic footprint is still there, undisturbed; there’s no atmosphere, no wind on the moon to blow it away. But the …

Fading out siblings on hover in CSS

Nice one by Trys Mudford: Hover states traditionally run on the element being hovered on (makes sense, right?). But we can also listen for the hover event on the parent element. That’s the crux of this ‘trick’, we fade out all children when the parent is hovered, and attach another hover handler the child, fading …

Tiny Mirror – Mirror your Webcam into the Favicon

Fun little experiment that mirrors your webcam into your favicon. Tiny Mirror → 🔥 The aforementioned favico.js (from 2013!) also comes with a “Webcam video to icon” option. Next to mirroring the webcam into your favicon it also supports badges, videos, etc. 🍰 Looking to display (pie)charts in your favicon? Piecon can do that for …

Direction Aware Hover Effect

A thing I commonly see nowadays are animated lines underneath menus and links: Show Pen One issue with that though: when hovering over an item the animation does not start from the place where you hover, but from a fixed point (here: bottom-center). Try hovering an item from one of its edges and you’ll see: …

Unsafe SQL functions in Laravel

Recently the folks from Spatie released a security update for their laravel-query-builder package. Turns out it was vulnerable to SQL Injection. At the core of the vulnerability is the fact that Laravel offers a shorthand for querying only certain fields of JSON data, but that these do not get escaped when converted to a json_extract …