@elliemae/ssf-host 2.25.4 → 2.25.5
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.
- package/dist/cjs/host.js +805 -547
- package/dist/cjs/tests/utils.js +7 -1
- package/dist/esm/host.js +805 -547
- package/dist/esm/tests/utils.js +7 -1
- package/dist/public/callchain-host.html +1 -1
- package/dist/public/callchain-intermediate.html +1 -1
- package/dist/public/e2e-host.html +1 -1
- package/dist/public/e2e-index.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiSsfHost.d6a79085f12931748e80.js +3 -0
- package/dist/public/js/emuiSsfHost.d6a79085f12931748e80.js.br +0 -0
- package/dist/public/js/emuiSsfHost.d6a79085f12931748e80.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.d6a79085f12931748e80.js.map +1 -0
- package/dist/public/popup-focus-host.html +1 -1
- package/dist/public/v1-guest-v2-host.html +1 -1
- package/dist/public/v2-host-v1-guest.html +1 -1
- package/dist/types/lib/host.d.ts +5 -101
- package/dist/types/lib/ihost.d.ts +1 -16
- package/dist/types/lib/tests/utils.d.ts +10 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.br +0 -0
- package/dist/umd/index.js.gz +0 -0
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/public/js/emuiSsfHost.1f1cbf6c2111a68bc2c8.js +0 -3
- package/dist/public/js/emuiSsfHost.1f1cbf6c2111a68bc2c8.js.br +0 -0
- package/dist/public/js/emuiSsfHost.1f1cbf6c2111a68bc2c8.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.1f1cbf6c2111a68bc2c8.js.map +0 -1
package/dist/types/lib/host.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IScriptingObjectProxy, ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
|
|
2
2
|
import type { EventListeners, AddScriptingObjectParams, GetObjectParams, DispatchEventParam, EventOptions } from '@elliemae/microfe-common';
|
|
3
3
|
import { LogLevels } from '@elliemae/pui-diagnostics';
|
|
4
|
-
import { IFrameSandboxValues, ValueOf, ScriptingObjects
|
|
4
|
+
import { IFrameSandboxValues, ValueOf, ScriptingObjects } from './types.js';
|
|
5
5
|
import { ISSFHost, HostOption, LoadGuestParam, LoadGuestsParam, GuestCloseParam } from './ihost.js';
|
|
6
6
|
import { Guest } from './guest.js';
|
|
7
7
|
export declare const SANDBOX_DEFAULT: IFrameSandboxValues[];
|
|
@@ -85,106 +85,10 @@ export declare class SSFHost<AppObjects extends ScriptingObjects = ScriptingObje
|
|
|
85
85
|
*/
|
|
86
86
|
setLogLevel: (level: LogLevels) => void;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* - Standard guest disposal
|
|
92
|
-
* - Removes from tracking maps
|
|
93
|
-
*
|
|
94
|
-
* **Enhanced Mode (with options):**
|
|
95
|
-
* - `purgeOnDestroy: true` - Uses comprehensive cleanup via `unloadGuestWithFullCleanup`
|
|
96
|
-
* - Calls guest cleanup function (React unmount, Redux teardown)
|
|
97
|
-
* - Closes contentWindow context
|
|
98
|
-
* - Navigates iframe to about:blank
|
|
99
|
-
* - Removes iframe from DOM (deferred)
|
|
100
|
-
* - Clears all window.emui and window.elli.script references
|
|
101
|
-
* - Disconnects FieldMutation observers
|
|
102
|
-
* - Removes from SSF tracking
|
|
103
|
-
*
|
|
104
|
-
* - `windowRefsToClear` - Array of paths to window refs to clear recursively
|
|
105
|
-
* - Example: ["window.IMT.focusFormTitle", "window.emui.customApp"]
|
|
106
|
-
* - Each path is parsed and set to null
|
|
107
|
-
*
|
|
108
|
-
* - `appId` - Optional appId for targeted window.emui[appId] cleanup
|
|
109
|
-
*
|
|
110
|
-
* - `cleanupFunctionName` - Name of cleanup function on window.emui (default: 'unmount')
|
|
111
|
-
* @param {string | Window | HTMLIFrameElement} guestIdOrWindowOrEle - Unique id, window object, or iframe element
|
|
112
|
-
* @param {object} options - Optional cleanup configuration
|
|
113
|
-
* @param {boolean} options.purgeOnDestroy - When true, use comprehensive cleanup sequence
|
|
114
|
-
* @param {string[]} options.windowRefsToClear - Array of window ref paths to clear
|
|
115
|
-
* @param {string} options.appId - Optional appId for targeted cleanup
|
|
116
|
-
* @param {string} options.cleanupFunctionName - Guest cleanup function name (default: 'unmount')
|
|
117
|
-
* @example
|
|
118
|
-
* // Basic cleanup
|
|
119
|
-
* host.unloadGuest('my-guest-id');
|
|
120
|
-
* @example
|
|
121
|
-
* // Enhanced cleanup with purge
|
|
122
|
-
* host.unloadGuest('my-guest-id', {
|
|
123
|
-
* purgeOnDestroy: true,
|
|
124
|
-
* windowRefsToClear: ["window.IMT.focusFormTitle"],
|
|
125
|
-
* cleanupFunctionName: 'appCleanup'
|
|
126
|
-
* });
|
|
127
|
-
* @example
|
|
128
|
-
* // Enhanced cleanup with appId
|
|
129
|
-
* host.unloadGuest('my-guest-id', {
|
|
130
|
-
* purgeOnDestroy: true,
|
|
131
|
-
* appId: 'workflowtasks',
|
|
132
|
-
* cleanupFunctionName: 'cleanup'
|
|
133
|
-
* });
|
|
134
|
-
*/
|
|
135
|
-
unloadGuest: (guestIdOrWindowOrEle: string | Window | HTMLIFrameElement, options?: UnloadOptions) => void;
|
|
136
|
-
/**
|
|
137
|
-
* Unloads guest application with comprehensive memory leak prevention.
|
|
138
|
-
*
|
|
139
|
-
* This method implements industry best practices for iframe and popup cleanup to prevent
|
|
140
|
-
* memory leaks, particularly detached window retention and webpack bundle accumulation.
|
|
141
|
-
*
|
|
142
|
-
* **Enhanced Cleanup Sequence for Embedded Iframes:**
|
|
143
|
-
* 1. Call guest cleanup function (React unmount, Redux teardown, etc.)
|
|
144
|
-
* 2. Close contentWindow context explicitly
|
|
145
|
-
* 3. Navigate iframe to about:blank (Chrome GC recommendation)
|
|
146
|
-
* 4. Small delay, then remove iframe from DOM
|
|
147
|
-
* 5. Remove from SSF tracking maps
|
|
148
|
-
* 6. Null all internal references
|
|
149
|
-
*
|
|
150
|
-
* **Enhanced Cleanup Sequence for Popup Windows:**
|
|
151
|
-
* 1. Call guest cleanup function (React unmount, Redux teardown, etc.)
|
|
152
|
-
* 2. Null all window.emui and window.elli.script references
|
|
153
|
-
* 3. Clear Google Tag Manager data layer
|
|
154
|
-
* 4. Close popup window explicitly
|
|
155
|
-
* 5. Dispose guest (cleanup event listeners)
|
|
156
|
-
* 6. Remove from SSF tracking maps
|
|
157
|
-
*
|
|
158
|
-
* **Memory Leak Prevention:**
|
|
159
|
-
* - Breaks all closures from contentWindow/popup to parent
|
|
160
|
-
* - Signals V8 to GC webpack bundle backing store strings
|
|
161
|
-
* - Removes iframe from browser back/forward cache
|
|
162
|
-
* - Clears all SSF remoting message handlers
|
|
163
|
-
* - Nulls all window.emui and window.elli.script properties
|
|
164
|
-
*
|
|
165
|
-
* **Important:** This method does NOT clean up window.emui[appId] registry.
|
|
166
|
-
* When using selfInitialize=true pattern, the guest application handles
|
|
167
|
-
* its own emui registry cleanup internally.
|
|
168
|
-
*
|
|
169
|
-
* **Synchronous Design:** This method is intentionally synchronous to work
|
|
170
|
-
* with React useEffect cleanup functions. Cleanup steps use setTimeout
|
|
171
|
-
* for deferred operations rather than async/await.
|
|
172
|
-
* @param {string | Window | HTMLIFrameElement} guestIdOrWindowOrEle - unique id of the guest application or window object or dom element
|
|
173
|
-
* @param {string} cleanupFunctionName - name of cleanup function on window.emui (default: 'unmount')
|
|
174
|
-
* @example
|
|
175
|
-
* // Standard usage with app cleanup
|
|
176
|
-
* host.unloadGuestWithFullCleanup('my-guest-id', 'appCleanup');
|
|
177
|
-
* @example
|
|
178
|
-
* // Usage with custom cleanup function
|
|
179
|
-
* host.unloadGuestWithFullCleanup('my-guest-id', 'customUnmount');
|
|
180
|
-
* @example
|
|
181
|
-
* // Usage when guest uses default unmount
|
|
182
|
-
* host.unloadGuestWithFullCleanup('my-guest-id');
|
|
183
|
-
*/
|
|
184
|
-
unloadGuestWithFullCleanup: (guestIdOrWindowOrEle: string | Window | HTMLIFrameElement, cleanupFunctionName?: string) => void;
|
|
185
|
-
/**
|
|
186
|
-
* monitors guest window close action and executes the callback from host.
|
|
187
|
-
* @param param - Guest close parameters including id and callback
|
|
88
|
+
* unloads guest application from host
|
|
89
|
+
* @param guestIdOrWindowOrEle unique id of the guest application or window object or dom element of the guest application
|
|
90
|
+
* @throws Error if guestId or Window reference is invalid
|
|
188
91
|
*/
|
|
92
|
+
unloadGuest: (guestIdOrWindowOrEle: string | Window | HTMLIFrameElement) => Promise<void>;
|
|
189
93
|
onGuestClose: (param: GuestCloseParam) => void;
|
|
190
94
|
}
|
|
@@ -235,21 +235,6 @@ export interface ISSFHost<AppObjects extends ScriptingObjects = ScriptingObjectT
|
|
|
235
235
|
* @param guestIdOrWindowOrEle unique id of the guest application or window object or dom element of the guest application
|
|
236
236
|
* @throws Error if guestId or Window reference is invalid
|
|
237
237
|
*/
|
|
238
|
-
unloadGuest: (guestIdOrWindowOrEle: string | Window | HTMLIFrameElement) => void
|
|
239
|
-
/**
|
|
240
|
-
* Unloads guest application with comprehensive memory leak prevention.
|
|
241
|
-
*
|
|
242
|
-
* This method implements industry best practices for iframe cleanup to prevent
|
|
243
|
-
* memory leaks, particularly detached window retention and webpack bundle accumulation.
|
|
244
|
-
*
|
|
245
|
-
* **Enhanced for selfInitialize=true pattern:** Does not clean window.emui[appId]
|
|
246
|
-
* registry as the guest handles its own cleanup internally.
|
|
247
|
-
*
|
|
248
|
-
* **Synchronous by design:** Works with React useEffect cleanup functions.
|
|
249
|
-
* @param guestIdOrWindowOrEle unique id of the guest application or window object or dom element
|
|
250
|
-
* @param cleanupFunctionName name of cleanup function on window.emui (default: 'unmount')
|
|
251
|
-
* @throws Error if guestId or Window reference is invalid
|
|
252
|
-
*/
|
|
253
|
-
unloadGuestWithFullCleanup: (guestIdOrWindowOrEle: string | Window | HTMLIFrameElement, cleanupFunctionName?: string) => void;
|
|
238
|
+
unloadGuest: (guestIdOrWindowOrEle: string | Window | HTMLIFrameElement) => void | Promise<void>;
|
|
254
239
|
onGuestClose: (param: GuestCloseParam) => void;
|
|
255
240
|
}
|
|
@@ -13,6 +13,15 @@ export declare const postMessage: ({ srcWindow, targetWindow, message, }: {
|
|
|
13
13
|
}) => void;
|
|
14
14
|
export declare const initGuest: (guestId: string, capabilities?: Record<string, unknown>) => Window;
|
|
15
15
|
export declare const releaseJSThread: () => Promise<unknown>;
|
|
16
|
+
type UnloadGuestHost = {
|
|
17
|
+
unloadGuest: (guestId: string | Window | HTMLIFrameElement) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Fire-and-forget guest unload for test cleanup (avoids floating-promise lint).
|
|
21
|
+
* @param host
|
|
22
|
+
* @param guestId
|
|
23
|
+
*/
|
|
24
|
+
export declare const unloadGuestSilently: (host: UnloadGuestHost | null | undefined, guestId: string | Window | HTMLIFrameElement) => void;
|
|
16
25
|
export type Data = {
|
|
17
26
|
data: {
|
|
18
27
|
type: string;
|
|
@@ -26,3 +35,4 @@ export type Data = {
|
|
|
26
35
|
};
|
|
27
36
|
};
|
|
28
37
|
};
|
|
38
|
+
export {};
|