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
fix(hub): keep custom-render renderers activation-gated and enable eager demo docks
A `custom-render` renderer needs its mounted panel, so running it eagerly
before the panel exists left it cached against a missing container and never
re-ran on activation. Restrict eager execution to panel-independent iframe
page scripts and action scripts in both the headless runtime and the
reference hub UI.
Guard the fire-and-forget switchEntry call sites so a failed lazy client
script no longer surfaces as an unhandled rejection while its cache entry
stays retryable.
Opt the demo dock-client into eager initialization in both reference hosts so
it subscribes to entry:activated before the first click, and document that a
renderer always initializes on activation regardless of eager.
Co-authored-by: agent <agent@opencode>
Copy file name to clipboardExpand all lines: docs/content/1.guide/17.client-context.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ A client-only dock can also carry `type: 'json-render'` with an inline [JSON-ren
69
69
70
70
A client script is a `ClientScriptEntry`: `{ importFrom, importName?, eager? }`. `importName` defaults to `'default'` and `eager` defaults to `false`. An `iframe` entry's optional `clientScript` runs inside the host page when the dock entry is first activated. An `action` entry runs its `action` on each activation, while a `custom-render` entry initializes its `renderer` after selection so it can mount into the panel.
71
71
72
-
Set `eager: true` on a descriptor to initialize it as soon as the RPC connection is trusted, before opening a dock panel. This suits background subscriptions and page commands. Both the reference hub UI and `createDevframeClientRuntime()` honor these settings ([Hub API reference](/references/hub-api#dock-client-script-fields)).
72
+
Set `eager: true` on an `iframe``clientScript` or an `action`to initialize it as soon as the RPC connection is trusted, before opening a dock panel. This suits background subscriptions and page commands, such as an `action` that registers page commands or subscribes to `entry:activated` before its first click. A `custom-render``renderer` needs its mounted panel, so it always initializes on activation. Both the reference hub UI and `createDevframeClientRuntime()` honor these settings ([Hub API reference](/references/hub-api#dock-client-script-fields)).
73
73
74
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
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ Which `ClientScriptEntry` field carries an entry's client script, and when it ru
133
133
|`custom-render`|`renderer`| to render the entry's panel |
134
134
|`iframe`|`clientScript` (optional) | inside the host page on first activation |
135
135
136
-
`ClientScriptEntry.eager` defaults to `false`. Set it to `true` to initialize that script after RPC trust, before dock activation. Setup is cached per RPC connection and dock; action clicks execute on every activation.
136
+
`ClientScriptEntry.eager` defaults to `false`. Set it to `true`on an `iframe``clientScript` or an `action`to initialize it after RPC trust, before dock activation. A `custom-render``renderer` needs its mounted panel, so it always initializes on activation regardless of `eager`. Setup is cached per RPC connection and dock; action clicks execute on every activation.
0 commit comments