Skip to content

PezCoder/micro-frontend-prefetch-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Setup

Prerequirsites

nvm install v20

Home setup (acts as remote)

cd home
yarn install
yarn start

Runs on http://localhost:3000

Product details page (acts as host)

cd home
yarn install
yarn start

Runs on http://localhost:3001

Server setup (for mock API)

cd server
yarn install
yarn start

Runs on http://localhost:8080 Sample API - http://localhost:8080/products/1

Steps to reproduce

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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published