@micro-zoe/micro-app 1.0.0-alpha.9 → 1.0.0-beta.1
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 +19 -4
- package/lib/index.esm.js +2169 -673
- 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 +54 -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,14 @@ 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;
|
|
150
|
+
export function isMicroAppBody(target: unknown): target is HTMLElement;
|
|
143
151
|
export function isProxyDocument(target: unknown): target is Document;
|
|
144
152
|
/**
|
|
145
153
|
* format error log
|
|
@@ -235,7 +243,7 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
235
243
|
* @param target Accept cloned elements
|
|
236
244
|
* @param deep deep clone or transfer dom
|
|
237
245
|
*/
|
|
238
|
-
export function cloneContainer<T extends Element, Q extends Element>(origin: T, target: Q, deep: boolean):
|
|
246
|
+
export function cloneContainer<T extends Element | ShadowRoot, Q extends Element | ShadowRoot>(origin: T, target: Q, deep: boolean): Q;
|
|
239
247
|
export function isInvalidQuerySelectorKey(key: string): boolean;
|
|
240
248
|
export function isUniqueElement(key: string): boolean;
|
|
241
249
|
/**
|
|
@@ -299,7 +307,8 @@ declare module '@micro-zoe/micro-app/libs/utils' {
|
|
|
299
307
|
* @param appName app.name
|
|
300
308
|
* @param args arguments
|
|
301
309
|
*/
|
|
302
|
-
export function
|
|
310
|
+
export function execMicroAppGlobalHook(fn: Func | null, appName: string, hookName: string, ...args: unknown[]): void;
|
|
311
|
+
export function clearDOM($dom: HTMLElement | ShadowRoot | Document): void;
|
|
303
312
|
}
|
|
304
313
|
|
|
305
314
|
declare module '@micro-zoe/micro-app/interact' {
|
|
@@ -416,7 +425,8 @@ declare module '@micro-zoe/micro-app/interact' {
|
|
|
416
425
|
}
|
|
417
426
|
/**
|
|
418
427
|
* Record UMD function before exec umdHookMount
|
|
419
|
-
*
|
|
428
|
+
* NOTE: record maybe call twice when unmount prerender, keep-alive app manually with umd mode
|
|
429
|
+
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
420
430
|
*/
|
|
421
431
|
export function recordDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void;
|
|
422
432
|
/**
|
|
@@ -424,6 +434,11 @@ declare module '@micro-zoe/micro-app/interact' {
|
|
|
424
434
|
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
425
435
|
*/
|
|
426
436
|
export function rebuildDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void;
|
|
437
|
+
/**
|
|
438
|
+
* delete umdDataListeners from microAppEventCenter
|
|
439
|
+
* @param microAppEventCenter instance of EventCenterForMicroApp
|
|
440
|
+
*/
|
|
441
|
+
export function resetDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void;
|
|
427
442
|
export {};
|
|
428
443
|
}
|
|
429
444
|
|