Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Use 1 HMR websocket connection for mutilple micro-frontend apps in same page #6807

Open
coder-czw opened this issue Jun 14, 2024 · 1 comment
Labels
feat New feature or request

Comments

@coder-czw
Copy link

What problem does this feature solve?

Scene

  1. I have a single page: https://www.abc.com/
  2. Use rspack run 3 micron-frontend in local:
  • main-app in port 8001
  • a1-app in port 8002
  • a2-app in port 8003
  1. Use qiankun.js to load a1-app and a2-app from main-app
  2. Use whistle to proxy https://www.abc.com/ page resource to local
  3. I wrote the proxy on main-app dev-server for a1-app and a2-app ports

Problem

  1. The hmr websocket connections build failed.
  2. Too much websocket connections

What does the proposed API of configuration look like?

I want my sub-apps hmr can access successfully, it will be better that I can use only 1 hmr websocket to update all sub-apps on the same page.

@coder-czw coder-czw added feat New feature or request pending triage The issue/PR is currently untouched. labels Jun 14, 2024
@coder-czw coder-czw changed the title [Feature]: Use only 1 HMR websocket connection for mutilple micro-frontend apps in same page [Feature]: Use 1 HMR websocket connection for mutilple micro-frontend apps in same page Jun 14, 2024
@LingyuCoder
Copy link
Collaborator

The part of establishing the connection between the client and the server of HMR is not in the webpack/rspack runtime. Usually, they are injected by the dev server. Therefore, different dev servers may have different implementations.

In the future, after rspack 1.0 is stable, we will consider implementing this in rspack-dev-server(internal is webpack-dev-server), but it is not certain whether rspack-dev-server is directly used in qiankun.js. If it is not directly used, the dev server of qiankun.js need to support it too.

@LingyuCoder LingyuCoder removed the pending triage The issue/PR is currently untouched. label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants