@elliemae/pui-app-sdk 5.40.0-beta.1 → 5.40.0-beta.2

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 (43) hide show
  1. package/demo/{4018.e3bb4bb2.iframe.bundle.js → 4018.2e1aaff7.iframe.bundle.js} +1 -1
  2. package/demo/4018.2e1aaff7.iframe.bundle.js.br +0 -0
  3. package/demo/{4018.e3bb4bb2.iframe.bundle.js.gz → 4018.2e1aaff7.iframe.bundle.js.gz} +0 -0
  4. package/demo/docs/{4018.e3bb4bb2.iframe.bundle.js → 4018.2e1aaff7.iframe.bundle.js} +1 -1
  5. package/demo/docs/4018.2e1aaff7.iframe.bundle.js.br +0 -0
  6. package/demo/docs/{4018.e3bb4bb2.iframe.bundle.js.gz → 4018.2e1aaff7.iframe.bundle.js.gz} +0 -0
  7. package/demo/docs/iframe.html +1 -1
  8. package/demo/docs/index.html +1 -1
  9. package/demo/docs/{main.b2bf60fb5c3e8e222a28.manager.bundle.js → main.81dbbc1cf5969ea75037.manager.bundle.js} +1 -1
  10. package/demo/docs/{main.b2bf60fb5c3e8e222a28.manager.bundle.js.br → main.81dbbc1cf5969ea75037.manager.bundle.js.br} +0 -0
  11. package/demo/docs/{main.b2bf60fb5c3e8e222a28.manager.bundle.js.gz → main.81dbbc1cf5969ea75037.manager.bundle.js.gz} +0 -0
  12. package/demo/docs/{main.d3eba28f.iframe.bundle.js → main.b0d74522.iframe.bundle.js} +3 -3
  13. package/demo/docs/main.b0d74522.iframe.bundle.js.br +0 -0
  14. package/demo/docs/main.b0d74522.iframe.bundle.js.gz +0 -0
  15. package/demo/docs/project.json +1 -1
  16. package/demo/iframe.html +1 -1
  17. package/demo/index.html +1 -1
  18. package/demo/{main.b2bf60fb5c3e8e222a28.manager.bundle.js → main.81dbbc1cf5969ea75037.manager.bundle.js} +1 -1
  19. package/demo/{main.b2bf60fb5c3e8e222a28.manager.bundle.js.br → main.81dbbc1cf5969ea75037.manager.bundle.js.br} +0 -0
  20. package/demo/{main.b2bf60fb5c3e8e222a28.manager.bundle.js.gz → main.81dbbc1cf5969ea75037.manager.bundle.js.gz} +0 -0
  21. package/demo/{main.d3eba28f.iframe.bundle.js → main.b0d74522.iframe.bundle.js} +3 -3
  22. package/demo/main.b0d74522.iframe.bundle.js.br +0 -0
  23. package/demo/main.b0d74522.iframe.bundle.js.gz +0 -0
  24. package/demo/project.json +1 -1
  25. package/dist/cjs/utils/micro-frontend/guest.js +20 -9
  26. package/dist/cjs/view/guest-microapp.js +2 -0
  27. package/dist/cjs/view/tests/app.config.json +11 -0
  28. package/dist/cjs/view/tests/constants.js +2 -0
  29. package/dist/esm/utils/micro-frontend/guest.js +20 -9
  30. package/dist/esm/view/guest-microapp.js +2 -0
  31. package/dist/esm/view/tests/app.config.json +11 -0
  32. package/dist/esm/view/tests/constants.js +2 -0
  33. package/dist/types/lib/utils/micro-frontend/guest.d.ts +6 -3
  34. package/dist/types/lib/utils/micro-frontend/types.d.ts +6 -0
  35. package/dist/types/lib/view/tests/constants.d.ts +1 -0
  36. package/dist/types/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +1 -1
  38. package/demo/4018.e3bb4bb2.iframe.bundle.js.br +0 -0
  39. package/demo/docs/4018.e3bb4bb2.iframe.bundle.js.br +0 -0
  40. package/demo/docs/main.d3eba28f.iframe.bundle.js.br +0 -0
  41. package/demo/docs/main.d3eba28f.iframe.bundle.js.gz +0 -0
  42. package/demo/main.d3eba28f.iframe.bundle.js.br +0 -0
  43. package/demo/main.d3eba28f.iframe.bundle.js.gz +0 -0
@@ -322,11 +322,14 @@ class CMicroAppGuest {
322
322
  if (route) this.props.history.push(route);
323
323
  }
324
324
  /**
325
- * Guest-initiated lifecycle: discovers the host, pulls module parameters,
326
- * and applies them. After this resolves the guest is ready to render.
325
+ * Guest-initiated lifecycle: discovers the host and applies module
326
+ * parameters if available. After this resolves the guest is ready to render.
327
327
  * Requires selfInitialize: true in the constructor so the bridge
328
328
  * skips calling init() / mount() on this guest.
329
- * @returns module parameters provided by the host
329
+ *
330
+ * The module scripting object is optional — if the host did not register
331
+ * one, a warning is logged and the guest proceeds with its own config.
332
+ * @returns module parameters provided by the host, or a minimal object with moduleId
330
333
  */
331
334
  async initialize() {
332
335
  const isStandalone = window.top === window.self && !window.opener;
@@ -343,14 +346,22 @@ class CMicroAppGuest {
343
346
  );
344
347
  }
345
348
  this.props.host = host;
346
- const module = await host.getObject("module");
347
- if (!module) {
348
- throw new Error(
349
- `Host did not register a module scripting object for guest "${this.appId}". Ensure the host registers a module SO before rendering GuestMicroApp.`
349
+ let params = { moduleId: this.appId };
350
+ try {
351
+ const module = await host.getObject("module");
352
+ if (module) {
353
+ params = await module.getParameters();
354
+ this.#applyModuleParams(params);
355
+ } else {
356
+ this.logger.warn(
357
+ `Host did not register a module scripting object for "${this.appId}". Proceeding without host-provided parameters (history, theme, initialRoute).`
358
+ );
359
+ }
360
+ } catch (ex) {
361
+ this.logger.warn(
362
+ `Failed to retrieve module parameters for "${this.appId}". Proceeding without host-provided parameters.`
350
363
  );
351
364
  }
352
- const params = await module.getParameters();
353
- this.#applyModuleParams(params);
354
365
  if (this.onInit) this.onInit(this.props);
355
366
  return params;
356
367
  }
@@ -60,6 +60,7 @@ const useAppRenderer = (props) => {
60
60
  hostUrl,
61
61
  title,
62
62
  name,
63
+ selfInitialize: configSelfInitialize,
63
64
  ssfAppOptions: configSsfAppOptions = {}
64
65
  } = getConfig();
65
66
  const mergedSsfAppOptions = {
@@ -107,6 +108,7 @@ const useAppRenderer = (props) => {
107
108
  if (isMounted) {
108
109
  instanceId = await appBridge.openApp({
109
110
  id,
111
+ selfInitialize: configSelfInitialize,
110
112
  frameOptions: {
111
113
  containerId,
112
114
  queryParams: buildLogRocketQueryParams()
@@ -25,6 +25,17 @@
25
25
  "style": "border: 2px solid red;"
26
26
  }
27
27
  },
28
+ "loanapp-selfinit": {
29
+ "name": "Loan Self Init",
30
+ "hostUrl": "./loan",
31
+ "selfInitialize": true,
32
+ "development": {
33
+ "files": ["index.js"]
34
+ },
35
+ "production": {
36
+ "files": ["index.js"]
37
+ }
38
+ },
28
39
  "taskapp": {
29
40
  "name": "Task",
30
41
  "hostUrl": "./task",
@@ -1,6 +1,7 @@
1
1
  const LATEST_VERSION = "latest";
2
2
  const RELEASE_VERSION = "23.1.0";
3
3
  const LOAN_APP_ID = "loanapp";
4
+ const LOAN_SELF_INIT_APP_ID = "loanapp-selfinit";
4
5
  const SSF_APP_ID = "ssfapp";
5
6
  const TASK_APP_ID = "taskapp";
6
7
  const FLIGHTS_APP_ID = "flights";
@@ -19,6 +20,7 @@ export {
19
20
  LATEST_VERSION,
20
21
  LOAN_APP_ID,
21
22
  LOAN_SAVED_EVENT,
23
+ LOAN_SELF_INIT_APP_ID,
22
24
  PRE_COMMIT_EVENT,
23
25
  RELEASE_VERSION,
24
26
  SSF_APP_ID,
@@ -96,11 +96,14 @@ export declare class CMicroAppGuest<AppObjects extends ScriptingObjects = Partia
96
96
  private findHost;
97
97
  get uuid(): string;
98
98
  /**
99
- * Guest-initiated lifecycle: discovers the host, pulls module parameters,
100
- * and applies them. After this resolves the guest is ready to render.
99
+ * Guest-initiated lifecycle: discovers the host and applies module
100
+ * parameters if available. After this resolves the guest is ready to render.
101
101
  * Requires selfInitialize: true in the constructor so the bridge
102
102
  * skips calling init() / mount() on this guest.
103
- * @returns module parameters provided by the host
103
+ *
104
+ * The module scripting object is optional — if the host did not register
105
+ * one, a warning is logged and the guest proceeds with its own config.
106
+ * @returns module parameters provided by the host, or a minimal object with moduleId
104
107
  */
105
108
  initialize(): Promise<ModuleParameters>;
106
109
  init(options: InitOptions<AppObjects, AppEvents>): Promise<void>;
@@ -127,6 +127,12 @@ export type MicroAppConfig = {
127
127
  * options for ssf based micro-frontend applications.
128
128
  */
129
129
  ssfAppOptions?: SSFAppOptions<Record<string, string | number | boolean>>;
130
+ /**
131
+ * When true the guest drives its own lifecycle via `initialize()` and
132
+ * the bridge skips calling `init()` / `mount()` on the guest.
133
+ * Set this in the `microFrontendApps` section of `app.config.json`.
134
+ */
135
+ selfInitialize?: boolean;
130
136
  /**
131
137
  * The Document object associated with the micro-frontend application.
132
138
  */
@@ -1,6 +1,7 @@
1
1
  export declare const LATEST_VERSION = "latest";
2
2
  export declare const RELEASE_VERSION = "23.1.0";
3
3
  export declare const LOAN_APP_ID = "loanapp";
4
+ export declare const LOAN_SELF_INIT_APP_ID = "loanapp-selfinit";
4
5
  export declare const SSF_APP_ID = "ssfapp";
5
6
  export declare const TASK_APP_ID = "taskapp";
6
7
  export declare const FLIGHTS_APP_ID = "flights";