Skip to content

Host application shared modules do not support rspack dynamicImportFetchPriority option #4050

@chenhuang444

Description

@chenhuang444

Describe the bug

As the title suggests, module.parser.javascript. dynamicImportFetchPriority is not supported for the host's shared modules.

The generated __webpack_require__.initializeSharingData factories simply call __webpack_require__.e("chunkId"), without the second fetchPriority parameter. causing shared modules to be loaded with a lower priority.

in the provided repo, a demo can be run by

  1. install dependencies: pnpm install
  2. run demo: pnpm demo
Image

the resulting initializeSharingData does not pass the fetchpriority to __webpack_require__.e, causing shared module javascript requests to run at a low priority

Reproduction

https://github.com/chenhuang444/micro-app-example/tree/demo/module-federation

Used Package Manager

pnpm

System Info

System:
    OS: macOS 14.5
    CPU: (11) arm64 Apple M3 Pro
    Memory: 176.47 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.6 - ~/.nvm/versions/node/v18.20.6/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.6/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v18.20.6/bin/npm
    pnpm: 10.7.0 - ~/.nvm/versions/node/v18.20.6/bin/pnpm
  Browsers:
    Chrome: 139.0.7258.155
    Safari: 17.5

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions