Tencent / wujie

极致的微前端框架
https://wujie-micro.github.io/doc/
Other
4.13k stars 595 forks source link

refactor:TreeShaking unfriendly #118

Closed colgin closed 2 years ago

colgin commented 2 years ago

描述bug In wujie-vue2, wujie-vue3, wujie-react, setupApp, preloadApp, bus, destroyApp functions are all assigned as a property of the default export, which is treeshaking unfriendly, i think it's much better a export as a independent function like

export default WujieReact

export const setupApp = setupApp
export const bus = bus
export const destroyApp = destroyApp
export const preloadApp = preloadApp

// or export all from wujie
export * from 'wujie'

如何复现 给出详细的复现步骤 1、第一步 xxx 2、 第二步 xxx

错误截图 如果有可以将截图带上

最小复现仓库或者地址 重要!!!,请尽量给出复现仓库,这样能极大加快bug解决速度

yiludege commented 2 years ago

export const bus = bus export const destroyApp = destroyApp export const preloadApp = preloadApp

这三个函数体积非常非常小,而且现在做这样的修改的话是破坏性的 api,收益太小了