@micro-zoe/micro-app
Advanced tools
Comparing version 1.0.0-alpha.10 to 1.0.0-beta.0
@@ -87,3 +87,3 @@ /// <reference path="../typings/global.d.ts" /> | ||
* url: string, | ||
* esmodule: boolean, | ||
* iframe: boolean, | ||
* inline: boolean, | ||
@@ -144,2 +144,9 @@ * 'disable-scopecss': boolean, | ||
export function isNode(target: unknown): target is Node; | ||
export function isLinkElement(target: unknown): target is HTMLLinkElement; | ||
export function isStyleElement(target: unknown): target is HTMLStyleElement; | ||
export function isScriptElement(target: unknown): target is HTMLScriptElement; | ||
export function isIFrameElement(target: unknown): target is HTMLIFrameElement; | ||
export function isDivElement(target: unknown): target is HTMLDivElement; | ||
export function isImageElement(target: unknown): target is HTMLImageElement; | ||
export function isBaseElement(target: unknown): target is HTMLBaseElement; | ||
export function isProxyDocument(target: unknown): target is Document; | ||
@@ -240,3 +247,3 @@ /** | ||
*/ | ||
export function cloneContainer<T extends Element, Q extends Element>(origin: T, target: Q, deep: boolean): void; | ||
export function cloneContainer<T extends Element | ShadowRoot, Q extends Element | ShadowRoot>(origin: T, target: Q, deep: boolean): Q; | ||
export function isInvalidQuerySelectorKey(key: string): boolean; | ||
@@ -305,3 +312,4 @@ export function isUniqueElement(key: string): boolean; | ||
*/ | ||
export function callFnWithTryCatch(fn: Func | null, appName: string, msgSuffix: string, ...args: unknown[]): void; | ||
export function execMicroAppGlobalHook(fn: Func | null, appName: string, hookName: string, ...args: unknown[]): void; | ||
export function clearDOM($dom: HTMLElement | ShadowRoot | Document): void; | ||
} | ||
@@ -423,3 +431,4 @@ | ||
* Record UMD function before exec umdHookMount | ||
* @param microAppEventCenter | ||
* NOTE: record maybe call twice when unmount prerender, keep-alive app manually with umd mode | ||
* @param microAppEventCenter instance of EventCenterForMicroApp | ||
*/ | ||
@@ -432,4 +441,9 @@ export function recordDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void; | ||
export function rebuildDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void; | ||
/** | ||
* delete umdDataListeners from microAppEventCenter | ||
* @param microAppEventCenter instance of EventCenterForMicroApp | ||
*/ | ||
export function resetDataCenterSnapshot(microAppEventCenter: EventCenterForMicroApp): void; | ||
export {}; | ||
} | ||
{ | ||
"name": "@micro-zoe/micro-app", | ||
"version": "1.0.0-alpha.10", | ||
"version": "1.0.0-beta.0", | ||
"description": "A lightweight, efficient and powerful micro front-end framework", | ||
@@ -27,3 +27,3 @@ "private": false, | ||
"install:child-vue3": "cd dev/children/vue3 && yarn", | ||
"install:child-vite": "cd dev/children/vite && yarn", | ||
"install:child-vite2": "cd dev/children/vite2 && yarn", | ||
"install:child-angular11": "cd dev/children/angular11 && yarn", | ||
@@ -37,3 +37,3 @@ "main-react16": "cd dev/main-react16 && yarn start", | ||
"start-child:vue3": "cd dev/children/vue3 && yarn start", | ||
"start-child:vite": "cd dev/children/vite && yarn start", | ||
"start-child:vite2": "cd dev/children/vite2 && yarn start", | ||
"start-child:angular11": "cd dev/children/angular11 && yarn start", | ||
@@ -40,0 +40,0 @@ "docs": "docsify serve docs --port 2000", |
@@ -17,4 +17,4 @@ <p align="center"> | ||
</a> | ||
<a href="https://gitter.im/microzoe/micro-app"> | ||
<img src="https://badges.gitter.im/microzoe/micro-app.svg" alt="gitter"> | ||
<a href="https://github.com/micro-zoe/micro-app/blob/dev/Contact.md"> | ||
<img src="https://img.shields.io/badge/chat-wechat-blue" alt="WeChat"> | ||
</a> | ||
@@ -29,3 +29,3 @@ <a href="https://travis-ci.com/github/micro-zoe/micro-app"> | ||
English|[简体中文](./README.zh-cn.md)|[Documentation](https://micro-zoe.github.io/micro-app/)|[Discussions](https://github.com/micro-zoe/micro-app/discussions)|[Gitter](https://gitter.im/microzoe/micro-app) | ||
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) | ||
@@ -152,5 +152,2 @@ # 📖Introduction | ||
# Communication | ||
[Official Wechat group](./Contact.md) | ||
# Contributors | ||
@@ -157,0 +154,0 @@ <a href="https://github.com/micro-zoe/micro-app/graphs/contributors"> |
@@ -17,4 +17,4 @@ <p align="center"> | ||
</a> | ||
<a href="https://gitter.im/microzoe/micro-app"> | ||
<img src="https://badges.gitter.im/microzoe/micro-app.svg" alt="gitter"> | ||
<a href="https://github.com/micro-zoe/micro-app/blob/dev/Contact.md"> | ||
<img src="https://img.shields.io/badge/chat-wechat-blue" alt="WeChat"> | ||
</a> | ||
@@ -29,3 +29,3 @@ <a href="https://travis-ci.com/github/micro-zoe/micro-app"> | ||
[English](https://github.com/micro-zoe/micro-app)|简体中文|[官网文档](https://micro-zoe.github.io/micro-app/)|[讨论组](https://github.com/micro-zoe/micro-app/discussions)|[聊天室](https://gitter.im/microzoe/micro-app) | ||
[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) | ||
@@ -150,4 +150,2 @@ # 📖简介 | ||
# 开发交流 | ||
[官方交流微信群](./Contact.md) | ||
@@ -154,0 +152,0 @@ # 贡献者们 |
@@ -27,8 +27,31 @@ declare module '@micro-app/types' { | ||
type MicroEventListener = EventListenerOrEventListenerObject & Record<string, any> | ||
type timeInfo = { | ||
handler: TimerHandler, | ||
timeout?: number, | ||
args: any[], | ||
} | ||
interface releaseEffectParams { | ||
umdMode: boolean, | ||
isPrerender: boolean, | ||
keepAlive: boolean, | ||
destroy: boolean, | ||
} | ||
interface EffectController { | ||
recordEffect(): void | ||
rebuildEffect(): void | ||
releaseEffect(): void | ||
reset(): void | ||
record(): void | ||
rebuild(): void | ||
release(options: releaseEffectParams): void | ||
} | ||
interface CommonIframeEffect { | ||
reset(): void | ||
record(): void | ||
rebuild(): void | ||
release(umdMode?: boolean, preRender?: boolean): void | ||
} | ||
interface SandBoxStartParams { | ||
@@ -45,7 +68,14 @@ umdMode: boolean | ||
keepRouteState: boolean | ||
clearEventSource: boolean | ||
destroy: boolean | ||
clearData: boolean | ||
} | ||
interface SandBoxInterface { | ||
interface releaseGlobalEffectParams { | ||
clearData?: boolean, | ||
isPrerender?: boolean, | ||
keepAlive?: boolean, | ||
destroy?: boolean, | ||
} | ||
interface WithSandBoxInterface { | ||
proxyWindow: WindowProxy | ||
@@ -55,3 +85,5 @@ microAppWindow: Window // Proxy target | ||
stop (stopParams: SandBoxStopParams): void | ||
releaseGlobalEffect (clearData?: boolean): void | ||
recordAndReleaseEffect (options: releaseGlobalEffectParams, preventRecord?: boolean): void | ||
// reset effect snapshot data | ||
resetEffectSnapshot(): void | ||
// record umd snapshot before the first execution of umdHookMount | ||
@@ -61,5 +93,10 @@ recordEffectSnapshot (): void | ||
rebuildEffectSnapshot (): void | ||
releaseGlobalEffect (options: releaseGlobalEffectParams): void | ||
setRouteInfoForKeepAliveApp (): void | ||
removeRouteInfoForKeepAliveApp (): void | ||
setPreRenderState (state: boolean): void | ||
markUmdMode(state: boolean): void | ||
patchStaticElement (container: Element | ShadowRoot): void | ||
actionBeforeExecScripts (container: Element | ShadowRoot): void | ||
deleteIframeElement? (): void | ||
} | ||
@@ -78,3 +115,3 @@ | ||
// adapter for react | ||
// injectReactHRMProperty (): void | ||
// injectReactHMRProperty (): void | ||
} | ||
@@ -104,3 +141,3 @@ | ||
parsedFunction?: Function | null, // code to function | ||
wrapInSandBox?: boolean // use sandbox | ||
sandboxType?: 'with' | 'iframe' | 'disable' // sandbox type (with, iframe, disable) | ||
}> | ||
@@ -123,3 +160,2 @@ } | ||
fiber: boolean // run js in fiber mode | ||
esmodule: boolean // support type='module' script | ||
// hiddenRouter: boolean | ||
@@ -138,3 +174,4 @@ } | ||
source: sourceType // source list | ||
sandBox: SandBoxInterface | null // sandbox | ||
// TODO: 去掉any | ||
sandBox: WithSandBoxInterface | null | any // sandbox | ||
name: string // app name | ||
@@ -145,3 +182,3 @@ url: string // app url | ||
inline: boolean // whether js runs in inline script mode, default is false | ||
esmodule: boolean // support esmodule in script | ||
iframe: boolean // use iframe sandbox | ||
ssrUrl: string // html path in ssr mode | ||
@@ -216,3 +253,3 @@ container: HTMLElement | ShadowRoot | null // container maybe null, micro-app, shadowRoot, div(keep-alive) | ||
inline?: boolean | ||
esmodule?: boolean | ||
iframe?: boolean | ||
level?: number | ||
@@ -309,3 +346,3 @@ 'default-page'?: string | ||
'clear-data'?: boolean | ||
esmodule?: boolean | ||
iframe?: boolean | ||
ssr?: boolean | ||
@@ -339,9 +376,6 @@ fiber?: boolean | ||
interface ShadowLocation { | ||
[k: string]: string | ||
} | ||
type PopStateListener = (this: Window, e: PopStateEvent) => void | ||
type MicroPopStateEvent = PopStateEvent & { onlyForBrowser?: boolean } | ||
interface MicroLocation extends Location, URL { | ||
// shadowLocation is the current location information (href, pathname, search, hash) | ||
shadowLocation: ShadowLocation | ||
fullPath: string | ||
@@ -348,0 +382,0 @@ [key: string]: any |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2003125
9498
157