And learned that this doesn’t happen with every dep, only with some of them :D
(Is it a bad taste to quote-reply on bluesky btw? I haven’t posted much in a while lol, might’ve missed the memo)
Here’s a case when this breaks:
1) Add a random dependency in Redux that’s used in some random function:
And learned that this doesn’t happen with every dep, only with some of them :D
(Is it a bad taste to quote-reply on bluesky btw? I haven’t posted much in a while lol, might’ve missed the memo)
This happens with fast-deep-equal because it’s 1) written in CommonJS (so it’s not tree-shakable) and 2) doesn’t have `sideEffects: false` (so the bundler cannot ignore the package if its imports aren’t used).
But most packages have one of those :(
This happens with fast-deep-equal because it’s 1) written in CommonJS (so it’s not tree-shakable) and 2) doesn’t have `sideEffects: false` (so the bundler cannot ignore the package if its imports aren’t used).
But most packages have one of those :(
import { compose } from "redux";
console.log(compose);
3) Bundle
4) Boom – fast-deep-equal is bundled, even though it’s not used
import { compose } from "redux";
console.log(compose);
3) Bundle
4) Boom – fast-deep-equal is bundled, even though it’s not used
Here’s a case when this breaks:
1) Add a random dependency in Redux that’s used in some random function:
Here’s a case when this breaks:
1) Add a random dependency in Redux that’s used in some random function:
- sideEffects: false ftw
- don’t bundle a library into a single file for npm. kills shakeability
- sideEffects: false ftw
- don’t bundle a library into a single file for npm. kills shakeability
Logging into the console while it’s closed still works
(But yup, somewhat annoying 🙈)
Logging into the console while it’s closed still works
(But yup, somewhat annoying 🙈)
(which was pretty hard to tell because the only way to tell was to close DevTools lol)
Just opening DevTools makes all timers 5-100× slower, due to the overhead of capturing stack traces. Even if you do nothing else (don’t record performance, etc)!
Guess who accidentally spent a weekend optimizing this 😅
(h/t @paul.irish for explaining why)
(which was pretty hard to tell because the only way to tell was to close DevTools lol)
(“1000 levels deep” might seem like a lot, but it’s pretty realistic with React’s recursivelyTraversePassiveMountEffects. That’s how I ran into it – in TanStack Query!)
(“1000 levels deep” might seem like a lot, but it’s pretty realistic with React’s recursivelyTraversePassiveMountEffects. That’s how I ran into it – in TanStack Query!)
Just opening DevTools makes all timers 5-100× slower, due to the overhead of capturing stack traces. Even if you do nothing else (don’t record performance, etc)!
Guess who accidentally spent a weekend optimizing this 😅
(h/t @paul.irish for explaining why)
Just opening DevTools makes all timers 5-100× slower, due to the overhead of capturing stack traces. Even if you do nothing else (don’t record performance, etc)!
Guess who accidentally spent a weekend optimizing this 😅
(h/t @paul.irish for explaining why)
So I tried to profile this, and apparently setTimeout calls are much (10×) slower if you do them deep within a call stack (eg React’s recursivelyTraversePassiveMountEffects)? bsky.app/profile/did:...
gist.github.com/iamakulov/85...
So I tried to profile this, and apparently setTimeout calls are much (10×) slower if you do them deep within a call stack (eg React’s recursivelyTraversePassiveMountEffects)? bsky.app/profile/did:...
gist.github.com/iamakulov/85...
gist.github.com/iamakulov/85...
Just 100-200 of those in a row (trivial if you’re mounting a bunch of React components that set timers) will easily block the page.
Just 100-200 of those in a row (trivial if you’re mounting a bunch of React components that set timers) will easily block the page.
fresh from @perfnow.nl: it will ship v soon, in Chrome 143 <3
fresh from @perfnow.nl: it will ship v soon, in Chrome 143 <3