Skip to content

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, and grid.exportExcel, while keeping legacy grid.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): TValue
  • ObservablePropBindingOptions
  • ObservablePropSource = 'initial' | 'property' | 'additionalData'

Behavior:

  • Initial priority is direct grid prop, then kebab-case prop alias, then grid.additionalData[additionalDataKey], then defaultValue.
  • Future direct prop assignments are observed with CorePlugin.observeProperty.
  • Legacy additionaldatachanged updates 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:

  • PluginDependencyKind
  • PluginDependencyTarget
  • PluginDependencyPluginConstructor
  • PluginDependencyPluginRef
  • PluginDependencyContract
  • PluginDependencyAdditionalDataKey
  • PluginDependency

Kinds:

  • required
  • optional
  • auto-installed
  • event-integration
  • config-integration
  • ordering

Targets are structured and type-checked rather than free-form strings:

  • Plugin targets reference actual plugin classes, or lazy () => PluginClass refs where direct imports would create cycles.
  • additionalData targets use keyof 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 PluginDependencyContract union.

Runtime behavior:

  • Required plugin-class dependencies are checked from CorePlugin after 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.

PluginDirect propKebab aliasLegacy additionalData key
Cell mergecellMergecell-mergecellMerge
Paginationpaginationpaginationpagination
Historyhistoryhistoryhistory
Master rowmasterRowmaster-rowmasterRow
Context menucontextMenucontext-menurowContextMenu
Export ExcelexportExcelexport-excelexcel
Info panelinfoPanelinfo-panelinfoPanel
Infinity scrollinfinityScrollinfinity-scrollinfinityScroll
Row expandrowExpandrow-expandrowExpand
Row transposerowTransposerow-transposetranspose
Treetreetreetree
Column group panelcolumnGroupPanelcolumn-group-panelcolumnGroupPanel, columnGroupingPanel
Column hidecolumnHidecolumn-hidehiddenColumns
Column autosizeautoSizeColumnauto-size-columnautoSizeColumnConfig
Column stretchstretchstretchstretch
Row autosizerowAutoSizerow-auto-sizerowAutoSize
Row orderrowOrderrow-orderrowOrder
Event managereventManagerevent-managereventManager
Pivotpivotpivotpivot

Column hide also supports existing hide-columns attribute and hideColumns runtime alias. Hidden-column parsing is now centralized through one helper.

Pro Dependency Metadata

PluginDependency metadata
CellValidatePluginRequires EventManagerPlugin for edit validation events.
CellFlashPluginIntegrates with EventManagerPlugin and HistoryPlugin events when present.
HistoryPluginIntegrates with EventManagerPlugin edit events for normal history capture.
FilterHeaderPluginRequires AdvanceFilterPlugin or FilterPlugin to apply header filters.
AdvanceFilterPluginIntegrates with FilterPlugin as replacement/migration compatibility.
MasterRowPluginRequires OverlayPlugin; integrates with RowHeaderPlugin.
RowSelectPluginIntegrates with TreeDataPlugin tree selection behavior when present.
TreeDataPluginIntegrates with RowOrderPlugin and RowSelectPlugin events.
PaginationPluginIntegrates with sorting-capable plugins and filter events in remote mode.
InfinityScrollPluginIntegrates with sorting-capable plugins and filter events in remote mode.
ContextMenuPluginIntegrates with RowHeaderPlugin row menu events.
RowHeaderPluginIntegrates with RowOrderPlugin row drag UI.
ColumnStretchPluginReads the auto-size column contract to skip auto-sized columns.
ColumnGroupPanelPluginReads/writes core grouping API configuration.
ColumnMoveAdvancedPluginDepends on core ColumnMovePlugin implementation.
OverlayPluginActs as an event sink for overlay event producers.
WCAGPluginOrdering metadata: register after other grid plugins.
CellMergePluginIntegrates with overlay selection events and legacy additionalData.cellMerge.
AutoSizeColumnPluginIntegrates with source/save/header events and legacy additionalData.autoSizeColumnConfig.
ColumnHidePluginIntegrates with column update events and legacy additionalData.hiddenColumns.
ExportExcelPluginIntegrates with Excel import/export events and legacy additionalData.excel.
InfoPanelPluginIntegrates with afterfocus and legacy additionalData.infoPanel.
RowExpandPluginIntegrates with sorting/filter/source events and legacy additionalData.rowExpand.
RowTransposePluginIntegrates with row transpose event and legacy additionalData.transpose.

Enterprise Dependency Metadata

Plugin/moduleDependency metadata
GanttPluginAuto-installs/uses OverlayPlugin, EventManagerPlugin, HistoryPlugin, TooltipPlugin, TreeDataPlugin, ColumnHidePlugin, and GanttPanelResizePlugin; reads/writes Gantt-related additionalData keys.
GanttGridSyncReads/writes additionalData.tree, additionalData.eventManager, additionalData.history, and additionalData.gantt.resources; integrates with TooltipPlugin; installs Gantt column type contracts (ColumnDropdown, DateColumnType, SelectColumnType).
ganttToolbarDependenciesOptionally integrates with HistoryPlugin, Gantt runtime capabilities, and tree/history/gantt events.
PivotPluginDepends 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.
PivotRemoteControllerReads/writes direct grid.pagination or legacy additionalData.pagination; integrates with pagination-capable plugins.
pivotConfigUiDependenciesDepends 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 #### Dependencies section 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:

bash
pnpm build:docs

Representative docs to inspect:

  • packages/portal/src/content/docs/api/cell-validate.md
  • packages/portal/src/content/docs/api/cell-merge.md
  • packages/portal/src/content/docs/api/column-hide.md
  • packages/portal/src/content/docs/api/export-excel.md
  • packages/portal/src/content/docs/api/history.md
  • packages/portal/src/content/docs/api/tree.md
  • packages/portal/src/content/docs/api/row-master.md
  • packages/portal/src/content/docs/api/pagination.md
  • packages/portal/src/content/docs/api/infinity-scroll.md
  • packages/portal/src/content/docs/api/pivot.md
  • packages/portal/src/content/docs/api/gantt.md
  • packages/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 additionalData initial config still works.
  • Direct prop wins when both direct prop and additionalData are present.
  • Later direct prop assignment updates plugin state.
  • Later additionalData replacement updates plugin state.
  • No plugin mirrors direct prop values back into additionalData.

Kebab-Case Alias Compatibility

For framework bindings, verify at least:

  • cellMerge and cell-merge
  • columnHide and column-hide
  • exportExcel and export-excel
  • rowTranspose and row-transpose
  • autoSizeColumn and auto-size-column

Dependency Metadata

For representative classes/constants:

  • Import the plugin class and confirm ClassName.pluginDependencies exists.
  • 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 OverlayPlugin from a MasterRowPlugin setup and confirm the missing dependency produces a console.warn without blocking grid startup.

Enterprise

For Gantt:

  • Confirm GanttPlugin.pluginDependencies documents auto-installed Pro plugins.
  • Confirm GanttGridSync.pluginDependencies documents additionalData keys and column type contracts.
  • Confirm Gantt toolbar docs show ganttToolbarDependencies.

For Pivot:

  • Confirm PivotPlugin.pluginDependencies documents Pro infrastructure, additionalData.pivot, sorting/pagination, and event integrations.
  • Confirm PivotRemoteController.pluginDependencies documents pagination config usage.
  • Confirm Pivot config docs show pivotConfigUiDependencies.

Verification Commands

Run from repo root:

bash
pnpm lint:pro
pnpm --filter @revolist/revogrid-enterprise exec tsc --noEmit
pnpm build:docs
git diff --check

Expected result: all commands pass.

Notes

  • revogrid/ was not edited.
  • The generated API docs may have broad diff noise because pnpm build:docs rewrites analyzer-owned pages.
  • Dependency metadata is the canonical dependency map; JSDoc is only supplemental human context.