core icon indicating copy to clipboard operation
core copied to clipboard

PreloadRemote should not load shared modules again

Open ScriptedAlchemy opened this issue 4 months ago • 0 comments

Describe the bug

When using preloadRemote, it should verify that the shared dependencies are not already loaded.

If remote category is all it will duplicate chunks loaded already. In this case react is already shared by host, but when hovering on remote, localhost 3002 react is downloaded.

image

In this case, if i hover on remote 2 navigation link, it will call preloadRemote - but preload fetch JS that already is on the page from initial load.

Reproduction

https://github.com/module-federation/module-federation-examples/pull/3833

Used Package Manager

npm

System Info

System:
    OS: macOS 14.0
    CPU: (12) arm64 Apple M2 Pro
    Memory: 294.48 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
    pnpm: 8.6.8 - ~/.nvm/versions/node/v16.16.0/bin/pnpm
    bun: 1.0.7 - ~/.nvm/versions/node/v16.16.0/bin/bun
  Browsers:
    Chrome: 124.0.6367.62
    Safari: 17.0

Validations

ScriptedAlchemy avatar Apr 25 '24 01:04 ScriptedAlchemy