-
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): merge 1.x features to 2.x (#138)
* chore(qiankun): optimize code * feat(qiankun): merge keepOriginalRoutes feature and getMatchedBase feature * feat(qiankun): 增加一些日志 * feat(qiankun): 修复路由正则匹配过于精确的问题 * feat(qiankun): 支持传入 shouldNotModifyPublicPath 参数来关闭 qiankun 注入的 runtimePublicPath * feat(qiankun): 支持使用 rootExports.ts * feat(qiankun): optimize types * feat(qiankun): optimize
- Loading branch information
Showing
12 changed files
with
353 additions
and
115 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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
export const qiankun = { | ||
// 应用加载之前 | ||
async bootstrap(props) { | ||
console.log('app1 bootstrap', props); | ||
console.log('app2 bootstrap', props); | ||
}, | ||
// 应用 render 之前触发 | ||
async mount(props) { | ||
console.log('app1 mount', props); | ||
console.log('app2 mount', props); | ||
}, | ||
// 应用卸载之后触发 | ||
async unmount(props) { | ||
console.log('app1 unmount', props); | ||
console.log('app2 unmount', 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
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,120 @@ | ||
export const originSingleRoute = [ | ||
{ | ||
path: '/', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
path: '/user', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
]; | ||
|
||
export const expectCoverRoute = [ | ||
{ | ||
path: '/', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
path: '/test/user', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
]; | ||
|
||
export const originRoutes = [ | ||
{ | ||
path: '/', | ||
routes: [ | ||
{ | ||
path: '/', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
path: '/user', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
], | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
]; | ||
|
||
export const expectRoutes = [ | ||
{ | ||
path: '/app2', | ||
routes: [ | ||
{ | ||
path: '/', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
path: '/test/user', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
], | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
path: '/', | ||
routes: [ | ||
{ | ||
path: '/', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
path: '/user', | ||
exact: true, | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
], | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
{ | ||
_title: 'app2', | ||
_title_default: 'app2', | ||
}, | ||
]; |
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
Oops, something went wrong.