Today’s issue: Existential React questions, speeding up your type-stripping, and coining cool new terms with your favorite EdgeLord.
Welcome to #347.
Evan You and Vite on their way to save JavaScriptTown
No, this doesn’t mean that Evan You joined a climate activist group where they protest big oil by throwing bowls of spaghetti at the Mona Lisa.
I’m talking about Vite’s new Environment API, which just landed with experimental support in last week’s Vite 6.0 release.
How we got here: Historically, Vite has assumed only one bundle for the browser and one for SSR, and the SSR bundle was assumed to only run on Node.js.
That used to cover the vast majority of use cases, but times are changing – nobody wants to fight over TVs on Black Friday anymore (sigh), and lots of next-gen runtimes and frameworks have popped up that don’t work particularly well with Vite.
That’s where the Environment API comes in. It lets framework authors create as many environments as they need within a single Vite server, so they can map the way their app works in production.
And depending on which techno-tribe you’ve pledged your undying fealty to, this could be a pretty big deal:
Vite can now run on Deno, Bun, workerd, and other runtimes besides Node.js, and it can also bundle for those runtimes.
Developers can now construct Vite environments for frameworks with more specialized runtimes, like React Native and Electron.
It enables a smoother Vite integration with RSC apps, which often need to handle up to three different bundles.
Bottom Line: The Environment API is all about making Vite more flexible for the entire JS ecosystem and setting it up for its next phase of growth. And considering the fact that Evan You & Co. just raised a $4.6 million seed round, that’s probably a smart move.
Your whole team waiting on a ridiculously long QA cycle
There are lots of QA services out there promising to save your team time and money – so what makes QA Wolf different?
It’s the results they get for their customers:
5x faster impact, thanks to their AI-native platform that lets them create, maintain, and run Playwright tests 5x faster than anyone else.
15-minute QA cycles for all their customers’ teams (on average), thanks to unlimited parallel runs on their infrastructure.
$10k/month saved per engineer for the average customer (see case studies).
Most coverage per dollar, because QA Wolf charges for test coverage, not labor hours.
Set up a personalized demo – and see why an engineering leader from Salesloft said, “I’ve been doing QA and test automation for 25 years and have never seen anything like QA Wolf.”
We are expert US-based consultants who have specialized in high-quality React Native development since 2015! Hire us to build, optimize, deploy, and support your React Native app.
In the code snippet below, what do a
and b
evaluate to?
let a = 0;
const b = [1, 2, 3, 4, 5].map((x) => (
(a += x), x * x
));
console.log(a) // ?
console.log(b) // ?
We’ve opened up the first lesson of our React Query course – Why React Query?
Harry Roberts wrote about his strategy for using data attributes and the new speculation rules API to improve performance.
Codecov just released a new set of tools that call out flaky tests and tell you exactly *why* a test failed, all in the PR comments. [sponsored]
Nadia Makarevich wrote about existential React questions and a perfect modal dialog. Because aren’t we all just specks of dust on a rock floating in space while trying to avoid unnecessary re-renders?
Chris “EdgeLord” Thoburn wrote about an alternative approach to using SSR and RSC that he’s calling EdgePipes.
Kilian Valkhof makes the case for using the autofocus
attribute responsibly.
Datadog created this Front-end developer kit with a few solid resources to help you troubleshoot front-end issues more efficiently, including Best Practices Guides for improving front-end testing, a solutions brief for proactively catching issues, and more. [sponsored]
Playwright v1.49 features Aria Snapshots, a new way to do accessibility testing.
TypeScript contributor and TC39 delegate, Ashley Claymore, spoke about an innovative compilation technique for TypeScript that can speed up the type-stripping process.
Sunil don’t-call-me-Descartes Pai is spending the holidays wrestling with some deep philosophical questions like, “What is a computer, actually?” You’ll have to read his post on Durable Objects to find out. That turkey got everybody thinking big thoughts last week, damn.
Here’s the code with more descriptive variable names.
let sum = 0;
const squares = [1, 2, 3, 4, 5].map((x) => (
(sum += x), x * x
));
console.log(sum) // 15
console.log(squares) // [1, 4, 9, 16, 25]
This is a fun one. The weirdest part is probably the comma ,
operator.
If you’re not familiar, ,
evaluates each of its operands (from left to right) and returns the value of the last operand. This allows us to, in a single line, increase sum
by x
and return the square of x
. When finished, we get the sum
of the array as well as a new array of squares
.