0%

微前端

乾坤一个项目 node_modules 包就 8 个 G……虽然知道是好几个子项目的事…..但是还是挺不爽的…….

一些相关名词

| – |– |
|SSI|server side includes|
|BFF|Backend For Frontend |

一些知识点

  • ReactDOM.unmountComponentAtNode(container) - ref
    从 Dom 中卸载组件,会将其事件处理器(event handlers) 和 state 一并清楚.如果指定容器上没有对应已挂载的组件,这函数什么也不做,如果组件被移除将会返回 True
1
2
3
4
5
6
7
8
9
10
11
12
window.renderBrowser =(containerId, history)=>{
ReactDOM.render(<App history={history} />,
document.getElementById(containerId)) ;

registerServiceWorker();

}

window.unmountBrowse=containerId=>{
ReactDOM.unmountComponentAtNode(document.getElementById(containerId ));

}

qiankun-工具

qiankun-实践

基于 qiankun 的微前端最佳实践 @nice
@by https://github.com/a1029563229/blogs
@code https://github.com/a1029563229/micro-front-template

参考

方案微前端(react+qiankun)