Skip to content

Commit fa7c7db

Browse files
committed
chore: release rc21
1 parent 2ead742 commit fa7c7db

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

docs/zh-cn/advanced.md

+28
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,33 @@ microApp.start({
3232
})
3333
```
3434

35+
## 2、excludeRunScriptFilter: 自定义屏蔽JS加载异常
36+
通过`excludeRunScriptFilter`钩子,可选择性屏蔽JS加载异常。
37+
注意:全局捕获异常,将无法感知自定义屏蔽部分。
38+
39+
```js
40+
import microApp from '@micro-zoe/micro-app'
41+
42+
microApp.start({
43+
/**
44+
* 自定义 excludeRunScriptFilter
45+
* @param {string} address js地址
46+
* @param {Error} error fetch请求配置项
47+
* @param {string|null} appName 应用名称
48+
* @param {string|null} appUrl 应用地址
49+
* @returns {boolean|any} true: 屏蔽异常, false及其他: 不屏蔽
50+
*/
51+
excludeRunScriptFilter (address: string, error: Error, appName: string, appUrl: string) {
52+
if (address === 'http://localhost:3001/non-block-script.js') {
53+
// 自行处理异常,如上报等功能
54+
// 非阻塞性功能js
55+
return true
56+
}
57+
return false
58+
}
59+
})
60+
```
61+
62+
3563
> [!NOTE]
3664
> 需要注意的是,如果跨域请求带cookie,那么`Access-Control-Allow-Origin`不能设置为`*`,必须指定域名,同时设置`Access-Control-Allow-Credentials: true`

docs/zh-cn/changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
- 修订版本号:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布)
88

99
---
10+
### 1.0.0-rc.21
11+
12+
`2025-02-22`
13+
- **Bug Fix**
14+
- 🐞 修复 升级到rc20版本后,子应用间切换,document.body获取不到导致ui库antdesign报错 [issue 1519](https://github.com/jd-opensource/micro-app/issues/1519)
15+
- **Feature**
16+
- 支持 excludeRunScriptFilter: 自定义屏蔽JS加载异常 。
17+
1018
### 1.0.0-rc.20
1119

1220
`2025-01-24`

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@micro-zoe/micro-app",
3-
"version": "1.0.0-rc.20",
3+
"version": "1.0.0-rc.21",
44
"description": "A lightweight, efficient and powerful micro front-end framework",
55
"private": false,
66
"main": "lib/index.min.js",

0 commit comments

Comments
 (0)