-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(qiankun): 支持 qiankun2.0 特性 (#148)
* fix(qiankun): 支持 qiankun2.0 特性 * fix(qiankun): 兼容 windows path * fix(qiankun): 支持动态获取 matched base * fix(qiankun): 路由关联模式下 singular 强制为 true * chore(qiankun): 更新 qiankun 版本 * fix(qiankun): 修正 unmount 逻辑 * fix(qiankun): 修复会影响 tree-shaking 的问题 * fix(qiankun): 修复运行时设置 setMasterOptions 不生效的问题 * fix(qiankun): 合并运行时 app 的 props 配置 * fix(qiankun): 允许路由关联模式下手动设置 singular 模式,默认为 true * fix(qiankun): 增加路由绑定别名及组件别名导出功能 * fix(qiankun): 拆分 qiankun 配置加载 * chore(qiankun): update demo * fix(qiankun): 改回 api.config (#178) * feat(qiankun): 支持通过其他插件来懒启动 qiankun plugin (#179) * chore(qiankun): 移除一些失效的配置 * chore(qiankun): demo 精简 * fix(qiankun): 修复应用提前渲染导致的 runtime 信息还未加载的问题 * chore(qiankun): 移除无效的包声明 * fix(qiankun): 修复全栈应用获取 package.json 出错的问题 * feat(qiankun): 支持主应用配置了 base 的场景 * feat: add update hook and use useModel as new communication api (#214) * chore(qiankun): optimize code * feat(qiankun): 支持自动动态设置子应用动态路由 base * chore(qiankun): optimize code * feat(qiankun): 移除异步启动,使用 process.env.initialQiankunMasterOptions 动态设置 qiankun master plugin * feat(qiankun): 使用 loader 代替 loadingComponent * fix(qiankun): 修复 MicroApp 组件模板问题 * feat(qiankun): 移除自带的 antd loading * feat(qiankun): 导出 getMasterOptions * fix(qiankun): remove unused code * fix(qiankun): v2.3.0-4 * fix(qiankun): 修复 prefetch 被忽略的问题 * fix(qiankun): 修复开启 defer 时 qiankunStart 调用在其他初始化方法中导致死锁的问题 * fix(qiankun): v2.3.0-6 * chore(qiankun): rename jsSandbox -> sandbox * feat(qiankun): add MicroApp updating log * feat(qiankun): 支持通过 globalState.ts 导出 props 到子应用 * fix(qiankun): 修复 qiankun 插件生成 mock 时 React undefined 的问题 * chore(qiankun): v2.3.0-7 * feat: qiankun 支持动态修改 history (#267) * feat(qiankun): globalState.ts 的方式改为 app.ts 中导出 useQiankunStateForSlave * chore(qiankun): update comment * chore(qiankun): optimize code * chore(qiankun): optimize code * chore(qiankun): add upgrade link * fix(qiankun): 兼容子应用单独打开场景 Co-authored-by: 早弦 <tianyi.mty@antfin.com> Co-authored-by: fkysly <fkysly@hotmail.com> Co-authored-by: Troy Li <troy.lty@antfin.com> Co-authored-by: 砖家 <576679268@qq.com>
- Loading branch information
1 parent
a227a87
commit 0297840
Showing
35 changed files
with
818 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default { | ||
runtimeHelpers: true, | ||
browserFiles: [ | ||
'src/master/runtimePlugin.ts', | ||
'src/slave/lifecycles.ts', | ||
'src/slave/runtimePlugin.ts', | ||
'src/common.ts', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const qiankun = { | ||
// 应用 render 之前触发 | ||
async update(props) { | ||
console.log('app1 update', props); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import React from 'react'; | ||
import { useModel } from 'umi'; | ||
|
||
export default function() { | ||
const { testProp1, globalState } = useModel('@@qiankunStateFromMaster') || {}; | ||
return ( | ||
<div> | ||
<h1>Dashboard 1</h1> | ||
<p>testProp1: {testProp1}</p> | ||
<p>globalState: {JSON.stringify(globalState)}</p> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
import { useState } from 'react'; | ||
import request from './services/request'; | ||
|
||
export const qiankun = request('/apps').then(apps => ({ apps })); | ||
|
||
export const useQiankunStateForSlave = () => { | ||
const [globalState, setQiankunGlobalState] = useState({ | ||
slogan: 'Hello MicroFrontend', | ||
}); | ||
|
||
return { | ||
globalState, | ||
setQiankunGlobalState, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { MicroApp } from 'umi'; | ||
|
||
export default function() { | ||
return ( | ||
<div> | ||
<MicroApp name="app2" /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.