@elliemae/pui-app-bridge 2.35.4 → 2.35.6

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.
@@ -665,6 +665,7 @@ class CAppBridge {
665
665
  const appConfig = this.#microFEConfig.getConfigById(id);
666
666
  if (!appConfig) {
667
667
  this.#logger.warn(`Configuration for application ${id} is not found`);
668
+ app.microFEHost?.[import_microfeHost.DISPOSE_HOST]();
668
669
  this.removeAllScriptingObjects(instanceId);
669
670
  this.#eventManager.unsubscribeByGuestId(instanceId);
670
671
  this.#activeApps.delete(instanceId);
@@ -690,6 +691,7 @@ class CAppBridge {
690
691
  if (frameEle) {
691
692
  frameEle.src = "about:blank";
692
693
  }
694
+ app.microFEHost?.[import_microfeHost.DISPOSE_HOST]();
693
695
  this.removeAllScriptingObjects(instanceId);
694
696
  this.#eventManager.unsubscribeByGuestId(instanceId);
695
697
  this.#activeApps.delete(instanceId);
@@ -838,7 +840,6 @@ class CAppBridge {
838
840
  selfInitialize
839
841
  } = params;
840
842
  const instanceId = (0, import_uuid.v4)();
841
- if (metadata) this.#guestMetadata.set(instanceId, metadata);
842
843
  const appConfig = this.#microFEConfig.getConfigById(id);
843
844
  if (!appConfig) {
844
845
  throw new Error(`Application ${id} is not found in app config`);
@@ -853,23 +854,23 @@ class CAppBridge {
853
854
  hostUrl: appConfig.hostUrl,
854
855
  options: { title: appConfig.name, ...frameOptions }
855
856
  });
856
- if (!frameEle?.contentDocument)
857
+ if (!frameEle?.contentDocument) {
858
+ import_frame.Frame.remove(instanceId);
857
859
  throw new Error("unable to create iframe for the microapp");
860
+ }
861
+ let microFEHost;
858
862
  try {
863
+ if (metadata) this.#guestMetadata.set(instanceId, metadata);
859
864
  this.#appRegistry.add({
860
865
  id,
861
866
  instanceId,
862
867
  documentEle: frameEle.contentDocument
863
868
  });
864
- const microFEHost = this.#setupIframe(
865
- frameEle.contentDocument,
866
- appConfig,
867
- {
868
- id,
869
- instanceId,
870
- containerId: frameOptions?.containerId
871
- }
872
- );
869
+ microFEHost = this.#setupIframe(frameEle.contentDocument, appConfig, {
870
+ id,
871
+ instanceId,
872
+ containerId: frameOptions?.containerId
873
+ });
873
874
  const manifest = await manifestPromise;
874
875
  await this.#loadApp({
875
876
  instanceId,
@@ -891,6 +892,8 @@ class CAppBridge {
891
892
  this.#bindModuleUnload(id, instanceId);
892
893
  return instanceId;
893
894
  } catch (err) {
895
+ microFEHost?.[import_microfeHost.DISPOSE_HOST]();
896
+ this.#eventManager.unsubscribeByGuestId(instanceId);
894
897
  this.#guestMetadata.delete(instanceId);
895
898
  this.#unbindModuleUnload(instanceId, id);
896
899
  this.#unloadApp({
@@ -899,6 +902,8 @@ class CAppBridge {
899
902
  hostUrl: appConfig.hostUrl,
900
903
  documentEle: frameEle.contentDocument
901
904
  });
905
+ this.#activeApps.delete(instanceId);
906
+ this.removeAllScriptingObjects(instanceId);
902
907
  import_frame.Frame.remove(instanceId);
903
908
  throw err;
904
909
  }
@@ -207,7 +207,7 @@ class EventManager {
207
207
  * @param {SubscribeParam<EventId, AppEvents[EventId]>} param - parameters for subscribing to an event
208
208
  */
209
209
  subscribe = (param) => {
210
- const { eventId, callback, criteria, guestId } = param;
210
+ const { eventId, callback, criteria, guestId, ownerInstanceId } = param;
211
211
  if (!eventId) throw new Error("eventId is required");
212
212
  if (!callback) throw new Error("Callback is required");
213
213
  const listeners = this.#listeners.get(eventId) || [];
@@ -216,25 +216,57 @@ class EventManager {
216
216
  token,
217
217
  criteria,
218
218
  guestId,
219
+ ...ownerInstanceId ? { ownerInstanceId } : {},
219
220
  callback
220
221
  });
221
222
  this.#listeners.set(eventId, listeners);
222
223
  return token;
223
224
  };
224
225
  /**
225
- * Unsubscribe from an event
226
+ * Removes the listeners of an event that match the predicate
227
+ * @param {string} eventId event id
228
+ * @param {Function} shouldRemove predicate that selects the listeners to remove
229
+ */
230
+ #removeListeners = (eventId, shouldRemove) => {
231
+ const listeners = this.#listeners.get(eventId);
232
+ if (!listeners) return;
233
+ const remaining = listeners.filter((listener) => !shouldRemove(listener));
234
+ if (remaining.length === 0) {
235
+ this.#listeners.delete(eventId);
236
+ } else if (remaining.length !== listeners.length) {
237
+ this.#listeners.set(eventId, remaining);
238
+ }
239
+ };
240
+ /**
241
+ * Unsubscribe from an event.
242
+ *
243
+ * With a token, removes that subscription; a token that matches nothing
244
+ * (including an empty string) removes nothing. Without a token (undefined or
245
+ * null), removes every listener of the event, or, when `ownerInstanceId` is
246
+ * given, only the listeners registered by that owner. When `ownerInstanceId`
247
+ * is given, a token unsubscribe only removes a listener registered by that
248
+ * owner; a token owned by someone else is kept and a warning is logged.
249
+ * Removal never mutates the listener array an in-progress dispatch iterates.
226
250
  * @param {UnsubscribeParam<EventId>} param - parameters for unsubscribing from an event
227
251
  */
228
252
  unsubscribe = (param) => {
229
- const { eventId, token } = param;
253
+ const { eventId, token, ownerInstanceId } = param;
230
254
  if (!eventId) throw new Error("eventId id is required");
231
- if (token) {
232
- const listeners = this.#listeners.get(eventId) || [];
233
- const index = listeners.findIndex((listener) => listener.token === token);
234
- if (index > -1) {
235
- listeners.splice(index, 1);
236
- this.#listeners.set(eventId, listeners);
255
+ const isOwned = (listener) => !ownerInstanceId || listener.ownerInstanceId === ownerInstanceId;
256
+ if (token !== void 0 && token !== null) {
257
+ const listener = this.#listeners.get(eventId)?.find((item) => item.token === token);
258
+ if (!listener) return;
259
+ if (!isOwned(listener)) {
260
+ this.#logger?.warn(
261
+ `Ignoring unsubscribe from ${eventId} by ${String(
262
+ ownerInstanceId
263
+ )}: the subscription belongs to another owner`
264
+ );
265
+ return;
237
266
  }
267
+ this.#removeListeners(eventId, (item) => item.token === token);
268
+ } else if (ownerInstanceId) {
269
+ this.#removeListeners(eventId, isOwned);
238
270
  } else {
239
271
  this.#listeners.delete(eventId);
240
272
  }
@@ -246,21 +278,18 @@ class EventManager {
246
278
  this.#listeners.clear();
247
279
  };
248
280
  /**
249
- * Removes every listener registered for a guest iframe host instance.
250
- * Global listeners (no guestId) are preserved.
281
+ * Removes every listener registered for a guest iframe host instance:
282
+ * listeners scoped to it (`guestId`) and listeners it owns
283
+ * (`ownerInstanceId`). Listeners of the host and of other guests are preserved.
251
284
  * @param guestId openApp instance id
252
285
  */
253
286
  unsubscribeByGuestId = (guestId) => {
254
287
  if (!guestId) return;
255
- this.#listeners.forEach((listeners, eventId) => {
256
- const remaining = listeners.filter(
257
- (listener) => listener.guestId !== guestId
288
+ [...this.#listeners.keys()].forEach((eventId) => {
289
+ this.#removeListeners(
290
+ eventId,
291
+ (listener) => listener.guestId === guestId || listener.ownerInstanceId === guestId
258
292
  );
259
- if (remaining.length === 0) {
260
- this.#listeners.delete(eventId);
261
- } else if (remaining.length !== listeners.length) {
262
- this.#listeners.set(eventId, remaining);
263
- }
264
293
  });
265
294
  };
266
295
  }
@@ -18,11 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var microfeHost_exports = {};
20
20
  __export(microfeHost_exports, {
21
- CMicroFEHost: () => CMicroFEHost
21
+ CMicroFEHost: () => CMicroFEHost,
22
+ DISPOSE_HOST: () => DISPOSE_HOST
22
23
  });
23
24
  module.exports = __toCommonJS(microfeHost_exports);
24
25
  var import_microfe_common = require("@elliemae/microfe-common");
25
26
  var import_constant = require("./constant.js");
27
+ const DISPOSE_HOST = /* @__PURE__ */ Symbol("pui-app-bridge.disposeMicroFEHost");
26
28
  const GUEST_SCOPED_MODULE_EVENTS = /* @__PURE__ */ new Set([
27
29
  "module.unloading",
28
30
  "module.unmount"
@@ -54,6 +56,11 @@ class CMicroFEHost {
54
56
  #version;
55
57
  #soManager;
56
58
  #eventManager;
59
+ #logger;
60
+ /**
61
+ * set once the guest is closed; a disposed host registers no new listeners
62
+ */
63
+ #disposed = false;
57
64
  /**
58
65
  * Create new instance of the host frontend application
59
66
  * @param {CMicroFEHostParams} params - constructor parameters
@@ -64,6 +71,7 @@ class CMicroFEHost {
64
71
  this.#version = params?.version || import_constant.LATEST_VERSION;
65
72
  this.#soManager = params.soManager;
66
73
  this.#eventManager = params.eventManager;
74
+ this.#logger = params.logger;
67
75
  }
68
76
  /**
69
77
  * application release version
@@ -148,19 +156,41 @@ class CMicroFEHost {
148
156
  }
149
157
  };
150
158
  /**
151
- * add listener to the scripting object event
159
+ * add listener to the scripting object event.
160
+ * The listener is owned by this guest instance and is removed when the guest is closed.
152
161
  * @param {SubscribeParam<EventId, EventListener>} params - parameters to add event listener
153
- * @returns subscription id
162
+ * @returns subscription id, or an empty string when the guest is already closed
154
163
  */
155
- subscribe = (params) => this.#eventManager.subscribe({
156
- ...params,
157
- ...GUEST_SCOPED_MODULE_EVENTS.has(params.eventId) ? { guestId: this.#instanceId } : {}
158
- });
164
+ subscribe = (params) => {
165
+ if (this.#disposed) {
166
+ this.#logger?.warn(
167
+ `Ignoring subscribe to ${params?.eventId} from guest ${this.#guest.id} with instance id ${this.#instanceId}: the guest is closed`
168
+ );
169
+ return "";
170
+ }
171
+ return this.#eventManager.subscribe({
172
+ ...params,
173
+ ...GUEST_SCOPED_MODULE_EVENTS.has(params.eventId) ? { guestId: this.#instanceId } : {},
174
+ ownerInstanceId: this.#instanceId
175
+ });
176
+ };
159
177
  /**
160
- * removes listener from the scripting object event
178
+ * removes listener from the scripting object event.
179
+ * Only listeners registered by this guest instance are removed.
161
180
  * @param {UnsubscribeParam<EventId>} params - parameters to remove event listener
162
181
  */
163
182
  unsubscribe = (params) => {
164
- this.#eventManager.unsubscribe(params);
183
+ this.#eventManager.unsubscribe({
184
+ ...params,
185
+ ownerInstanceId: this.#instanceId
186
+ });
165
187
  };
188
+ /**
189
+ * Called by the app bridge when the guest is closed.
190
+ * Later subscribe calls are ignored so a closed guest cannot register listeners again.
191
+ * @internal
192
+ */
193
+ [DISPOSE_HOST]() {
194
+ this.#disposed = true;
195
+ }
166
196
  }
@@ -16,7 +16,7 @@ import { getCurrentBreakpoint, getViewportSize } from "./typings/window.js";
16
16
  import { CAppConfig } from "./config/app.js";
17
17
  import { CMicroFEConfig } from "./config/microFE.js";
18
18
  import { StyleLoader, ScriptLoader, ManifestLoader } from "./loaders/index.js";
19
- import { CMicroFEHost } from "./microfeHost.js";
19
+ import { CMicroFEHost, DISPOSE_HOST } from "./microfeHost.js";
20
20
  import { CAppRegistry } from "./appRegistry.js";
21
21
  const KEEP_ALIVE_INTERVAL = 12e4;
22
22
  const MODULE_UNLOADING_EVENT = "module.unloading";
@@ -640,6 +640,7 @@ class CAppBridge {
640
640
  const appConfig = this.#microFEConfig.getConfigById(id);
641
641
  if (!appConfig) {
642
642
  this.#logger.warn(`Configuration for application ${id} is not found`);
643
+ app.microFEHost?.[DISPOSE_HOST]();
643
644
  this.removeAllScriptingObjects(instanceId);
644
645
  this.#eventManager.unsubscribeByGuestId(instanceId);
645
646
  this.#activeApps.delete(instanceId);
@@ -665,6 +666,7 @@ class CAppBridge {
665
666
  if (frameEle) {
666
667
  frameEle.src = "about:blank";
667
668
  }
669
+ app.microFEHost?.[DISPOSE_HOST]();
668
670
  this.removeAllScriptingObjects(instanceId);
669
671
  this.#eventManager.unsubscribeByGuestId(instanceId);
670
672
  this.#activeApps.delete(instanceId);
@@ -813,7 +815,6 @@ class CAppBridge {
813
815
  selfInitialize
814
816
  } = params;
815
817
  const instanceId = uuidv4();
816
- if (metadata) this.#guestMetadata.set(instanceId, metadata);
817
818
  const appConfig = this.#microFEConfig.getConfigById(id);
818
819
  if (!appConfig) {
819
820
  throw new Error(`Application ${id} is not found in app config`);
@@ -828,23 +829,23 @@ class CAppBridge {
828
829
  hostUrl: appConfig.hostUrl,
829
830
  options: { title: appConfig.name, ...frameOptions }
830
831
  });
831
- if (!frameEle?.contentDocument)
832
+ if (!frameEle?.contentDocument) {
833
+ Frame.remove(instanceId);
832
834
  throw new Error("unable to create iframe for the microapp");
835
+ }
836
+ let microFEHost;
833
837
  try {
838
+ if (metadata) this.#guestMetadata.set(instanceId, metadata);
834
839
  this.#appRegistry.add({
835
840
  id,
836
841
  instanceId,
837
842
  documentEle: frameEle.contentDocument
838
843
  });
839
- const microFEHost = this.#setupIframe(
840
- frameEle.contentDocument,
841
- appConfig,
842
- {
843
- id,
844
- instanceId,
845
- containerId: frameOptions?.containerId
846
- }
847
- );
844
+ microFEHost = this.#setupIframe(frameEle.contentDocument, appConfig, {
845
+ id,
846
+ instanceId,
847
+ containerId: frameOptions?.containerId
848
+ });
848
849
  const manifest = await manifestPromise;
849
850
  await this.#loadApp({
850
851
  instanceId,
@@ -866,6 +867,8 @@ class CAppBridge {
866
867
  this.#bindModuleUnload(id, instanceId);
867
868
  return instanceId;
868
869
  } catch (err) {
870
+ microFEHost?.[DISPOSE_HOST]();
871
+ this.#eventManager.unsubscribeByGuestId(instanceId);
869
872
  this.#guestMetadata.delete(instanceId);
870
873
  this.#unbindModuleUnload(instanceId, id);
871
874
  this.#unloadApp({
@@ -874,6 +877,8 @@ class CAppBridge {
874
877
  hostUrl: appConfig.hostUrl,
875
878
  documentEle: frameEle.contentDocument
876
879
  });
880
+ this.#activeApps.delete(instanceId);
881
+ this.removeAllScriptingObjects(instanceId);
877
882
  Frame.remove(instanceId);
878
883
  throw err;
879
884
  }
@@ -184,7 +184,7 @@ class EventManager {
184
184
  * @param {SubscribeParam<EventId, AppEvents[EventId]>} param - parameters for subscribing to an event
185
185
  */
186
186
  subscribe = (param) => {
187
- const { eventId, callback, criteria, guestId } = param;
187
+ const { eventId, callback, criteria, guestId, ownerInstanceId } = param;
188
188
  if (!eventId) throw new Error("eventId is required");
189
189
  if (!callback) throw new Error("Callback is required");
190
190
  const listeners = this.#listeners.get(eventId) || [];
@@ -193,25 +193,57 @@ class EventManager {
193
193
  token,
194
194
  criteria,
195
195
  guestId,
196
+ ...ownerInstanceId ? { ownerInstanceId } : {},
196
197
  callback
197
198
  });
198
199
  this.#listeners.set(eventId, listeners);
199
200
  return token;
200
201
  };
201
202
  /**
202
- * Unsubscribe from an event
203
+ * Removes the listeners of an event that match the predicate
204
+ * @param {string} eventId event id
205
+ * @param {Function} shouldRemove predicate that selects the listeners to remove
206
+ */
207
+ #removeListeners = (eventId, shouldRemove) => {
208
+ const listeners = this.#listeners.get(eventId);
209
+ if (!listeners) return;
210
+ const remaining = listeners.filter((listener) => !shouldRemove(listener));
211
+ if (remaining.length === 0) {
212
+ this.#listeners.delete(eventId);
213
+ } else if (remaining.length !== listeners.length) {
214
+ this.#listeners.set(eventId, remaining);
215
+ }
216
+ };
217
+ /**
218
+ * Unsubscribe from an event.
219
+ *
220
+ * With a token, removes that subscription; a token that matches nothing
221
+ * (including an empty string) removes nothing. Without a token (undefined or
222
+ * null), removes every listener of the event, or, when `ownerInstanceId` is
223
+ * given, only the listeners registered by that owner. When `ownerInstanceId`
224
+ * is given, a token unsubscribe only removes a listener registered by that
225
+ * owner; a token owned by someone else is kept and a warning is logged.
226
+ * Removal never mutates the listener array an in-progress dispatch iterates.
203
227
  * @param {UnsubscribeParam<EventId>} param - parameters for unsubscribing from an event
204
228
  */
205
229
  unsubscribe = (param) => {
206
- const { eventId, token } = param;
230
+ const { eventId, token, ownerInstanceId } = param;
207
231
  if (!eventId) throw new Error("eventId id is required");
208
- if (token) {
209
- const listeners = this.#listeners.get(eventId) || [];
210
- const index = listeners.findIndex((listener) => listener.token === token);
211
- if (index > -1) {
212
- listeners.splice(index, 1);
213
- this.#listeners.set(eventId, listeners);
232
+ const isOwned = (listener) => !ownerInstanceId || listener.ownerInstanceId === ownerInstanceId;
233
+ if (token !== void 0 && token !== null) {
234
+ const listener = this.#listeners.get(eventId)?.find((item) => item.token === token);
235
+ if (!listener) return;
236
+ if (!isOwned(listener)) {
237
+ this.#logger?.warn(
238
+ `Ignoring unsubscribe from ${eventId} by ${String(
239
+ ownerInstanceId
240
+ )}: the subscription belongs to another owner`
241
+ );
242
+ return;
214
243
  }
244
+ this.#removeListeners(eventId, (item) => item.token === token);
245
+ } else if (ownerInstanceId) {
246
+ this.#removeListeners(eventId, isOwned);
215
247
  } else {
216
248
  this.#listeners.delete(eventId);
217
249
  }
@@ -223,21 +255,18 @@ class EventManager {
223
255
  this.#listeners.clear();
224
256
  };
225
257
  /**
226
- * Removes every listener registered for a guest iframe host instance.
227
- * Global listeners (no guestId) are preserved.
258
+ * Removes every listener registered for a guest iframe host instance:
259
+ * listeners scoped to it (`guestId`) and listeners it owns
260
+ * (`ownerInstanceId`). Listeners of the host and of other guests are preserved.
228
261
  * @param guestId openApp instance id
229
262
  */
230
263
  unsubscribeByGuestId = (guestId) => {
231
264
  if (!guestId) return;
232
- this.#listeners.forEach((listeners, eventId) => {
233
- const remaining = listeners.filter(
234
- (listener) => listener.guestId !== guestId
265
+ [...this.#listeners.keys()].forEach((eventId) => {
266
+ this.#removeListeners(
267
+ eventId,
268
+ (listener) => listener.guestId === guestId || listener.ownerInstanceId === guestId
235
269
  );
236
- if (remaining.length === 0) {
237
- this.#listeners.delete(eventId);
238
- } else if (remaining.length !== listeners.length) {
239
- this.#listeners.set(eventId, remaining);
240
- }
241
270
  });
242
271
  };
243
272
  }
@@ -4,6 +4,7 @@ import {
4
4
  ScriptingObjectProxy
5
5
  } from "@elliemae/microfe-common";
6
6
  import { LATEST_VERSION } from "./constant.js";
7
+ const DISPOSE_HOST = /* @__PURE__ */ Symbol("pui-app-bridge.disposeMicroFEHost");
7
8
  const GUEST_SCOPED_MODULE_EVENTS = /* @__PURE__ */ new Set([
8
9
  "module.unloading",
9
10
  "module.unmount"
@@ -35,6 +36,11 @@ class CMicroFEHost {
35
36
  #version;
36
37
  #soManager;
37
38
  #eventManager;
39
+ #logger;
40
+ /**
41
+ * set once the guest is closed; a disposed host registers no new listeners
42
+ */
43
+ #disposed = false;
38
44
  /**
39
45
  * Create new instance of the host frontend application
40
46
  * @param {CMicroFEHostParams} params - constructor parameters
@@ -45,6 +51,7 @@ class CMicroFEHost {
45
51
  this.#version = params?.version || LATEST_VERSION;
46
52
  this.#soManager = params.soManager;
47
53
  this.#eventManager = params.eventManager;
54
+ this.#logger = params.logger;
48
55
  }
49
56
  /**
50
57
  * application release version
@@ -129,22 +136,45 @@ class CMicroFEHost {
129
136
  }
130
137
  };
131
138
  /**
132
- * add listener to the scripting object event
139
+ * add listener to the scripting object event.
140
+ * The listener is owned by this guest instance and is removed when the guest is closed.
133
141
  * @param {SubscribeParam<EventId, EventListener>} params - parameters to add event listener
134
- * @returns subscription id
142
+ * @returns subscription id, or an empty string when the guest is already closed
135
143
  */
136
- subscribe = (params) => this.#eventManager.subscribe({
137
- ...params,
138
- ...GUEST_SCOPED_MODULE_EVENTS.has(params.eventId) ? { guestId: this.#instanceId } : {}
139
- });
144
+ subscribe = (params) => {
145
+ if (this.#disposed) {
146
+ this.#logger?.warn(
147
+ `Ignoring subscribe to ${params?.eventId} from guest ${this.#guest.id} with instance id ${this.#instanceId}: the guest is closed`
148
+ );
149
+ return "";
150
+ }
151
+ return this.#eventManager.subscribe({
152
+ ...params,
153
+ ...GUEST_SCOPED_MODULE_EVENTS.has(params.eventId) ? { guestId: this.#instanceId } : {},
154
+ ownerInstanceId: this.#instanceId
155
+ });
156
+ };
140
157
  /**
141
- * removes listener from the scripting object event
158
+ * removes listener from the scripting object event.
159
+ * Only listeners registered by this guest instance are removed.
142
160
  * @param {UnsubscribeParam<EventId>} params - parameters to remove event listener
143
161
  */
144
162
  unsubscribe = (params) => {
145
- this.#eventManager.unsubscribe(params);
163
+ this.#eventManager.unsubscribe({
164
+ ...params,
165
+ ownerInstanceId: this.#instanceId
166
+ });
146
167
  };
168
+ /**
169
+ * Called by the app bridge when the guest is closed.
170
+ * Later subscribe calls are ignored so a closed guest cannot register listeners again.
171
+ * @internal
172
+ */
173
+ [DISPOSE_HOST]() {
174
+ this.#disposed = true;
175
+ }
147
176
  }
148
177
  export {
149
- CMicroFEHost
178
+ CMicroFEHost,
179
+ DISPOSE_HOST
150
180
  };
@@ -1,4 +1,4 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>AppBridge E2E — Comprehensive Host Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiAppBridge.d51e198b1c4d4ee0e752.js"></script></head><body class="bg-gray-50"><header class="bg-indigo-600 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">AppBridge E2E — Comprehensive Host Test</h1><a href="./e2e-index.html" class="text-indigo-200 hover:text-white text-sm">&larr; Back to dashboard</a></header><main class="mx-auto max-w-7xl px-4 py-4"><div class="bg-blue-50 border border-blue-200 rounded-md p-3 mb-4"><h2 class="text-sm font-bold text-blue-900 mb-1">How to Use This Page</h2><ol class="text-xs text-blue-800 list-decimal ml-4 space-y-1"><li>Wait for <strong>"E2E Host ready"</strong> in the Event Log.</li><li>Use buttons in each section to test AppBridge features.</li><li>Check Event Log and result panels for expected output.</li><li>Work through the Verification Checklist at the bottom.</li></ol></div><div class="grid grid-cols-3 gap-4"><div class="col-span-2 space-y-4"><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">App Loading</h2><div class="flex flex-wrap gap-2"><button data-testid="btn-open-app" id="btnOpenApp" class="rounded bg-indigo-600 px-3 py-1 text-xs text-white hover:bg-indigo-700">Open App (pricingservice)</button> <button data-testid="btn-open-credit" id="btnOpenCredit" class="rounded bg-indigo-600 px-3 py-1 text-xs text-white hover:bg-indigo-700">Open App (creditservice)</button> <button data-testid="btn-open-validation" id="btnOpenValidation" class="rounded bg-indigo-600 px-3 py-1 text-xs text-white hover:bg-indigo-700">Open App (loanvalidation)</button> <button data-testid="btn-open-with-metadata" id="btnOpenWithMetadata" class="rounded bg-purple-600 px-3 py-1 text-xs text-white hover:bg-purple-700">Open App with Metadata</button> <button data-testid="btn-open-e2e-guest" id="btnOpenE2EGuest" class="rounded bg-teal-600 px-3 py-1 text-xs text-white hover:bg-teal-700">Open E2E Test Guest</button> <button data-testid="btn-open-nested-chain" id="btnOpenNestedChain" class="rounded bg-orange-600 px-3 py-1 text-xs text-white hover:bg-orange-700">Open Nested Chain (A→B→C)</button></div><p class="text-xs text-gray-400 mt-1"><strong>Expected:</strong> App loads into the container below. Log shows "openApp" succeeded. The E2E Test Guest provides interactive buttons to test guest→host communication. The Nested Chain (A→B→C) opens an intermediate that clones Loan and re-exposes it to a grandchild — use C's buttons to verify callChain propagation on Host A.</p></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Scripting Object Management</h2><div class="flex flex-wrap gap-2"><button data-testid="btn-add-so" id="btnAddSO" class="rounded bg-green-600 px-3 py-1 text-xs text-white hover:bg-green-700">Add "Inventory" Object</button> <button data-testid="btn-remove-so" id="btnRemoveSO" class="rounded bg-red-600 px-3 py-1 text-xs text-white hover:bg-red-700">Remove "Inventory" Object</button> <button data-testid="btn-remove-all-so" id="btnRemoveAllSO" class="rounded bg-red-600 px-3 py-1 text-xs text-white hover:bg-red-700">Remove All Objects</button></div><p class="text-xs text-gray-400 mt-1"><strong>Expected:</strong> Add succeeds. Remove succeeds. Guest apps can/cannot call removed objects.</p></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Event Dispatching</h2><div class="flex flex-wrap gap-2"><button data-testid="btn-dispatch-presave" id="btnDispatchPreSave" class="rounded bg-yellow-600 px-3 py-1 text-xs text-white hover:bg-yellow-700">Dispatch onPreSave (all apps)</button> <button data-testid="btn-dispatch-amount" id="btnDispatchAmount" class="rounded bg-yellow-600 px-3 py-1 text-xs text-white hover:bg-yellow-700">Dispatch onLoanAmountChanged</button> <button data-testid="btn-dispatch-term" id="btnDispatchTerm" class="rounded bg-yellow-600 px-3 py-1 text-xs text-white hover:bg-yellow-700">Dispatch onLoanTermChanged</button></div><div data-testid="dispatch-result" id="dispatchResult" class="mt-2 text-xs bg-gray-100 rounded p-2 min-h-[40px]">Dispatch results appear here...</div></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">callContext (from last scripting object invocation)</h2><div class="grid grid-cols-2 gap-2"><div><h3 class="text-xs font-medium text-gray-500 mb-1">callContext.guest</h3><pre data-testid="call-context-guest" id="callContextGuest" class="text-xs bg-gray-100 rounded p-2 min-h-[30px] whitespace-pre-wrap">
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>AppBridge E2E — Comprehensive Host Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiAppBridge.a2a0a24ba9221b91e9ea.js"></script></head><body class="bg-gray-50"><header class="bg-indigo-600 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">AppBridge E2E — Comprehensive Host Test</h1><a href="./e2e-index.html" class="text-indigo-200 hover:text-white text-sm">&larr; Back to dashboard</a></header><main class="mx-auto max-w-7xl px-4 py-4"><div class="bg-blue-50 border border-blue-200 rounded-md p-3 mb-4"><h2 class="text-sm font-bold text-blue-900 mb-1">How to Use This Page</h2><ol class="text-xs text-blue-800 list-decimal ml-4 space-y-1"><li>Wait for <strong>"E2E Host ready"</strong> in the Event Log.</li><li>Use buttons in each section to test AppBridge features.</li><li>Check Event Log and result panels for expected output.</li><li>Work through the Verification Checklist at the bottom.</li></ol></div><div class="grid grid-cols-3 gap-4"><div class="col-span-2 space-y-4"><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">App Loading</h2><div class="flex flex-wrap gap-2"><button data-testid="btn-open-app" id="btnOpenApp" class="rounded bg-indigo-600 px-3 py-1 text-xs text-white hover:bg-indigo-700">Open App (pricingservice)</button> <button data-testid="btn-open-credit" id="btnOpenCredit" class="rounded bg-indigo-600 px-3 py-1 text-xs text-white hover:bg-indigo-700">Open App (creditservice)</button> <button data-testid="btn-open-validation" id="btnOpenValidation" class="rounded bg-indigo-600 px-3 py-1 text-xs text-white hover:bg-indigo-700">Open App (loanvalidation)</button> <button data-testid="btn-open-with-metadata" id="btnOpenWithMetadata" class="rounded bg-purple-600 px-3 py-1 text-xs text-white hover:bg-purple-700">Open App with Metadata</button> <button data-testid="btn-open-e2e-guest" id="btnOpenE2EGuest" class="rounded bg-teal-600 px-3 py-1 text-xs text-white hover:bg-teal-700">Open E2E Test Guest</button> <button data-testid="btn-open-nested-chain" id="btnOpenNestedChain" class="rounded bg-orange-600 px-3 py-1 text-xs text-white hover:bg-orange-700">Open Nested Chain (A→B→C)</button></div><p class="text-xs text-gray-400 mt-1"><strong>Expected:</strong> App loads into the container below. Log shows "openApp" succeeded. The E2E Test Guest provides interactive buttons to test guest→host communication. The Nested Chain (A→B→C) opens an intermediate that clones Loan and re-exposes it to a grandchild — use C's buttons to verify callChain propagation on Host A.</p></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Scripting Object Management</h2><div class="flex flex-wrap gap-2"><button data-testid="btn-add-so" id="btnAddSO" class="rounded bg-green-600 px-3 py-1 text-xs text-white hover:bg-green-700">Add "Inventory" Object</button> <button data-testid="btn-remove-so" id="btnRemoveSO" class="rounded bg-red-600 px-3 py-1 text-xs text-white hover:bg-red-700">Remove "Inventory" Object</button> <button data-testid="btn-remove-all-so" id="btnRemoveAllSO" class="rounded bg-red-600 px-3 py-1 text-xs text-white hover:bg-red-700">Remove All Objects</button></div><p class="text-xs text-gray-400 mt-1"><strong>Expected:</strong> Add succeeds. Remove succeeds. Guest apps can/cannot call removed objects.</p></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Event Dispatching</h2><div class="flex flex-wrap gap-2"><button data-testid="btn-dispatch-presave" id="btnDispatchPreSave" class="rounded bg-yellow-600 px-3 py-1 text-xs text-white hover:bg-yellow-700">Dispatch onPreSave (all apps)</button> <button data-testid="btn-dispatch-amount" id="btnDispatchAmount" class="rounded bg-yellow-600 px-3 py-1 text-xs text-white hover:bg-yellow-700">Dispatch onLoanAmountChanged</button> <button data-testid="btn-dispatch-term" id="btnDispatchTerm" class="rounded bg-yellow-600 px-3 py-1 text-xs text-white hover:bg-yellow-700">Dispatch onLoanTermChanged</button></div><div data-testid="dispatch-result" id="dispatchResult" class="mt-2 text-xs bg-gray-100 rounded p-2 min-h-[40px]">Dispatch results appear here...</div></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">callContext (from last scripting object invocation)</h2><div class="grid grid-cols-2 gap-2"><div><h3 class="text-xs font-medium text-gray-500 mb-1">callContext.guest</h3><pre data-testid="call-context-guest" id="callContextGuest" class="text-xs bg-gray-100 rounded p-2 min-h-[30px] whitespace-pre-wrap">
2
2
  Waiting for invocation...</pre></div><div><h3 class="text-xs font-medium text-gray-500 mb-1">callContext.callChain</h3><pre data-testid="call-context-chain" id="callContextChain" class="text-xs bg-gray-100 rounded p-2 min-h-[30px] whitespace-pre-wrap">
3
3
  Waiting for invocation...</pre></div></div></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">App Lifecycle</h2><div class="flex flex-wrap gap-2"><button data-testid="btn-close-app" id="btnCloseApp" class="rounded bg-red-600 px-3 py-1 text-xs text-white hover:bg-red-700">Close First App</button> <button data-testid="btn-close-all" id="btnCloseAll" class="rounded bg-red-800 px-3 py-1 text-xs text-white hover:bg-red-900">Close All Apps</button> <button data-testid="btn-list-apps" id="btnListApps" class="rounded bg-gray-600 px-3 py-1 text-xs text-white hover:bg-gray-700">List Apps</button></div><pre data-testid="app-list" id="appList" class="mt-2 text-xs bg-gray-100 rounded p-2 min-h-[30px] whitespace-pre-wrap">
4
4
  (no apps)</pre></div></div><div class="space-y-4"><div class="bg-white rounded-lg shadow p-3"><h2 class="text-sm font-semibold text-gray-700 mb-2">Guest App Container</h2><div data-testid="app-container" id="appContainer" class="border-2 border-dashed border-indigo-300 rounded-lg" style="height:700px;overflow:auto"></div></div><div class="bg-white rounded-lg shadow p-3"><div class="flex justify-between items-center mb-2"><h2 class="text-sm font-semibold text-gray-700">Event Log</h2><button data-testid="btn-clear-log" id="btnClearLog" class="rounded bg-gray-200 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-300">Clear</button></div><div data-testid="event-log" id="eventLog" class="text-xs bg-gray-100 rounded p-2 min-h-[200px] max-h-[400px] overflow-y-auto"></div></div></div></div><div class="bg-gray-100 border border-gray-300 rounded-md p-3 mt-4"><h2 class="text-sm font-bold text-gray-800 mb-2">Verification Checklist</h2><div class="grid grid-cols-2 gap-2 text-xs"><label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-APP-01:</strong> openApp loads pricingservice into container, log shows mounted</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-APP-02:</strong> openApp loads creditservice into container</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-APP-03:</strong> openApp loads loanvalidation into container</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-APP-04:</strong> openApp with metadata — metadata stored for callChain</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-SO-01:</strong> Loan object registered on init (guest apps can call getLoanDetails)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-SO-02:</strong> Add Inventory object succeeds</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-SO-03:</strong> Remove Inventory object succeeds</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-SO-04:</strong> removeAllScriptingObjects clears everything</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-SO-05:</strong> callContext.guest populated when guest invokes scripting object method</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-SO-06:</strong> Loan.getLoanDetails returns expected loan data</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-EVT-01:</strong> Dispatch onPreSave reaches all subscribed apps, results returned</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-EVT-02:</strong> Dispatch onLoanAmountChanged reaches subscribed apps</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-EVT-03:</strong> Dispatch onLoanTermChanged reaches subscribed apps</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-LIFE-01:</strong> closeApp removes first app from list</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-LIFE-02:</strong> List Apps shows all active apps with instanceIds</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-LIFE-03:</strong> closeAllApps removes all apps</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-LIFE-04:</strong> No console errors during any operation</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-META-01:</strong> openApp with metadata — callContext.callChain contains metadata when guest invokes cloned object</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-01:</strong> Guest getObject("Loan") returns proxy with expected methods (getLoanDetails, setCreditScore)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-02:</strong> Guest Loan.getLoanDetails() returns loan data, host callContext.guest shows e2etestguest</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-03:</strong> Guest Loan.setCreditScore(800) returns {updated: true}, host callContext updates</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-04:</strong> Guest getObject("Inventory") returns proxy after host adds it; null before</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-05:</strong> Guest Inventory.getItems() returns item array</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-06:</strong> Guest getObject("NonExistent") returns null</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-07:</strong> Guest subscribes to onPreSave — receives event when host dispatches</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-08:</strong> Guest subscribes to onLoanAmountChanged — receives event when host dispatches</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-GUEST-09:</strong> Guest unsubscribe all — no more events received after unsubscribe</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-CHAIN-01:</strong> Open Nested Chain — Intermediate B loads, shows "CAppBridge B initialized"</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-CHAIN-02:</strong> Grandchild C (E2E Test Guest) appears inside Intermediate B</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-CHAIN-03:</strong> In C: getObject("Loan") → Loan.getLoanDetails() → Host A shows callContext.guest = e2eintermediateguest, callChain = [{id: "e2etestguest", metadata: {role: "grandchild", ...}}]</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-CHAIN-04:</strong> In C: Loan.setCreditScore(800) → Host A callChain includes e2etestguest with metadata from B</span></label></div></div></main><script src="./e2e-host.js" type="module"></script></body></html>
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>AppBridge E2E Test Suite</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiAppBridge.d51e198b1c4d4ee0e752.js"></script></head><body class="bg-gray-50"><header class="bg-gray-900 text-white px-6 py-4"><h1 class="text-xl font-bold">AppBridge End-to-End Test Suite</h1><p class="text-sm text-gray-400 mt-1">Comprehensive blackbox tests for AppBridge (in-process micro-frontend framework). Each page includes test steps, expected values, and a verification checklist.</p></header><main class="mx-auto max-w-5xl px-6 py-6"><section class="mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4"><h2 class="text-sm font-semibold text-yellow-800 mb-2">Setup Instructions</h2><ol class="text-xs text-yellow-700 list-decimal ml-4 space-y-1"><li>Install dependencies: <code class="bg-yellow-100 px-1 rounded">pnpm install</code></li><li>Start AppBridge dev server: <code class="bg-yellow-100 px-1 rounded">cd libs/app-bridge && pnpm start</code> (default port 3000)</li><li>Open <code class="bg-yellow-100 px-1 rounded">http://localhost:3000/e2e-index.html</code> in the browser</li><li>Each test page has <code class="bg-yellow-100 px-1 rounded">data-testid</code> attributes for Playwright/Cypress selectors</li></ol></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">1. Core AppBridge Host Tests</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./e2e-host.html" data-testid="link-e2e-host" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Comprehensive E2E Host</h3><p class="text-xs text-gray-500 mt-1">All host scenarios: openApp, closeApp, scripting objects, events, lifecycle, metadata, callContext.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Apps open and mount into containers. Scripting objects can be added/removed/invoked with correct callContext. Events reach subscribed apps. closeApp/closeAllApps cleans up properly.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-APP-01..04 &bull; TC-SO-01..06 &bull; TC-EVT-01..03 &bull; TC-LIFE-01..04 &bull; TC-META-01</div></a><a href="./index.html" data-testid="link-main-demo" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Main Demo App</h3><p class="text-xs text-gray-500 mt-1">Original Loan Application demo with credit, pricing, and loan validation micro-apps.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Loan form data flows to guest apps. Events (onLoanAmountChanged, etc.) update guest UIs. Credit score updates from guest. Save dispatches onPreSave with feedback.</p></a></div></section></main></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>AppBridge E2E Test Suite</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiAppBridge.a2a0a24ba9221b91e9ea.js"></script></head><body class="bg-gray-50"><header class="bg-gray-900 text-white px-6 py-4"><h1 class="text-xl font-bold">AppBridge End-to-End Test Suite</h1><p class="text-sm text-gray-400 mt-1">Comprehensive blackbox tests for AppBridge (in-process micro-frontend framework). Each page includes test steps, expected values, and a verification checklist.</p></header><main class="mx-auto max-w-5xl px-6 py-6"><section class="mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4"><h2 class="text-sm font-semibold text-yellow-800 mb-2">Setup Instructions</h2><ol class="text-xs text-yellow-700 list-decimal ml-4 space-y-1"><li>Install dependencies: <code class="bg-yellow-100 px-1 rounded">pnpm install</code></li><li>Start AppBridge dev server: <code class="bg-yellow-100 px-1 rounded">cd libs/app-bridge && pnpm start</code> (default port 3000)</li><li>Open <code class="bg-yellow-100 px-1 rounded">http://localhost:3000/e2e-index.html</code> in the browser</li><li>Each test page has <code class="bg-yellow-100 px-1 rounded">data-testid</code> attributes for Playwright/Cypress selectors</li></ol></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">1. Core AppBridge Host Tests</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./e2e-host.html" data-testid="link-e2e-host" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Comprehensive E2E Host</h3><p class="text-xs text-gray-500 mt-1">All host scenarios: openApp, closeApp, scripting objects, events, lifecycle, metadata, callContext.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Apps open and mount into containers. Scripting objects can be added/removed/invoked with correct callContext. Events reach subscribed apps. closeApp/closeAllApps cleans up properly.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-APP-01..04 &bull; TC-SO-01..06 &bull; TC-EVT-01..03 &bull; TC-LIFE-01..04 &bull; TC-META-01</div></a><a href="./index.html" data-testid="link-main-demo" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Main Demo App</h3><p class="text-xs text-gray-500 mt-1">Original Loan Application demo with credit, pricing, and loan validation micro-apps.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Loan form data flows to guest apps. Events (onLoanAmountChanged, etc.) update guest UIs. Credit score updates from guest. Save dispatches onPreSave with feedback.</p></a></div></section></main></body></html>
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="mobile-web-app-capable" content="yes"/><link rel="icon" href="/favicon.ico"/><title>Application</title><style nonce="__CSP_NONCE__">.full-width{width:100%}.full-height{height:100%}</style><script defer="defer" src="js/emuiAppBridge.d51e198b1c4d4ee0e752.js"></script></head><body class="full-width full-height"><noscript>If you're seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>, please <strong>enable JS</strong> to make this app work.</noscript><div id="pui-app-container-" class="full-width full-height"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="mobile-web-app-capable" content="yes"/><link rel="icon" href="/favicon.ico"/><title>Application</title><style nonce="__CSP_NONCE__">.full-width{width:100%}.full-height{height:100%}</style><script defer="defer" src="js/emuiAppBridge.a2a0a24ba9221b91e9ea.js"></script></head><body class="full-width full-height"><noscript>If you're seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>, please <strong>enable JS</strong> to make this app work.</noscript><div id="pui-app-container-" class="full-width full-height"></div></body></html>