@micro-zoe/micro-app
Advanced tools
Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8
@@ -14,3 +14,3 @@ /// <reference path="../typings/global.d.ts" /> | ||
declare module '@micro-zoe/micro-app/micro_app' { | ||
import type { OptionsType, MicroAppBaseType, Router, AppName, Func, lifeCyclesType, MicroAppConfig } from '@micro-app/types'; | ||
import type { OptionsType, MicroAppBaseType, Router, AppName, Func, lifeCyclesType, MicroAppConfig, GetActiveAppsParam } from '@micro-app/types'; | ||
import preFetch from '@micro-zoe/micro-app/prefetch'; | ||
@@ -21,5 +21,6 @@ import { EventCenterForBaseApp } from '@micro-zoe/micro-app/interact'; | ||
* @param excludeHiddenApp exclude hidden keep-alive app, default is false | ||
* @param excludePreRender exclude pre render app | ||
* @returns active apps | ||
*/ | ||
export function getActiveApps(excludeHiddenApp?: boolean): AppName[]; | ||
export function getActiveApps({ excludeHiddenApp, excludePreRender, }?: GetActiveAppsParam): AppName[]; | ||
export function getAllApps(): string[]; | ||
@@ -99,3 +100,3 @@ type unmountAppOptions = { | ||
*/ | ||
export default function preFetch(apps: prefetchParamList): void; | ||
export default function preFetch(apps: prefetchParamList, delay?: number): void; | ||
/** | ||
@@ -129,2 +130,3 @@ * load global assets into cache | ||
export function isBoolean(target: unknown): target is boolean; | ||
export function isNumber(target: unknown): target is Number; | ||
export function isFunction(target: unknown): target is Function; | ||
@@ -131,0 +133,0 @@ export function isPlainObject<T = Record<PropertyKey, unknown>>(target: unknown): target is T; |
{ | ||
"name": "@micro-zoe/micro-app", | ||
"version": "1.0.0-alpha.7", | ||
"version": "1.0.0-alpha.8", | ||
"description": "A lightweight, efficient and powerful micro front-end framework", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -16,4 +16,19 @@ declare module '@micro-app/types' { | ||
type RequestIdleCallbackOptions = { | ||
timeout: number | ||
} | ||
type RequestIdleCallbackInfo = { | ||
readonly didTimeout: boolean | ||
timeRemaining: () => number | ||
} | ||
type fiberTasks = Array<() => Promise<void>> | null | ||
interface EffectController { | ||
recordEffect(): void | ||
rebuildEffect(): void | ||
releaseEffect(): void | ||
} | ||
interface SandBoxStartParams { | ||
@@ -39,8 +54,10 @@ umdMode: boolean | ||
stop (stopParams: SandBoxStopParams): void | ||
releaseGlobalEffect (clearData?: boolean): void | ||
// record umd snapshot before the first execution of umdHookMount | ||
recordUmdSnapshot (): void | ||
recordEffectSnapshot (): void | ||
// rebuild umd snapshot before remount umd app | ||
rebuildUmdSnapshot (): void | ||
rebuildEffectSnapshot (): void | ||
setRouteInfoForKeepAliveApp (): void | ||
removeRouteInfoForKeepAliveApp (): void | ||
setPreRenderState (state: boolean): void | ||
} | ||
@@ -95,19 +112,18 @@ | ||
interface MountParam { | ||
container: HTMLElement | ShadowRoot | ||
inline: boolean | ||
useMemoryRouter: boolean | ||
baseroute: string | ||
keepRouteState: boolean | ||
defaultPage: string | ||
hiddenRouter: boolean | ||
disablePatchRequest: boolean | ||
fiber: boolean | ||
esmodule: boolean | ||
container: HTMLElement | ShadowRoot // app container | ||
inline: boolean // run js in inline mode | ||
useMemoryRouter: boolean // use virtual router | ||
defaultPage: string // default page of virtual router | ||
baseroute: string // route prefix, default is '' | ||
disablePatchRequest: boolean // prevent rewrite request method of child app | ||
fiber: boolean // run js in fiber mode | ||
esmodule: boolean // support type='module' script | ||
// hiddenRouter: boolean | ||
} | ||
interface UnmountParam { | ||
destroy: boolean, | ||
clearData: boolean | ||
unmountcb?: CallableFunction | ||
destroy: boolean, // completely destroy, delete cache resources | ||
clearData: boolean // clear data of dateCenter | ||
keepRouteState: boolean // keep route state when unmount, default is false | ||
unmountcb?: CallableFunction // callback of unmount | ||
} | ||
@@ -126,8 +142,9 @@ | ||
ssrUrl: string // html path in ssr mode | ||
isPrefetch: boolean // whether prefetch app, default is false | ||
container: HTMLElement | ShadowRoot | null // container maybe null, micro-app, shadowRoot, div(keep-alive) | ||
keepRouteState: boolean // keep route state when unmount, default is false | ||
umdMode: boolean // is umd mode | ||
fiber: boolean // fiber mode | ||
useMemoryRouter: boolean // use virtual router | ||
isPrefetch: boolean // whether prefetch app, default is false | ||
isPrerender: boolean | ||
prefetchLevel?: number | ||
// defaultPage: string // default page when mount | ||
@@ -141,3 +158,3 @@ // baseroute: string // route prefix, default is '' | ||
// resource is loaded | ||
onLoad (html: HTMLElement): void | ||
onLoad (html: HTMLElement, defaultPage?: string, disablePatchRequest?: boolean): void | ||
@@ -185,3 +202,3 @@ // Error loading HTML | ||
type prefetchParam = { | ||
interface prefetchParam { | ||
name: string, | ||
@@ -197,2 +214,5 @@ url: string, | ||
esmodule?: boolean | ||
level?: number | ||
'default-page'?: string | ||
'disable-patch-request'?: boolean | ||
} | ||
@@ -257,2 +277,7 @@ | ||
type GetActiveAppsParam = { | ||
excludeHiddenApp?: boolean, | ||
excludePreRender?: boolean, | ||
} | ||
type fetchType = (url: string, options: Record<string, unknown>, appName: string | null) => Promise<string> | ||
@@ -285,2 +310,4 @@ | ||
fiber?: boolean | ||
prefetchLevel?: number | ||
prefetchDelay?: number | ||
} | ||
@@ -376,2 +403,7 @@ | ||
type AttachAllToURLParam = { | ||
includeHiddenApp?: boolean, | ||
includePreRender?: boolean, | ||
} | ||
// Router API for developer | ||
@@ -449,3 +481,3 @@ interface Router { | ||
*/ | ||
attachAllToURL(): void | ||
attachAllToURL(options: AttachAllToURLParam): void | ||
/** | ||
@@ -452,0 +484,0 @@ * Record base app router, let child app control base app navigation |
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
1624071
7805