Skip to content

feat: DH-22891: Example middleware plugin#1372

Draft
vbabich wants to merge 1 commit into
deephaven:mainfrom
vbabich:vlad-DH-21467-table-options-middleware-example
Draft

feat: DH-22891: Example middleware plugin#1372
vbabich wants to merge 1 commit into
deephaven:mainfrom
vbabich:vlad-DH-21467-table-options-middleware-example

Conversation

@vbabich

@vbabich vbabich commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Adds table-middleware-example, a minimal WidgetMiddlewarePlugin
demonstrating how a middleware plugin is inserted into a widget's render
chain and how it can wrap the next component and inject custom
props — with no coupling to IrisGrid or any other specific widget.

What it does

  • A single shared body hook (exampleMiddlewareBody) returning { inject, wrap }: injects a custom exampleInjectedProp and wraps the
    wrapped component in an ExampleMiddlewareContext.Provider plus a small
    "Wrapped by example middleware" banner.
  • The one body hook drives both middleware paths via the
    @deephaven/plugin factories: createWidgetMiddleware (non-panel /
    dashboard) and createPanelMiddleware (panel path, which preserves
    golden-layout's panel ref so componentState persistence stays intact).
  • Wired up as a PluginType.MIDDLEWARE_PLUGIN with supportedTypes: ['Table', 'TreeTable', 'HierarchicalTable', 'PartitionedTable'],
    registered in plugins/manifest.json.

## feat: DH-22891: Example middleware plugin

Adds `table-middleware-example`, a minimal `WidgetMiddlewarePlugin`
demonstrating how a middleware plugin is inserted into a widget's render
chain and how it can **wrap** the next component and **inject** custom
props — with no coupling to IrisGrid or any other specific widget.

### What it does

- A single shared body hook (`exampleMiddlewareBody`) returning `{
inject, wrap }`: injects a custom `exampleInjectedProp` and wraps the
wrapped component in an `ExampleMiddlewareContext.Provider` plus a small
"Wrapped by example middleware" banner.
- The one body hook drives both middleware paths via the
`@deephaven/plugin` factories: `createWidgetMiddleware` (non-panel /
dashboard) and `createPanelMiddleware` (panel path, which preserves
golden-layout's panel ref so `componentState` persistence stays intact).
- Wired up as a `PluginType.MIDDLEWARE_PLUGIN` with `supportedTypes:
['Table', 'TreeTable', 'HierarchicalTable', 'PartitionedTable']`,
registered in `plugins/manifest.json`.
@vbabich vbabich self-assigned this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant