doubt it's doable then. i thought it was your own dep
grin
Commented 2 years ago
just delete it all. that site doesn't need any js
timdaub
Commented 2 years ago
actually web3 without JS is sadly not possible but otherwise I‘d do it
Phil Cockfield
Commented 2 years ago
I'm playing a similar code-splitting game with "@farcaster/hub-web" right now! I feel 'ya @timdaub.eth !!!
Bundle size explosion can be like playing whack-a-mole. I find knocking it in the head early is the easiest way as untangling later become disproportionately harder and harder for me to get my head around.
timdaub
Commented 2 years ago
😞
Phil Cockfield
Commented 2 years ago
I'm sneaking up on it! Haven't put any real work into busting that "blood clot" up yet.
Good luck with your bundle surgery! 🫠💪
Matthew
Commented 2 years ago
Are you using Next 13? that’s one alternative idea
also wonder what rainbowkit size v connectkit would be
timdaub
Commented 2 years ago
nope, express and reactjs
notdevin
Commented 2 years ago
I’m kinda digging the way next splits up client and server code, I’ve been trying to go deep on the next app directory designs
Matthew
Commented 2 years ago
same! esp as a designer trying to visualize, I've found the structure really helpful
once I got the hang of the app router I found it to be much better, and far more performant
Joe Toledano
Commented 2 years ago
Can you migrate from Ethers to Viem?
timdaub
Commented 2 years ago
I‘m open to it but what are the consequences and what do I gain?
I feel a bit sad for @ricmoo also: Why migrate from ethers, it's a good lib no?
Charles Yoo-Naut
Commented 2 years ago
Are multiple dependencies loading different versions of BigNumber? This was something that was bothering me but couldn't figure out a good solution
Adrian
Commented 2 years ago
You don’t need to include all of ethers. You can include just it’s sub packages that you use.
Also, consider using something like rainbow kit or connect kit instead of 3 wallet libs
timdaub
Commented 2 years ago
I use connectkit already. And I'm not using ethers at all in my frontend, that usage comes from wagmi and connectkit
wizzard
Commented 2 years ago
i think native bigint is available pretty much everywhere rn?
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.
are you lazy loading? eg loading connectkit lazily when needed since it's massive
I switched to script defer now
@colin but I don‘t do code splitting, should I? It seems like massive complexity increase
not sure what your stack is, but code splitting using NextJS isn't very challenging using dynamic imports and can improve first-load JS size significantly. I wrote about this a while back: https://paragraph.xyz/@blog/how-we-reduced-next.js-page-size-by-3.5x-and-achieved-a-98-lighthouse-score
https://www.framer.com/motion/guide-reduce-bundle-size/
npm ls framer-motion web@0.0.0 /Users/timdaub/Projects/attestate/kiwistand/src/web └─┬ connectkit@1.2.4 └── framer-motion@6.5.1 hehe
@pugson more work: https://github.com/family/connectkit/issues/231
doubt it's doable then. i thought it was your own dep
just delete it all. that site doesn't need any js
actually web3 without JS is sadly not possible but otherwise I‘d do it
I'm playing a similar code-splitting game with "@farcaster/hub-web" right now! I feel 'ya @timdaub.eth !!! Bundle size explosion can be like playing whack-a-mole. I find knocking it in the head early is the easiest way as untangling later become disproportionately harder and harder for me to get my head around.
😞
I'm sneaking up on it! Haven't put any real work into busting that "blood clot" up yet. Good luck with your bundle surgery! 🫠💪
Are you using Next 13? that’s one alternative idea also wonder what rainbowkit size v connectkit would be
nope, express and reactjs
I’m kinda digging the way next splits up client and server code, I’ve been trying to go deep on the next app directory designs
same! esp as a designer trying to visualize, I've found the structure really helpful once I got the hang of the app router I found it to be much better, and far more performant
Can you migrate from Ethers to Viem?
I‘m open to it but what are the consequences and what do I gain?
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
I feel a bit sad for @ricmoo also: Why migrate from ethers, it's a good lib no?
Are multiple dependencies loading different versions of BigNumber? This was something that was bothering me but couldn't figure out a good solution
You don’t need to include all of ethers. You can include just it’s sub packages that you use. Also, consider using something like rainbow kit or connect kit instead of 3 wallet libs
I use connectkit already. And I'm not using ethers at all in my frontend, that usage comes from wagmi and connectkit
i think native bigint is available pretty much everywhere rn?