Skip to content

Commit a7b6975

Browse files
committed
feat: add app id
1 parent 1f06c93 commit a7b6975

File tree

1 file changed

+4
-2
lines changed
  • packages/runtime/core/src

1 file changed

+4
-2
lines changed

packages/runtime/core/src/app.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export type CustomerLoader = (
3131

3232
export type AppInfo = interfaces.AppInfo & { domGetter: Element };
3333

34+
let appId = 0;
3435
const __GARFISH_EXPORTS__ = '__GARFISH_EXPORTS__';
3536
const __GARFISH_GLOBAL_ENV__ = '__GARFISH_GLOBAL_ENV__';
3637

@@ -44,18 +45,19 @@ const __GARFISH_GLOBAL_ENV__ = '__GARFISH_GLOBAL_ENV__';
4445
* 5. Trigger the destruction: Perform the destroy function of child application, and applies the child node is removed from the document flow.
4546
*/
4647
export class App {
48+
public id = appId++;
4749
public display = false;
4850
public mounted = false;
4951
public esModule = false;
5052
public strictIsolation = false;
5153
public name: string;
52-
public global: any = window;
5354
public isHtmlMode: boolean;
55+
public global: any = window;
5456
public appContainer: HTMLElement;
55-
public sourceList: Array<{ tagName: string; url: string }> = [];
5657
public cjsModules: Record<string, any>;
5758
public htmlNode: HTMLElement | ShadowRoot;
5859
public customExports: Record<string, any> = {}; // If you don't want to use the CJS export, can use this
60+
public sourceList: Array<{ tagName: string; url: string }> = [];
5961
public appInfo: AppInfo;
6062
public hooks: interfaces.AppHooks;
6163
public provider: interfaces.Provider;

0 commit comments

Comments
 (0)