When exactly is a script loaded and when is it executed? How do the async and defer attributes affect it? What about modules? This overview/cheatsheet sums it up nicely: The cheatsheet was extracted from this tweet by Addy Osmani
A rather geeky/technical weblog, est. 2001, by Bramus
script tags
Nice post comparing these three approaches and detailing why you should use the version with hooks. // #1 – Hooks const MyComponent = () => { const mousePosition = useMouse(); // mousePosition.x, mousePosition.y } // #2 – Render Props const MyComponent = () => { return ( <Mouse> {({ x, y }) => { // …
Continue reading “React: Hooks vs. Render Props vs. Higher-Order Components”
Recently I was invited as a speaker to Full Stack Ghent and PHP-WVL. At both events I brought a new talk called “Going Serverless with Google Cloud Run”. Cloud Run is a fully managed compute platform by Google that automatically scales stateless containers. By abstracting away all infrastructure management, us developers can focus on what …
useDeepCompareEffect Hook: A useEffect using deep comparison
A custom Hook by Kent C. Dodds (who else?) that might come in handy for “those situations”: React’s built-in useEffect hook has a second argument called the “dependencies array” and it allows you to optimize when React will call your effect callback. React will do a comparison between each of the values (via Object.is) to …
Continue reading “React useDeepCompareEffect Hook: A useEffect using deep comparison”
Chris Coyier wants to create a Card Component in React. But then he suddenly finds himself down the rabbit hole: how flexible does he make it? What is configurable and what is not? Where to draw the line? It sounds very familiar, as I’m always pondering over things like this when writing libraries/reusable things in …
Continue reading “Component Variations: Considerations for Creating a Card Component”
Apart from the quite well known prefers-color-scheme and prefers-reduced-motion features, the Media Query Level 5 spec comes with a few more new ones. The Media Query Level 5 spec is being drafted as we speak, and it includes some really nice ones. Some of them are still being figured out, but several of them are …
I like this review of the Mac Pro by The Verge. Very nuanced, something you don’t come by often these days. In short: It’s a hell of a machine which costs a ton. Adobe’s software is not taking advantage of all of the machine’s power. The XDR Display might or might not work for you. …
Late January Puppeteer 2.1.0 got released, with native support for Firefox: The launcher now has an option to run Puppeteer with different browsers, starting with Firefox. Puppeteer can now talk to a real, unpatched Firefox binary. This is a first step towards eventually deprecating the separate puppeteer-firefox package in favor of supporting Firefox directly in …
Continue reading “Puppeteer 2.1.0, with native Firefox support”
Intl.DisplayNames
An ECMAScript Internationalization API Feature that currently is in Stage-3 and that has already landed in V8 version 8.1 is Intl.DisplayNames. It’s a way to get localized display names for languages, scripts, regions and others. The idea is that you as a developer should not build your own list of localized strings for languages, regions, …
Continue reading “ESNext: Get localized language, currency, and region names with Intl.DisplayNames“