@micro-zoe/micro-app
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
@@ -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, GetActiveAppsParam } from '@micro-app/types'; | ||
import { OptionsType, MicroAppBaseType, Router, AppName, Func, lifeCyclesType, MicroAppConfig, GetActiveAppsParam } from '@micro-app/types'; | ||
import preFetch from '@micro-zoe/micro-app/prefetch'; | ||
@@ -82,3 +82,3 @@ import { EventCenterForBaseApp } from '@micro-zoe/micro-app/interact'; | ||
declare module '@micro-zoe/micro-app/prefetch' { | ||
import type { prefetchParamList, globalAssetsType } from '@micro-app/types'; | ||
import { prefetchParamList, globalAssetsType } from '@micro-app/types'; | ||
/** | ||
@@ -114,3 +114,3 @@ * preFetch([ | ||
declare module '@micro-zoe/micro-app/libs/utils' { | ||
import type { Func, LocationQueryObject, MicroLocation, AttrsType, fiberTasks, MicroAppElementTagNameMap } from '@micro-app/types'; | ||
import { Func, LocationQueryObject, MicroLocation, AttrsType, fiberTasks, MicroAppElementTagNameMap } from '@micro-app/types'; | ||
export const version = "__MICRO_APP_VERSION__"; | ||
@@ -117,0 +117,0 @@ export const isBrowser: boolean; |
{ | ||
"name": "@micro-zoe/micro-app", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"description": "A lightweight, efficient and powerful micro front-end framework", | ||
@@ -120,3 +120,3 @@ "private": false, | ||
"husky": "~4.3.6", | ||
"jest": "26.6.0", | ||
"jest": "~26.6.0", | ||
"lint-staged": "~10.5.3", | ||
@@ -130,5 +130,5 @@ "live-server": "~1.2.1", | ||
"rollup-plugin-terser": "~7.0.2", | ||
"ts-jest": "26.5.6", | ||
"ts-jest": "~26.5.6", | ||
"typescript": "~4.1.3" | ||
} | ||
} |
@@ -38,3 +38,3 @@ <p align="center"> | ||
# How to use | ||
## base application | ||
## Base application | ||
**1、Install** | ||
@@ -62,3 +62,3 @@ ```bash | ||
## micro application | ||
## Sub application | ||
**Set cross-domain support in the headers of webpack-dev-server** | ||
@@ -65,0 +65,0 @@ ```js |
@@ -49,3 +49,2 @@ declare module '@micro-app/types' { | ||
baseroute: string | ||
useMemoryRouter: boolean | ||
defaultPage: string | ||
@@ -60,3 +59,2 @@ disablePatchRequest: boolean | ||
clearData: boolean | ||
useMemoryRouter: boolean | ||
} | ||
@@ -72,4 +70,27 @@ | ||
interface SandBoxAdapter { | ||
// Variables that can only assigned to rawWindow | ||
escapeSetterKeyList: PropertyKey[] | ||
// Variables that can escape to rawWindow | ||
staticEscapeProperties: PropertyKey[] | ||
// Variables that scoped in child app | ||
staticScopeProperties: PropertyKey[] | ||
} | ||
interface WithSandBoxInterface { | ||
// adapter for sandbox | ||
adapter: SandBoxAdapter | ||
// Scoped global Properties(Properties that can only get and set in microAppWindow, will not escape to rawWindow) | ||
scopeProperties: PropertyKey[] | ||
// Properties that can be escape to rawWindow | ||
escapeProperties: PropertyKey[] | ||
// Properties escape to rawWindow, cleared when unmount | ||
escapeKeys: Set<PropertyKey> | ||
// Properties newly added to microAppWindow | ||
injectedKeys: Set<PropertyKey> | ||
// proxy(microWindow) | ||
proxyWindow: WindowProxy | ||
// child window | ||
microAppWindow: Window // Proxy target | ||
@@ -95,16 +116,2 @@ start (startParams: SandBoxStartParams): void | ||
interface SandBoxAdapter { | ||
// Variables that can only assigned to rawWindow | ||
escapeSetterKeyList: PropertyKey[] | ||
// Variables that can escape to rawWindow | ||
staticEscapeProperties: PropertyKey[] | ||
// Variables that scoped in child app | ||
staticScopeProperties: PropertyKey[] | ||
// adapter for react | ||
// injectReactHMRProperty (): void | ||
} | ||
type LinkSourceInfo = { | ||
@@ -145,3 +152,3 @@ code: string, // source code | ||
inline: boolean // run js in inline mode | ||
useMemoryRouter: boolean // use virtual router | ||
routerMode: string // virtual router mode | ||
defaultPage: string // default page of virtual router | ||
@@ -176,3 +183,3 @@ baseroute: string // route prefix, default is '' | ||
fiber: boolean // fiber mode | ||
useMemoryRouter: boolean // use virtual router | ||
routerMode: string // virtual router mode | ||
isPrefetch: boolean // whether prefetch app, default is false | ||
@@ -225,16 +232,2 @@ isPrerender: boolean | ||
interface MicroAppElementType { | ||
appName: AttrType // app name | ||
appUrl: AttrType // app url | ||
// Hooks for element append to documents | ||
connectedCallback (): void | ||
// Hooks for element delete from documents | ||
disconnectedCallback (): void | ||
// Hooks for element attributes change | ||
attributeChangedCallback (a: 'name' | 'url', o: string, n: string): void | ||
} | ||
interface prefetchParam { | ||
@@ -254,2 +247,6 @@ name: string, | ||
'disable-patch-request'?: boolean | ||
// prerender only 👇 | ||
'router-mode'?: string | ||
baseroute?: string | ||
// prerender only 👆 | ||
} | ||
@@ -343,2 +340,3 @@ | ||
'clear-data'?: boolean | ||
'router-mode'?: string | ||
iframe?: boolean | ||
@@ -371,2 +369,23 @@ ssr?: boolean | ||
interface MicroAppElementType { | ||
appName: AttrType // app name | ||
appUrl: AttrType // app url | ||
// Hooks for element append to documents | ||
connectedCallback (): void | ||
// Hooks for element delete from documents | ||
disconnectedCallback (): void | ||
// Hooks for element attributes change | ||
attributeChangedCallback (a: 'name' | 'url', o: string, n: string): void | ||
/** | ||
* Get configuration | ||
* Global setting is lowest priority | ||
* @param name Configuration item name | ||
*/ | ||
getDisposeResult <T extends keyof OptionsType> (name: T): boolean | ||
} | ||
// special CallableFunction for interact | ||
@@ -373,0 +392,0 @@ type CallableFunctionForInteract = CallableFunction & { __APP_NAME__?: string, __AUTO_TRIGGER__?: boolean } |
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
2098795
9960