nvm install v20
cd home
yarn install
yarn start
Runs on http://localhost:3000
cd home
yarn install
yarn start
Runs on http://localhost:3001
cd server
yarn install
yarn start
Runs on http://localhost:8080
Sample API - http://localhost:8080/products/1
Visit http://localhost:3001
Chrome -> performance tab & reload
-
Notice how the API call doesn't happen alongside remoteEntry or any other bundles. Rather it waits for the Home bundle to be downloaded parsed at the point it reached 'usePrefetch' is where the fetch happens, which is too late!
-
Also notice console logs to determine the order of how things are happening
Thanks!