v3.0.0-rc.0
Pre-release
Pre-release
✨ 新特性
- 支持运行时依赖复用
- 仅支持主应用与子应用复用依赖,不支持子应用之间复用依赖
- 通过应用中声明 dependencymap 来指定复用策略,如
上面的配置表明的是当主应用的 antd 版本在 2.0.0 以上时,子应用的便会复用主应用的 antd。详细请参考 examples<script type="dependencymap"> { "dependencies": { "antd": { "url": "https://gw.alipayobjects.com/os/lib/antd/2.13.14/dist/antd.js", "version": "2.13.14", "range": "^2.0.0" }, "react": { "url": "https://gw.alipayobjects.com/os/lib/react/15.7.0/dist/react.js", "version": "15.7.0", "range": "^15.0.0" }, "react-dom": { "url": "https://gw.alipayobjects.com/os/lib/react-dom/15.7.0/dist/react-dom.js", "version": "15.7.0", "range": "^15.0.0" } } } </script>
- 沙箱支持配置访问的全局变量代理
⚡️ 性能改进
- 沙箱实现不再依赖 eval,彻底解决 Chrome 开启 devtools 时的内存泄漏问题
- 基于客户端流式的方式修改子应用 HTML 标签
💥 不兼容更新
- container 配置不再支持选择器字符串,仅支持配置 HTMLElement 引用,从而避免出现各种 container 找不到的异常
- 子应用 entry 不支持内联脚本
🚧 建设中
目前仅支持了 loadMicroApp
和 registerMicroApps
两个最基础的 api,其他 api 会在后续陆续支持。
✨ New Features
- Support for runtime dependency reuse
- Only support reusing dependencies between main app and sub apps, but not between sub apps
- Specify reuse strategy by declaring
dependencymap
in app script, e.g.
The above config means when the main app's antd version is above 2.0.0, the sub app will reuse the main app's antd. See examples for details.<script type="dependencymap"> { "dependencies": { "antd": { "url": "https://gw.alipayobjects.com/os/lib/antd/2.13.14/dist/antd.js", "version": "2.13.14", "range": "^2.0.0" }, "react": { "url": "https://gw.alipayobjects.com/os/lib/react/15.7.0/dist/react.js", "version": "15.7.0", "range": "^15.0.0" }, "react-dom": { "url": "https://gw.alipayobjects.com/os/lib/react-dom/15.7.0/dist/react-dom.js", "version": "15.7.0", "range": "^15.0.0" } } } </script>
- Support configuring proxy for accessing global variables in sandbox.
⚡️ Performance Improvements
- Sandbox implementation no longer relies on
eval
, completely solving Chrome's memory leak issue when devtools is opened. - Modify sub-app HTML tags based on client-side streaming rendering.
💥 Breaking Changes
container
config no longer supports selector string, only supports configuring HTMLElement reference to avoid various container not found errors.- The subapplication entry does not support inline scripts.
🚧 Under Development
Currently only the two most basic APIs loadMicroApp
and registerMicroApps
are supported, other APIs will be supported gradually.