Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
timhub66 committed Oct 16, 2024
2 parents 6f20e71 + 2a99397 commit 23de816
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Contact.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

欢迎小伙伴们加入micro-app微信群交流^ ^
![IMG_1210](https://github.com/user-attachments/assets/4dad4e21-7a08-43a0-ad5e-a3c4968d0b49)


![IMG_0882](https://github.com/user-attachments/assets/aa133812-2920-4f87-80e3-c44778685725)



Expand Down
8 changes: 8 additions & 0 deletions docs/zh-cn/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
- 修订版本号:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布)

---
### 1.0.0-rc.13

`2024-10-16`
- **Bug Fix**
- 🐞 修复 子应用instanceof Array无法正确判定,[issue 1400](https://github.com/micro-zoe/micro-app/issues/1400)
- 🐞 修复 子应用a标签href为undefined引起异常。
- **Feature**
- 支持 cesium mars3d 生态。

### 1.0.0-rc.12

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@micro-zoe/micro-app",
"version": "1.0.0-rc.12",
"version": "1.0.0-rc.13",
"description": "A lightweight, efficient and powerful micro front-end framework",
"private": false,
"main": "lib/index.min.js",
Expand Down
3 changes: 3 additions & 0 deletions src/sandbox/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ export function updateElementInfo <T> (node: T, appName: string | null): T {
return this.getAttribute('href')
},
set(value: string) {
if (value === undefined) {
return
}
this.setAttribute('href', value)
},
}
Expand Down
9 changes: 8 additions & 1 deletion src/sandbox/iframe/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ import {
isElement,
isNode,
isDocumentFragment,
isFunction,
isBrowser,
} from '../../libs/utils'
import {
updateElementInfo,
getIframeParentNodeDesc,
} from '../adapter'
import microApp from '../../micro_app'

/**
* patch Element & Node of child app
Expand Down Expand Up @@ -242,7 +245,11 @@ function patchIframeAttribute (url: string, microAppWindow: microAppWindowType):
((key === 'src' || key === 'srcset') && /^(img|script|video|audio|source|embed)$/i.test(this.tagName)) ||
(key === 'href' && /^(a|link|image)$/i.test(this.tagName))
) {
value = CompletionPath(value, url)
let _url = url
if (isBrowser && key === 'href' && /^a$/i.test(this.tagName) && isFunction(microApp.options.excludeAssetFilter) && microApp.options.excludeAssetFilter(value)) {
_url = document.baseURI
}
value = CompletionPath(value, _url)
}
rawMicroSetAttribute.call(this, key, value)
}
Expand Down
6 changes: 5 additions & 1 deletion src/sandbox/iframe/special_key.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

export const UN_PROXY_INSTANCEOF_KEYS = [
'Array'
]

export const escape2RawWindowKeys = [
'Array',
'getComputedStyle',
// FIX ISSUE: https://github.com/micro-zoe/micro-app/issues/1292
'DOMParser',
Expand Down
3 changes: 2 additions & 1 deletion src/sandbox/iframe/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
SCOPE_WINDOW_ON_EVENT_OF_IFRAME,
} from '../../constants'
import {
UN_PROXY_INSTANCEOF_KEYS,
escape2RawWindowKeys,
escape2RawWindowRegExpKeys,
} from './special_key'
Expand Down Expand Up @@ -92,7 +93,7 @@ function patchWindowProperty (
* 4. native url instanceof iframe window.URL
* ...
*/
if (isConstructor(microAppWindow[key]) && key in rawWindow) {
if (isConstructor(microAppWindow[key]) && key in rawWindow && !UN_PROXY_INSTANCEOF_KEYS.includes(key)) {
rawDefineProperty(microAppWindow[key], Symbol.hasInstance, {
configurable: true,
enumerable: false,
Expand Down

0 comments on commit 23de816

Please sign in to comment.