-
Chemistry for the Biosciences
For many years I knew almost nothing about chemistry. I have a fairly good physics background, I know how atoms look like, the nucleus, electrons, orbitals, we even solved the quantum mechanical equations for hydrogen atom in college. But that’s all, I didn’t know anything beyond that. Recently I decided to fix that and read…
-
Prefer Jest real timers when testing with React Testing Library
When testing React components with Testing Library, we should always be using real timers. Fake timers should be a rare exception. Let me offer some reasons why. The philosophy of Testing Library is that it runs your React code in an environment as close as possible to the browser. React components are rendered using the…
-
What’s the point of generators and controls in @wordpress/data?
At the end of the Motivation for Thunks post we arrived at a thunk function that fetches stuff from a REST endpoint and stores it into state by dispatching an action: This is a good JavaScript function that’s going to do the fetching and receiving, and the return value from the thunk is available as…
-
Motivation for thunks
The redux-thunk package is by far the most widely used middleware in Redux, and now our own @wordpress/data package also supports its own flavor of thunks. Yet the concept of thunks is often poorly understood, the motivation for them is unclear, and they are thought of as something magical. In this section I will show…
-
Best practices for using useSelect() from @wordpress/data
During a recent debugging session where I was trying to discover why e2e tests for code that uses @wordpress/data are failing, I found out that we often use the useSelect hook in a suboptimal way. One that either introduces outright bugs, or is slower and causes more React rerenders than it needs to. In this…
-
The Big Burger Course
Some photos from the burger cooking class I took yesterday at the Prague Culinary Institute. We did four burgers in total and also baked some buns.
-
Hardware effects
Yesterday I attended C++ meetup regularly organized by Avast folks in their Prague offices. There was a great talk by Jakub Beránek, a talented CS student from Ostrava, about observing performance effects that the internal CPU architecture has on your code. In this awesomely organized and documented repo, there are C++ benchmark programs that demonstrate…
-
Mental load of invisible work
I really enjoyed reading this article on mental load of invisible work on the Trello blog. I’d never expect such a great read on a content marketing site. And the comic about household chores that’s mentioned there is so spot on.
-
Optimizing JavaScript code for JITs
Here is an awesome article about optimizing JavaScript code for JIT compilers. Describes techniques on how to extract information on where V8 spends time, and most of them are surprisingly accessible to someone with little optimizing-compiler skills. Then Shu-yu Guo retweeted it with a link to their paper about Optimization Coaching in devtools. There is…
-
TIL: editing messages in Slack
It’s trivial — but I just learned how to insert a newline into a Slack message I’m writing: it’s Shift-Enter. I’ve been using Slack for years without knowing the information on this page.