Too much JS downloaded with simple starter app #466
Replies: 4 comments
-
Hi, thanks for trying it out! Feedback is very appriciated. What's I guess 170kb is mostly due to react libraries. Even with RSC, we still load the full react library. (We really wish react library becomes code splittable...) |
Beta Was this translation helpful? Give feedback.
-
Apologies, that second weird thing comes from a browser extension. A Next.js template app costs only about 70kB on the client. I will be eager to see if Waku can be compressed a bit more. |
Beta Was this translation helpful? Give feedback.
-
is it because of compression on transfer? or do you compare the content size? |
Beta Was this translation helpful? Give feedback.
-
I just published a Running the same build locally with The Waku CLI node server actually added an You can code split assets using React.lazy. I've been finding that very helpful to keep bundles from getting really large. With RSC, you can avoid shipping javascript needed to load and parse data and render html, but if the javascript is also needed on the client, then it's going to get shipped. If you were doing something like loading a markdown parser in the client, then moving that to RSC and avoiding shipping the markdown parser, that's a big bundle savings with RSC. But you may find that RSC doesn't actually shave a ton of client javascript unless you go way in with things like form actions and don't load additional client-side libs. |
Beta Was this translation helpful? Give feedback.
-
Hello team, so happy to find Waku and start experimenting with it!!
When I build and start up the simple starter example, I am surprised to see almost 0.5 MB of JS downloaded to the client. One of the compelling features of RSC for devs is smaller app client bundle size.
I wanted to ask about and index.js file of 170kb (first line) being downloaded on page start/refresh.
But even more surprising is the last line, 234kb of testing-library.js being shipped to the browser.
I ran
yarn build
>yarn start
> openlocalhost:8080
I am still working on my machine only, I guess its different when deployed on a server...?
I might certainly be off track completely, but could you please explain the above points?
Beta Was this translation helpful? Give feedback.
All reactions