@micro-zoe/micro-app 1.0.0-alpha.8 → 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 +28 -9
- package/lib/index.esm.js +2189 -692
- 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,16 +84,21 @@ declare module '@micro-zoe/micro-app/prefetch' {
|
|
|
84
84
|
* {
|
|
85
85
|
* name: string,
|
|
86
86
|
* url: string,
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
87
|
+
* iframe: boolean,
|
|
88
|
+
* inline: boolean,
|
|
89
|
+
* 'disable-scopecss': boolean,
|
|
90
|
+
* 'disable-sandbox': boolean,
|
|
91
|
+
* level: number,
|
|
92
|
+
* 'default-page': string,
|
|
93
|
+
* 'disable-patch-request': boolean,
|
|
90
94
|
* },
|
|
91
95
|
* ...
|
|
92
96
|
* ])
|
|
93
97
|
* Note:
|
|
94
|
-
* 1: preFetch is
|
|
95
|
-
* 2:
|
|
96
|
-
* @param apps micro
|
|
98
|
+
* 1: preFetch is async and is performed only when the browser is idle
|
|
99
|
+
* 2: options of prefetch preferably match the config of the micro-app element, although this is not required
|
|
100
|
+
* @param apps micro app options
|
|
101
|
+
* @param delay delay time
|
|
97
102
|
*/
|
|
98
103
|
export default function preFetch(apps: prefetchParamList, delay?: number): void;
|
|
99
104
|
/**
|
|
@@ -135,6 +140,13 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
135
140
|
export function isURL(target: unknown): target is URL;
|
|
136
141
|
export function isElement(target: unknown): target is Element;
|
|
137
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;
|
|
138
150
|
export function isProxyDocument(target: unknown): target is Document;
|
|
139
151
|
/**
|
|
140
152
|
* format error log
|
|
@@ -230,7 +242,7 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
230
242
|
* @param target Accept cloned elements
|
|
231
243
|
* @param deep deep clone or transfer dom
|
|
232
244
|
*/
|
|
233
|
-
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;
|
|
234
246
|
export function isInvalidQuerySelectorKey(key: string): boolean;
|
|
235
247
|
export function isUniqueElement(key: string): boolean;
|
|
236
248
|
/**
|
|
@@ -294,7 +306,8 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
294
306
|
* @param appName app.name
|
|
295
307
|
* @param args arguments
|
|
296
308
|
*/
|
|
297
|
-
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;
|
|
298
311
|
}
|
|
299
312
|
|
|
300
313
|
declare module '@micro-zoe/micro-app/interact' {
|
|
@@ -411,7 +424,8 @@ declare module '@micro-zoe/micro-app/interact' {
|
|
|
411
424
|
}
|
|
412
425
|
/**
|
|
413
426
|
* Record UMD function before exec umdHookMount
|
|
414
|
-
*
|
|
427
|
+
* NOTE: record maybe call twice when unmount prerender, keep-alive app manually with umd mode
|
|
428
|
+
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
415
429
|
*/
|
|
416
430
|
export function recordDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void;
|
|
417
431
|
/**
|
|
@@ -419,6 +433,11 @@ declare module '@micro-zoe/micro-app/interact' {
|
|
|
419
433
|
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
420
434
|
*/
|
|
421
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;
|
|
422
441
|
export {};
|
|
423
442
|
}
|
|
424
443
|
|