4 ms·
I recently tried a hello-world in react. It made ten network requests on page load and probably had a sizable first download. That’s why web pages are so slow
by mixmastamyk 11mo ago
I recently tried a hello-world in react. It made ten network requests on page load and probably had a sizable first download. That’s why web pages are so slow today.
- CooCooCaCha 11mo agoHello world in react is just a few lines of code that mounts a react component to a dom element. There should be zero network requests beyond the initial download of html and js. You’re either doing something wrong or not actually doing a hello world.
- mixmastamyk 11mo agoI don’t know but vite was involved, looks like it was setting up live updates. This is part of the problem, you can’t just include a script apparently.
- iloveplants 11mo agovite adds additional things to your page in dev so that it's easier to debug. when you are running it in production, it is just one js bundle & one css file.
- NewsaHackO 11mo agoWas it in Dev mode?
- afavour 11mo agoThat’s just Vite’s dev mode. I think React is way overused but your example here is a bad one. You just weren’t aware what the dev tool was doing, it has nothing to do with the experience end users will have. It isn’t even anything to do with React.