You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/1.guide/17.client-context.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,9 @@ A client-only dock can also carry `type: 'json-render'` with an inline [JSON-ren
67
67
68
68
## Dock client scripts
69
69
70
-
A client script is a `ClientScriptEntry`: `{ importFrom, importName? }` (`importName` defaults `'default'`). The field varies by entry kind: an `action` entry's `action` runs when the dock button is activated, a `custom-render` entry's `renderer` renders its panel, and an `iframe` entry's optional `clientScript` runs alongside the iframe panel inside the host page ([Hub API reference](/references/hub-api#dock-client-script-fields)).
70
+
A client script is a `ClientScriptEntry`: `{ importFrom, importName?, eager? }` (`importName` defaults `'default'`). The field varies by entry kind: an `action` entry's `action` runs when the dock button is activated, a `custom-render` entry's `renderer` renders its panel, and an `iframe` entry's optional `clientScript` runs alongside the iframe panel inside the host page ([Hub API reference](/references/hub-api#dock-client-script-fields)).
71
+
72
+
Hub UI normally imports an iframe's client script when its dock is first activated. Set `eager: true` when the script must start observing the host app earlier: the module is imported and its exported function runs once, as soon as both the client context and dock entry are available. This is execution timing, not module preloading; it does not wait for the dock panel to open.
71
73
72
74
The exported function (`DockClientScriptContext`) receives the client context and two dock-scoped extras:
Copy file name to clipboardExpand all lines: docs/content/8.references/6.hub-api.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,8 @@ The properties of `DevframeClientContext`: [The client context](/guide/client-co
127
127
128
128
Which `ClientScriptEntry` field carries an entry's client script, and when it runs: [Dock client scripts](/guide/client-context#dock-client-scripts).
129
129
130
+
Every client script specifies `importFrom` and may specify `importName` (default: `default`). An iframe `clientScript` may additionally set `eager: true` to import and execute once as soon as the client context and dock entry are available, before activation.
131
+
130
132
| Entry kind | Field | Runs |
131
133
|---|---|---|
132
134
|`action`|`action`| when the dock button is activated |
0 commit comments