timdaub pfp
timdaub
@timdaub.eth
Kiwi News bundle.js. It's sadly 2MB big and I'd like to reduce its size. But I don't see any obvious optimizations.
9 replies
1 recast
2 reactions

Joe Toledano pfp
Joe Toledano
@joetoledano
Can you migrate from Ethers to Viem?
1 reply
0 recast
0 reaction

timdaub pfp
timdaub
@timdaub.eth
I‘m open to it but what are the consequences and what do I gain?
1 reply
0 recast
0 reaction

Joe Toledano pfp
Joe Toledano
@joetoledano
Outside of the time to migrate, would check to see if there's any gaps in coverage for how you currently use Ethers (migration guide: https://viem.sh/docs/ethers-migration.html) but you'd likely see some benefits from a bundle size & performance standpoint: https://viem.sh/docs/introduction.html#bundle-size
1 reply
0 recast
1 reaction

timdaub pfp
timdaub
@timdaub.eth
I feel a bit sad for @ricmoo also: Why migrate from ethers, it's a good lib no?
2 replies
0 recast
1 reaction

Joe Toledano pfp
Joe Toledano
@joetoledano
Ya I mean ethers is great, but we made that change b/c of the performance/bundle improvements offered. I mean, to your original question about ways to lower your bundle size, this is seemingly an opportunity, but also totes agree that there's costs involved with making that change
1 reply
0 recast
0 reaction

RicMoo.eth pfp
RicMoo.eth
@ricmoo
I’m also curious how much the bundle size changed? Ethers aggressively supports tree-shaking (using file boundaries, which works even with older, less advanced bundlers too ;)). So it shouldn’t have included things you didn’t need…
1 reply
0 recast
1 reaction

Joe Toledano pfp
Joe Toledano
@joetoledano
Hrm so will take a bit of time to recreate the same conditions to compare and contrast will try to follow up here
1 reply
0 recast
1 reaction

RicMoo.eth pfp
RicMoo.eth
@ricmoo
That sounds like a lot of work for a data point. I was just curious if you knew it off-hand. :)
1 reply
0 recast
0 reaction

Joe Toledano pfp
Joe Toledano
@joetoledano
No worries! Just checked some logs and there was around a 67 kB reduction in the First Load JS directly following the change. This was done in conjunction with upgrading Wagmi and Rainbow though, so it may not be a 1-to-1 comparison.
1 reply
0 recast
1 reaction

timdaub pfp
timdaub
@timdaub.eth
https://warpcast.com/timdaub/0xe2d533
0 reply
0 recast
1 reaction