@micro-zoe/micro-app 1.0.0-alpha.9 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/README.zh-cn.md +4 -3
- package/lib/index.d.ts +18 -4
- package/lib/index.esm.js +2076 -617
- package/lib/index.esm.js.map +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.map +1 -1
- package/lib/index.umd.js +1 -1
- package/lib/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/typings/global.d.ts +53 -19
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
<a href="https://github.com/micro-zoe/micro-app/blob/master/LICENSE">
|
|
15
15
|
<img src="https://img.shields.io/npm/l/@micro-zoe/micro-app.svg" alt="license"/>
|
|
16
16
|
</a>
|
|
17
|
-
<a href="https://
|
|
18
|
-
<img src="https://
|
|
17
|
+
<a href="https://github.com/micro-zoe/micro-app/blob/dev/Contact.md">
|
|
18
|
+
<img src="https://img.shields.io/badge/chat-wechat-blue" alt="WeChat">
|
|
19
19
|
</a>
|
|
20
20
|
<a href="https://travis-ci.com/github/micro-zoe/micro-app">
|
|
21
21
|
<img src="https://api.travis-ci.com/micro-zoe/micro-app.svg?branch=master" alt="travis"/>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</a>
|
|
26
26
|
</p>
|
|
27
27
|
|
|
28
|
-
English|[简体中文](./README.zh-cn.md)|[Documentation](https://micro-zoe.github.io/micro-app/)|[Discussions](https://github.com/micro-zoe/micro-app/discussions)|[
|
|
28
|
+
English|[简体中文](./README.zh-cn.md)|[Documentation](https://micro-zoe.github.io/micro-app/)|[Discussions](https://github.com/micro-zoe/micro-app/discussions)|[WeChat](./Contact.md)
|
|
29
29
|
|
|
30
30
|
# 📖Introduction
|
|
31
31
|
micro-app is a micro front-end framework launched by JD Retail. It renders based on webcomponent-like and realizes the micro front-end from component thinking, it aiming to reduce the difficulty of getting started and improve work efficiency.
|
package/README.zh-cn.md
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
<a href="https://github.com/micro-zoe/micro-app/blob/master/LICENSE">
|
|
15
15
|
<img src="https://img.shields.io/npm/l/@micro-zoe/micro-app.svg" alt="license"/>
|
|
16
16
|
</a>
|
|
17
|
-
<a href="https://
|
|
18
|
-
<img src="https://
|
|
17
|
+
<a href="https://github.com/micro-zoe/micro-app/blob/dev/Contact.md">
|
|
18
|
+
<img src="https://img.shields.io/badge/chat-wechat-blue" alt="WeChat">
|
|
19
19
|
</a>
|
|
20
20
|
<a href="https://travis-ci.com/github/micro-zoe/micro-app">
|
|
21
21
|
<img src="https://api.travis-ci.com/micro-zoe/micro-app.svg?branch=master" alt="travis"/>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</a>
|
|
26
26
|
</p>
|
|
27
27
|
|
|
28
|
-
[English](https://github.com/micro-zoe/micro-app)|简体中文|[官网文档](https://micro-zoe.github.io/micro-app/)|[讨论组](https://github.com/micro-zoe/micro-app/discussions)|[
|
|
28
|
+
[English](https://github.com/micro-zoe/micro-app)|简体中文|[官网文档](https://micro-zoe.github.io/micro-app/)|[讨论组](https://github.com/micro-zoe/micro-app/discussions)|[微信群](./Contact.md)
|
|
29
29
|
|
|
30
30
|
# 📖简介
|
|
31
31
|
micro-app是京东零售推出的一款微前端框架,它基于类WebComponent进行渲染,从组件化的思维实现微前端,旨在降低上手难度、提升工作效率。它是目前接入微前端成本最低的框架,并且提供了JS沙箱、样式隔离、元素隔离、预加载、虚拟路由系统、插件系统、数据通信等一系列完善的功能。
|
|
@@ -145,6 +145,7 @@ yarn start # 访问 http://localhost:3000
|
|
|
145
145
|
支持,详情请查看[nextjs](https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/framework/nextjs)、[nuxtjs](https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/framework/nuxtjs)
|
|
146
146
|
</details>
|
|
147
147
|
|
|
148
|
+
|
|
148
149
|
# 贡献者们
|
|
149
150
|
<a href="https://github.com/micro-zoe/micro-app/graphs/contributors">
|
|
150
151
|
<img src="https://contrib.rocks/image?repo=micro-zoe/micro-app" />
|
package/lib/index.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ declare module '@micro-zoe/micro-app/prefetch' {
|
|
|
84
84
|
* {
|
|
85
85
|
* name: string,
|
|
86
86
|
* url: string,
|
|
87
|
-
*
|
|
87
|
+
* iframe: boolean,
|
|
88
88
|
* inline: boolean,
|
|
89
89
|
* 'disable-scopecss': boolean,
|
|
90
90
|
* 'disable-sandbox': boolean,
|
|
@@ -140,6 +140,13 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
140
140
|
export function isURL(target: unknown): target is URL;
|
|
141
141
|
export function isElement(target: unknown): target is Element;
|
|
142
142
|
export function isNode(target: unknown): target is Node;
|
|
143
|
+
export function isLinkElement(target: unknown): target is HTMLLinkElement;
|
|
144
|
+
export function isStyleElement(target: unknown): target is HTMLStyleElement;
|
|
145
|
+
export function isScriptElement(target: unknown): target is HTMLScriptElement;
|
|
146
|
+
export function isIFrameElement(target: unknown): target is HTMLIFrameElement;
|
|
147
|
+
export function isDivElement(target: unknown): target is HTMLDivElement;
|
|
148
|
+
export function isImageElement(target: unknown): target is HTMLImageElement;
|
|
149
|
+
export function isBaseElement(target: unknown): target is HTMLBaseElement;
|
|
143
150
|
export function isProxyDocument(target: unknown): target is Document;
|
|
144
151
|
/**
|
|
145
152
|
* format error log
|
|
@@ -235,7 +242,7 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
235
242
|
* @param target Accept cloned elements
|
|
236
243
|
* @param deep deep clone or transfer dom
|
|
237
244
|
*/
|
|
238
|
-
export function cloneContainer<T extends Element, Q extends Element>(origin: T, target: Q, deep: boolean):
|
|
245
|
+
export function cloneContainer<T extends Element | ShadowRoot, Q extends Element | ShadowRoot>(origin: T, target: Q, deep: boolean): Q;
|
|
239
246
|
export function isInvalidQuerySelectorKey(key: string): boolean;
|
|
240
247
|
export function isUniqueElement(key: string): boolean;
|
|
241
248
|
/**
|
|
@@ -299,7 +306,8 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
299
306
|
* @param appName app.name
|
|
300
307
|
* @param args arguments
|
|
301
308
|
*/
|
|
302
|
-
export function
|
|
309
|
+
export function execMicroAppGlobalHook(fn: Func | null, appName: string, hookName: string, ...args: unknown[]): void;
|
|
310
|
+
export function clearDOM($dom: HTMLElement | ShadowRoot | Document): void;
|
|
303
311
|
}
|
|
304
312
|
|
|
305
313
|
declare module '@micro-zoe/micro-app/interact' {
|
|
@@ -416,7 +424,8 @@ declare module '@micro-zoe/micro-app/interact' {
|
|
|
416
424
|
}
|
|
417
425
|
/**
|
|
418
426
|
* Record UMD function before exec umdHookMount
|
|
419
|
-
*
|
|
427
|
+
* NOTE: record maybe call twice when unmount prerender, keep-alive app manually with umd mode
|
|
428
|
+
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
420
429
|
*/
|
|
421
430
|
export function recordDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void;
|
|
422
431
|
/**
|
|
@@ -424,6 +433,11 @@ declare module '@micro-zoe/micro-app/interact' {
|
|
|
424
433
|
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
425
434
|
*/
|
|
426
435
|
export function rebuildDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void;
|
|
436
|
+
/**
|
|
437
|
+
* delete umdDataListeners from microAppEventCenter
|
|
438
|
+
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
439
|
+
*/
|
|
440
|
+
export function resetDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void;
|
|
427
441
|
export {};
|
|
428
442
|
}
|
|
429
443
|
|