Follow me for more on web dev & frontend content!
Read my full, in-depth blog post here: https://dev.to/michaelsolati/fighting-framework-jank-whats-not-in-the-docs-mj5
Follow me for more on web dev & frontend content!
Read my full, in-depth blog post here: https://dev.to/michaelsolati/fighting-framework-jank-whats-not-in-the-docs-mj5
1. Static Content (SVGs): Use + cloneNode() to offload parsing from the VDOM.
2. Non-Critical JS (Analytics): Use requestIdleCallback() to offload execution from the main thread.
1. Static Content (SVGs): Use + cloneNode() to offload parsing from the VDOM.
2. Non-Critical JS (Analytics): Use requestIdleCallback() to offload execution from the main thread.
It combines both techniques. It's blazing fast because it lets the browser do all the heavy lifting, and React just manages the simple container
It combines both techniques. It's blazing fast because it lets the browser do all the heavy lifting, and React just manages the simple container
That sendAnalytics() call in useEffect is user blocking.
Wrap it in requestIdleCallback().
This tells the browser: "Run this code only when you're free and not busy with animations or input."
That sendAnalytics() call in useEffect is user blocking.
Wrap it in requestIdleCallback().
This tells the browser: "Run this code only when you're free and not busy with animations or input."
Don't make React hydrate a 1000-line static SVG.
1) Put the SVG into a in your HTML.
2) In the code, useRef on an empty .
3) In useEffect, find the template, cloneNode, and appendChild to your ref.
Don't make React hydrate a 1000-line static SVG.
1) Put the SVG into a in your HTML.
2) In the code, useRef on an empty .
3) In useEffect, find the template, cloneNode, and appendChild to your ref.
This is a perf nightmare!
VDOM Bloat: React hydrates 1000s of static nodes.
Blocked Thread: useEffect fires analytics immediately, blocking the main thread.
Result: Stutter, lag, jank.
This is a perf nightmare!
VDOM Bloat: React hydrates 1000s of static nodes.
Blocked Thread: useEffect fires analytics immediately, blocking the main thread.
Result: Stutter, lag, jank.
Sorry for the headache, but thank you for sharing!
github.com/bekriebel/fv...
Sorry for the headache, but thank you for sharing!
github.com/bekriebel/fv...
If you need help, you can hit me up or check out our Slack community, where other developers can help.
docs.livekit.io/home/cloud/n...
If you need help, you can hit me up or check out our Slack community, where other developers can help.
docs.livekit.io/home/cloud/n...