Kevin Porten retweeted
⚛️ I can't emphasize enough the power of composition in React.
Props are not the only way to customize components, you can use composition to tweak the layout and elements you want to show within a composed component ↓
Kevin Porten retweeted
Node.js 21 is now available! Node.js 20 is being promoted to long-term support (LTS).
Main updates:
⚡ V8 JavaScript engine updated to 11.8
🤝 Stable WebStreams
🧪 A new experimental flag to flip module defaults
🏃 Updates to test runner
hubs.la/Q025HG8t0
Kevin Porten retweeted
Tired of writing if statements every time you need to check if something's defined?
Make a little 'raise' function to throw an error, and inline it with a nullish coalescing operator.
Thanks to @heyImMapleLeaf for this one.
Kevin Porten retweeted
💻 The expand, migrate, & contract pattern
People often ask us what should come first: application code changes or schema changes. The answer is a little complex, but important to understand if you want to ship no downtime and backward compatible schema changes.
Let's dive in.
Kevin Porten retweeted
Change Array By Copy ➡️ now supported by all browsers! 🥳️
Firefox (last one) recently added support in v115
Super useful for React devs and state updates! ⚛️
New convenient Array methods to update arrays in an immutable way 🙌:
- toSorted
- toReversed
- toSpliced
- with
Kevin Porten retweeted
Can you believe these slides are full page loads to completely new HTML pages‽
#smashingconf
smashing-transitions.netlify…
^ try it with Canary and enable the flag chrome://flags/#view-transition-on-navigation
what. rad. tech. 🤯
Kevin Porten retweeted
🔥 JavaScript import maps are now in all the browsers! Here is how they work with ES modules.
Kevin Porten retweeted
Stage 1 🔥
teapawt.net/robpalmer2/status/1638…
ECMAScript excitement 😉
Congrats to my coworker @acutmore @TechAtBloomberg on advancing the Await Dictionary proposal to Stage 1 @TC39 🎉
Promise.all returns positional results as an array. This proposal will allow named results inside an object 👍
Kevin Porten retweeted
Useful trick if you ever need to use inline styles because a value is coming from the database or something but also need to change those styles on hover or similar —
Use those values to set CSS variables using inline styles, then use arbitrary values to read the variables 🧠
Kevin Porten retweeted
CSS Tip! ✨
Create that little shiny border movement 👀
It's a rotating conic-gradient that you flip halfway with some interesting easing 🤓
animation: flip 2s infinite steps(2, end);
@ keyframes flip { to { rotate: 360deg; } }
We're gonna go through it now 👇
Kevin Porten retweeted
2023 State of Databases for Serverless & Edge
An overview of 30+ solutions and emerging trends ↓
Kevin Porten retweeted
CSS Tip! ✨
You can't nest :has()
But, you can chain it! 💪
For example, this rule says a "to" and "from" are checked in the form 📅
.cal:has([id*=from]:checked):has([id*=to]:checked) {
...styles
}
Got wild pushing limits for this one though 👀
@CodePen link below! 👇
Kevin Porten retweeted
Wow, that’s impressive! The Wix team has edited 7643 error messages to design clear, helpful, respectful and inclusive messaging and error handling. wix-ux.com/when-life-gives-y… #ux #design
Kevin Porten retweeted
TIL Chromium ships a `scheduler` API to break free the main thread. 👏
@malchata describes it in great detail. 👇
web.dev/optimize-long-tasks/

ALT function saveSettings () { // Validate the form at high priority scheduler.postTask(validateForm, {priority: 'user-blocking'}); // Show the spinner at high priority: scheduler.postTask(showSpinner, {priority: 'user-blocking'}); // Update the database in the background: scheduler.postTask(saveToDatabase, {priority: 'background'}); };



















![Code: const useFirstName = () => { const [firstName, setFirstName] = useState(""); return [firstName, setFirstName] as const; };](https://pbs.twimg.com/media/Fob46NoXsAM70wf.png?name=small&format=webp)




