Skip to content

angular 项目实现热插拔功能 #175

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

Open
lee-200 opened this issue Mar 2, 2022 · 4 comments
Open

angular 项目实现热插拔功能 #175

lee-200 opened this issue Mar 2, 2022 · 4 comments

Comments

@lee-200
Copy link

lee-200 commented Mar 2, 2022

如何在angular项目里面实现热插拔的功能;

@wszgrcy
Copy link
Collaborator

wszgrcy commented Mar 2, 2022

能详细描述下这个功能吗?

@wszgrcy wszgrcy added the 请补充 问题无效,需要改进提问方式 label Mar 2, 2022
@mulining
Copy link

能详细描述下这个功能吗?

热插拔,可以实现无需重新启动项目,即可动态修改你得应用的配置,例如: angular.json 、 tsconfig.json 等配置文件

  1. 在 package.json 文件中添加执行如下命令:
"scripts": {
      ...
      "hmr": "ng s --port 4200 -o --hmr",
      ...
}
  1. 控制台执行
npm run hmr

@lee-200
Copy link
Author

lee-200 commented Sep 16, 2022

能详细描述下这个功能吗?

就是项目部署在现网以后,可以在项目不停止的情况下,更新和卸载某些功能。

@wszgrcy wszgrcy removed the 请补充 问题无效,需要改进提问方式 label Sep 16, 2022
@wszgrcy
Copy link
Collaborator

wszgrcy commented Sep 16, 2022

能详细描述下这个功能吗?

就是项目部署在现网以后,可以在项目不停止的情况下,更新和卸载某些功能。

目前没听说过有这种的功能...
从部署的角度来讲,目前k8s可以实现滚动更新,也就是一部分是旧项目,一部分是新项目,然后等到新项目全启动成功干掉就项目
还有一种就是好像是给js打补丁,多请求补丁包给已经部署的做临时的那种热更新.我记得听过好像是腾讯搞过然后开源了?不过这个功能太鸡肋...估计没人搞

第二种好像就是相当于把所有的脚本当成二进制文件然后打补丁,打完后转换成字符串,解析执行(猜测,毕竟这么蛋疼的功能适用性太小了)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants