diff --git a/Contact.md b/Contact.md index a017a3b4..e83cce37 100644 --- a/Contact.md +++ b/Contact.md @@ -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) diff --git a/docs/zh-cn/changelog.md b/docs/zh-cn/changelog.md index 3529bdee..5e65845d 100644 --- a/docs/zh-cn/changelog.md +++ b/docs/zh-cn/changelog.md @@ -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 diff --git a/package.json b/package.json index 6c0490d2..54a43090 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/sandbox/adapter.ts b/src/sandbox/adapter.ts index 2543f013..66dae8a2 100644 --- a/src/sandbox/adapter.ts +++ b/src/sandbox/adapter.ts @@ -162,6 +162,9 @@ export function updateElementInfo (node: T, appName: string | null): T { return this.getAttribute('href') }, set(value: string) { + if (value === undefined) { + return + } this.setAttribute('href', value) }, } diff --git a/src/sandbox/iframe/element.ts b/src/sandbox/iframe/element.ts index 1614f8ff..e67cf5d4 100644 --- a/src/sandbox/iframe/element.ts +++ b/src/sandbox/iframe/element.ts @@ -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 @@ -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) } diff --git a/src/sandbox/iframe/special_key.ts b/src/sandbox/iframe/special_key.ts index 196ee511..72a7c7f6 100644 --- a/src/sandbox/iframe/special_key.ts +++ b/src/sandbox/iframe/special_key.ts @@ -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', diff --git a/src/sandbox/iframe/window.ts b/src/sandbox/iframe/window.ts index 145059c9..f403c4bc 100644 --- a/src/sandbox/iframe/window.ts +++ b/src/sandbox/iframe/window.ts @@ -20,6 +20,7 @@ import { SCOPE_WINDOW_ON_EVENT_OF_IFRAME, } from '../../constants' import { + UN_PROXY_INSTANCEOF_KEYS, escape2RawWindowKeys, escape2RawWindowRegExpKeys, } from './special_key' @@ -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,