@elliemae/pui-app-bridge 2.25.0 → 2.26.0-alpha.0

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.
Files changed (36) hide show
  1. package/dist/cjs/appBridge.js +173 -26
  2. package/dist/cjs/config/app.js +8 -0
  3. package/dist/cjs/frame.html +0 -21
  4. package/dist/cjs/loaders/script.js +12 -12
  5. package/dist/cjs/tests/serverHandlers.js +0 -8
  6. package/dist/esm/appBridge.js +173 -26
  7. package/dist/esm/config/app.js +8 -0
  8. package/dist/esm/frame.html +0 -21
  9. package/dist/esm/loaders/script.js +12 -12
  10. package/dist/esm/tests/serverHandlers.js +0 -8
  11. package/dist/public/assets/{frame.671d9de68be598da64ca.html → frame.4cbbcfa9ded96b660559.html} +0 -21
  12. package/dist/public/e2e-host.html +1 -1
  13. package/dist/public/e2e-index.html +1 -1
  14. package/dist/public/frame.html +1 -1
  15. package/dist/public/index.html +1 -1
  16. package/dist/public/js/emuiAppBridge.dc4dbeb6feea171656da.js +17 -0
  17. package/dist/public/js/emuiAppBridge.dc4dbeb6feea171656da.js.br +0 -0
  18. package/dist/public/js/emuiAppBridge.dc4dbeb6feea171656da.js.gz +0 -0
  19. package/dist/public/js/emuiAppBridge.dc4dbeb6feea171656da.js.map +1 -0
  20. package/dist/types/lib/appBridge.d.ts +11 -2
  21. package/dist/types/lib/config/app.d.ts +6 -0
  22. package/dist/types/lib/loaders/script.d.ts +5 -3
  23. package/dist/types/lib/typings/host.d.ts +5 -0
  24. package/dist/types/lib/typings/window.d.ts +1 -1
  25. package/dist/types/tsconfig.tsbuildinfo +1 -1
  26. package/dist/umd/{671d9de68be598da64ca.html → 4cbbcfa9ded96b660559.html} +0 -21
  27. package/dist/umd/frame.html +1 -1
  28. package/dist/umd/index.js +7 -7
  29. package/dist/umd/index.js.br +0 -0
  30. package/dist/umd/index.js.gz +0 -0
  31. package/dist/umd/index.js.map +1 -1
  32. package/package.json +5 -5
  33. package/dist/public/js/emuiAppBridge.87b9f6d6c712609094fd.js +0 -17
  34. package/dist/public/js/emuiAppBridge.87b9f6d6c712609094fd.js.br +0 -0
  35. package/dist/public/js/emuiAppBridge.87b9f6d6c712609094fd.js.gz +0 -0
  36. package/dist/public/js/emuiAppBridge.87b9f6d6c712609094fd.js.map +0 -1
@@ -80,9 +80,11 @@ export declare class CAppBridge<AppObjects extends ScriptingObjects = Partial<Sc
80
80
  */
81
81
  getApps: () => IMicroFEGuest<Partial<ScriptingObjectTypes>, Events>[];
82
82
  /**
83
- * Initialize appBridge
83
+ * Initialize appBridge.
84
+ * @param preloadedAppConfig - Already-parsed config object. When provided
85
+ * the bridge skips its own HTTP fetch of app.config.json.
84
86
  */
85
- init: () => Promise<void>;
87
+ init: (preloadedAppConfig?: Record<string, unknown>) => Promise<void>;
86
88
  /**
87
89
  * Mount guest micro frontend application into DOM
88
90
  * @param instanceId unique instance id of guest micro frontend application
@@ -109,6 +111,13 @@ export declare class CAppBridge<AppObjects extends ScriptingObjects = Partial<Sc
109
111
  * @param guestId
110
112
  */
111
113
  removeScriptingObject: (objectId: Extract<keyof AppObjects, string>, guestId?: string) => void;
114
+ /**
115
+ * Pre-fetch the manifest for a guest application so that a subsequent
116
+ * {@link openApp} call can skip the manifest network round-trip.
117
+ * Safe to call multiple times — results are cached.
118
+ * @param id application id as defined in app.config.json
119
+ */
120
+ warmUp: (id: string) => void;
112
121
  /**
113
122
  * Unmount guest micro frontend application from DOM
114
123
  * @param instanceId unique instance id of guest micro frontend application
@@ -164,6 +164,12 @@ export declare class CAppConfig {
164
164
  * @returns true if key exists
165
165
  */
166
166
  has: (key?: string) => boolean;
167
+ /**
168
+ * Accept an already-parsed config object, skipping the HTTP fetch.
169
+ * Useful when the caller (e.g. pui-app-sdk) has already loaded the config.
170
+ * @param config
171
+ */
172
+ setPreloadedConfig: (config: Record<string, unknown>) => void;
167
173
  /**
168
174
  * load application configuration from the given asset path
169
175
  * @param assetPath url path to load app config from
@@ -51,9 +51,11 @@ export declare class ScriptLoader {
51
51
  * This method:
52
52
  * - Partitions assets into CDN (HTTP/HTTPS) and non-CDN (relative) arrays in a single pass
53
53
  * - Creates modulepreload links for all assets for performance optimization
54
- * - Loads CDN scripts sequentially first (they may set global variables needed by non-CDN scripts)
55
- * - Then loads non-CDN scripts sequentially
56
- * - Sequential execution ensures proper dependency resolution and initialization order
54
+ * - Appends all script elements to the DOM synchronously so the browser
55
+ * can download them in parallel
56
+ * - Execution order is preserved by the spec: type="module" scripts
57
+ * execute in document order; dynamic async=false scripts execute in
58
+ * insertion order
57
59
  * @example
58
60
  * ```typescript
59
61
  * const scriptIds = await scriptLoader.load(
@@ -49,6 +49,11 @@ export type OpenAppParams = {
49
49
  * forwarded through cloned scripting objects.
50
50
  */
51
51
  metadata?: Record<string, unknown>;
52
+ /**
53
+ * When true the guest drives its own lifecycle via initialize() and
54
+ * the bridge skips calling init() / mount() on the guest.
55
+ */
56
+ selfInitialize?: boolean;
52
57
  };
53
58
  /**
54
59
  * Interface to connect and communicate with parent host
@@ -8,7 +8,7 @@ export type EMUI = {
8
8
  _BASE_PATH: string;
9
9
  _ASSET_PATH: string;
10
10
  version: string;
11
- MicroAppHost?: IMicroFEHost;
11
+ __host?: IMicroFEHost;
12
12
  logger?: Logger;
13
13
  appId?: string;
14
14
  registerApp?: (options: {