Plugin Dependency And Direct Prop Changes
Summary
This change set adds two related Pro/Enterprise plugin API improvements:
- Direct observable plugin config props, such as
grid.pagination,grid.cellMerge, andgrid.exportExcel, while keeping legacygrid.additionalData.*config working. - Typed plugin dependency metadata via
static readonly pluginDependencies, plus API docs generation from that source metadata.
Dependency metadata does not auto-install, enforce, or reorder plugins. Required plugin-class dependencies emit a console.warn after plugin registration so missing hard dependencies are visible without changing runtime execution.
New Shared APIs
Observable Props
File: packages/pro/plugins/observable-props/index.ts
Exports:
bindObservableProp<TInput, TValue = TInput>(plugin, options): TValueObservablePropBindingOptionsObservablePropSource = 'initial' | 'property' | 'additionalData'
Behavior:
- Initial priority is direct grid prop, then kebab-case prop alias, then
grid.additionalData[additionalDataKey], thendefaultValue. - Future direct prop assignments are observed with
CorePlugin.observeProperty. - Legacy
additionaldatachangedupdates are still accepted. - The helper returns the initial resolved value for constructor initialization.
- It does not mirror values back into
additionalData.
Plugin Dependencies
File: packages/pro/plugins/plugin-dependencies/index.ts
Exports:
PluginDependencyKindPluginDependencyTargetPluginDependencyPluginConstructorPluginDependencyPluginRefPluginDependencyContractPluginDependencyAdditionalDataKeyPluginDependency
Kinds:
requiredoptionalauto-installedevent-integrationconfig-integrationordering
Targets are structured and type-checked rather than free-form strings:
- Plugin targets reference actual plugin classes, or lazy
() => PluginClassrefs where direct imports would create cycles. additionalDatatargets usekeyof AdditionalData, so legacy config keys are checked by TypeScript.- Event targets use
keyof HTMLRevoGridElementEventMap. - Grid property targets use
keyof HTMLRevoGridElement. - Shared integration contracts are limited to the
PluginDependencyContractunion.
Runtime behavior:
- Required plugin-class dependencies are checked from
CorePluginafter the current plugin registration tick. - Missing required plugin dependencies emit
console.warn. - Warnings do not auto-install, reorder, block, or otherwise change plugin execution.
- Optional, event, config, ordering, and contract metadata remains documentation-only.
Direct Observable Props To Test
For each plugin below, test direct prop initial config, legacy additionalData initial config, direct prop priority when both are present, later direct prop updates, and later additionalData replacement updates.
| Plugin | Direct prop | Kebab alias | Legacy additionalData key |
|---|---|---|---|
| Cell merge | cellMerge | cell-merge | cellMerge |
| Pagination | pagination | pagination | pagination |
| History | history | history | history |
| Master row | masterRow | master-row | masterRow |
| Context menu | contextMenu | context-menu | rowContextMenu |
| Export Excel | exportExcel | export-excel | excel |
| Info panel | infoPanel | info-panel | infoPanel |
| Infinity scroll | infinityScroll | infinity-scroll | infinityScroll |
| Row expand | rowExpand | row-expand | rowExpand |
| Row transpose | rowTranspose | row-transpose | transpose |
| Tree | tree | tree | tree |
| Column group panel | columnGroupPanel | column-group-panel | columnGroupPanel, columnGroupingPanel |
| Column hide | columnHide | column-hide | hiddenColumns |
| Column autosize | autoSizeColumn | auto-size-column | autoSizeColumnConfig |
| Column stretch | stretch | stretch | stretch |
| Row autosize | rowAutoSize | row-auto-size | rowAutoSize |
| Row order | rowOrder | row-order | rowOrder |
| Event manager | eventManager | event-manager | eventManager |
| Pivot | pivot | pivot | pivot |
Column hide also supports existing hide-columns attribute and hideColumns runtime alias. Hidden-column parsing is now centralized through one helper.
Pro Dependency Metadata
| Plugin | Dependency metadata |
|---|---|
CellValidatePlugin | Requires EventManagerPlugin for edit validation events. |
CellFlashPlugin | Integrates with EventManagerPlugin and HistoryPlugin events when present. |
HistoryPlugin | Integrates with EventManagerPlugin edit events for normal history capture. |
FilterHeaderPlugin | Requires AdvanceFilterPlugin or FilterPlugin to apply header filters. |
AdvanceFilterPlugin | Integrates with FilterPlugin as replacement/migration compatibility. |
MasterRowPlugin | Requires OverlayPlugin; integrates with RowHeaderPlugin. |
RowSelectPlugin | Integrates with TreeDataPlugin tree selection behavior when present. |
TreeDataPlugin | Integrates with RowOrderPlugin and RowSelectPlugin events. |
PaginationPlugin | Integrates with sorting-capable plugins and filter events in remote mode. |
InfinityScrollPlugin | Integrates with sorting-capable plugins and filter events in remote mode. |
ContextMenuPlugin | Integrates with RowHeaderPlugin row menu events. |
RowHeaderPlugin | Integrates with RowOrderPlugin row drag UI. |
ColumnStretchPlugin | Reads the auto-size column contract to skip auto-sized columns. |
ColumnGroupPanelPlugin | Reads/writes core grouping API configuration. |
ColumnMoveAdvancedPlugin | Depends on core ColumnMovePlugin implementation. |
OverlayPlugin | Acts as an event sink for overlay event producers. |
WCAGPlugin | Ordering metadata: register after other grid plugins. |
CellMergePlugin | Integrates with overlay selection events and legacy additionalData.cellMerge. |
AutoSizeColumnPlugin | Integrates with source/save/header events and legacy additionalData.autoSizeColumnConfig. |
ColumnHidePlugin | Integrates with column update events and legacy additionalData.hiddenColumns. |
ExportExcelPlugin | Integrates with Excel import/export events and legacy additionalData.excel. |
InfoPanelPlugin | Integrates with afterfocus and legacy additionalData.infoPanel. |
RowExpandPlugin | Integrates with sorting/filter/source events and legacy additionalData.rowExpand. |
RowTransposePlugin | Integrates with row transpose event and legacy additionalData.transpose. |
Enterprise Dependency Metadata
| Plugin/module | Dependency metadata |
|---|---|
GanttPlugin | Auto-installs/uses OverlayPlugin, EventManagerPlugin, HistoryPlugin, TooltipPlugin, TreeDataPlugin, ColumnHidePlugin, and GanttPanelResizePlugin; reads/writes Gantt-related additionalData keys. |
GanttGridSync | Reads/writes additionalData.tree, additionalData.eventManager, additionalData.history, and additionalData.gantt.resources; integrates with TooltipPlugin; installs Gantt column type contracts (ColumnDropdown, DateColumnType, SelectColumnType). |
ganttToolbarDependencies | Optionally integrates with HistoryPlugin, Gantt runtime capabilities, and tree/history/gantt events. |
PivotPlugin | Depends on Pro plugin infrastructure/events; reads direct grid.pivot and legacy additionalData.pivot; integrates with sorting, pagination, group expand, column collapse, filter, and sorting events. |
PivotRemoteController | Reads/writes direct grid.pagination or legacy additionalData.pagination; integrates with pagination-capable plugins. |
pivotConfigUiDependencies | Depends on Pro aggregators and Pro UI helpers. |
API Docs Changes
File: scripts/analyze.ts
The analyzer now:
- Detects static class
pluginDependencies. - Detects exported dependency constants whose names end with
Dependencies. - Renders a
#### Dependenciessection into generated API markdown. - Avoids trailing whitespace in generated heading lines.
Generated docs are under packages/portal/src/content/docs/api. Do not hand-edit them; regenerate with:
pnpm build:docsRepresentative docs to inspect:
packages/portal/src/content/docs/api/cell-validate.mdpackages/portal/src/content/docs/api/cell-merge.mdpackages/portal/src/content/docs/api/column-hide.mdpackages/portal/src/content/docs/api/export-excel.mdpackages/portal/src/content/docs/api/history.mdpackages/portal/src/content/docs/api/tree.mdpackages/portal/src/content/docs/api/row-master.mdpackages/portal/src/content/docs/api/pagination.mdpackages/portal/src/content/docs/api/infinity-scroll.mdpackages/portal/src/content/docs/api/pivot.mdpackages/portal/src/content/docs/api/gantt.mdpackages/portal/src/content/docs/api/gantt-toolbar.md
Manual Test Checklist
Direct Config Compatibility
For pagination, cellMerge, and exportExcel at minimum:
- Direct prop initial config works.
- Legacy
additionalDatainitial config still works. - Direct prop wins when both direct prop and
additionalDataare present. - Later direct prop assignment updates plugin state.
- Later
additionalDatareplacement updates plugin state. - No plugin mirrors direct prop values back into
additionalData.
Kebab-Case Alias Compatibility
For framework bindings, verify at least:
cellMergeandcell-mergecolumnHideandcolumn-hideexportExcelandexport-excelrowTransposeandrow-transposeautoSizeColumnandauto-size-column
Dependency Metadata
For representative classes/constants:
- Import the plugin class and confirm
ClassName.pluginDependenciesexists. - Confirm metadata is an array of
{ kind, target, description }. - Confirm no runtime enforcement happens from metadata alone.
- Confirm generated API docs show
#### Dependencies. - Remove a required plugin such as
OverlayPluginfrom aMasterRowPluginsetup and confirm the missing dependency produces aconsole.warnwithout blocking grid startup.
Enterprise
For Gantt:
- Confirm
GanttPlugin.pluginDependenciesdocuments auto-installed Pro plugins. - Confirm
GanttGridSync.pluginDependenciesdocumentsadditionalDatakeys and column type contracts. - Confirm Gantt toolbar docs show
ganttToolbarDependencies.
For Pivot:
- Confirm
PivotPlugin.pluginDependenciesdocuments Pro infrastructure,additionalData.pivot, sorting/pagination, and event integrations. - Confirm
PivotRemoteController.pluginDependenciesdocuments pagination config usage. - Confirm Pivot config docs show
pivotConfigUiDependencies.
Verification Commands
Run from repo root:
pnpm lint:pro
pnpm --filter @revolist/revogrid-enterprise exec tsc --noEmit
pnpm build:docs
git diff --checkExpected result: all commands pass.
Notes
revogrid/was not edited.- The generated API docs may have broad diff noise because
pnpm build:docsrewrites analyzer-owned pages. - Dependency metadata is the canonical dependency map; JSDoc is only supplemental human context.