In Chrome, any JavaScript files in a service worker cache are bytecode-cached automatically.
This means there is 0 parse + compile cost for them on repeat visits. 🤯
v8.dev/blog/code-caching-for…
I just rememered what a hassle it used to be not having default parameters in JS. 😱
Now can I please have a nice way of conditionally adding keys to objects when declaring them with literal notation..? 😘
#React reserves the right to evict useMemo-memoization. This means useEffects relying on this can rerun at any render (hence the synchronisation mental model rather than lifecycle).
I wonder how it (will) avoid endless loops when evicting? 🤔
#ReactJS Server Side Rendering (SSR) is a performance bottleneck for web
backends.
@davidmarkclem will demonstrates a very simple solution that can be dropped into pre-existing React applications to vastly improve the throughput of an SSR #NodeJS server: buff.ly/2HfakCk
Me, fetching only on mount: "Trust me, I KNOW these props never change"
useEffect linting: "Prove it to me, add them to the dependency-array"
My app after adding them: "Lemme do an endless loop to prove you got memoization problems"
React Hooks keeps unearthing bugs. 🙏
Been having conversations with many companies this week and it appears React SSR is a major performance and stability issue out in the wild (both server-side and client rehydration). Better tools, methodologies and documentation are desperately needed.
This is usually frowned upon, but given the constraints of Redux and React I think it's currently the best choice, or ergonomics and complexity would suffer. Suspense solves this for data fetching, maybe it does for the normally synchronous cases too? 3/3
Like with data fetching, the first breaks co-location of requirements with components and second isn't friendly to streaming. Since injection is synchronous there is a third option though, injecting them as a side effect during the render phase. 2/3
Dynamically injecting Redux reducers with SSR has a lot of parallells to data fetching. Children rely on data/reducers being available when they render. Just like with data fetching you can hoist reducers so they are known before rendering or have multiple passes. 1/3
Very flattered by the fact that PriceRunner once again has been awarded by Topp 100 2019 as the Best Comparison and Search Site 2019. Outstanding colleagues have done a outstanding job to help consumer discover better products and save money topp100.idg.se/2.39772/1.715…
😮 The CSS Working Group approved CSS Nesting — which now has early Working Draft in Stage 1. Wohooo! 🎉
The following will hopefully soon work in vanilla #CSS.
```CSS
div {
& p {
color: tomato;
}
}
```
🙌 Your thoughts/shares/retweets welcomed!
Really well explained blogpost about closures and how class and function components differ in how they keep values around for later.
I like to call closures ”huggies”; they hug and keep the values close for when needed. Easy to remember what they do and less scary. 🤗