DataGrid: add script for data-grid architecture diagram#32922
Open
dmirgaev wants to merge 10 commits intoDevExpress:26_1from
Open
DataGrid: add script for data-grid architecture diagram#32922dmirgaev wants to merge 10 commits intoDevExpress:26_1from
dmirgaev wants to merge 10 commits intoDevExpress:26_1from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces documentation-generation scripts for visualizing DataGrid / grid_core architecture, producing JSON + interactive HTML (Cytoscape-based) diagrams from source code analysis under js/__internal/grids/**.
Changes:
- Added a new
grid_corearchitecture generator (AST parsing + dependency/inheritance resolution + HTML/JSON output). - Added a new
data_gridarchitecture generator that consumes the grid_core JSON and builds a combined DataGrid-focused visualization (modules, extenders, pipelines, cross-deps). - Updated
grid_corevisualization styling and edge toggling to align more closely with DataGrid diagram conventions.
Reviewed changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/types.ts | Defines the data model used by the grid_core parser/resolver/output. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/parser.ts | Discovers grid_core TS files and extracts modules/classes/runtime deps via TypeScript AST. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/resolver.ts | Resolves aliases, inheritance chains, runtime dependencies, and standalone nodes. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/graph-builder.ts | Builds Cytoscape node/edge elements; updated node/edge classing for new styling. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/html-template.ts | Updates the interactive HTML template (styling + new edge-type toggles). |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/constants.ts | Fixes path resolution for grid_core root and artifacts output directory. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/cli.ts | Adds simple CLI flag parsing for grid_core generator output selection. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/generate-architecture-doc.ts | Adds the grid_core generator entrypoint (JSON/HTML emission + console summary). |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/constants.ts | Defines data_grid roots, import patterns, feature-area mapping, and output directory. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/types.ts | Defines data_grid parser/resolver/output data structures. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/parser.ts | Parses data_grid registerModule calls, inline overrides/extenders, and module order. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/resolver.ts | Classifies modules + builds pipelines/inheritance/cross-deps; includes gc fallback parsing. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/graph-builder.ts | Builds Cytoscape elements for DataGrid view (modules, targets, defines/extender/order edges). |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/html-template.ts | Generates the interactive DataGrid HTML visualization (layout, filters, info panel). |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/generate.ts | Adds the data_grid generator entrypoint (loads gc JSON prerequisite, writes JSON/HTML). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new DataGrid architecture documentation generator (JSON + interactive HTML) and refactors the existing grid_core generator to reuse shared parsing, inheritance, graph, and output utilities under __docs__/scripts/shared.
Changes:
- Introduces a new
data_griddocs generator (parser + resolver + graph builder + HTML template + CLI entrypoint). - Extracts shared infrastructure for AST parsing, file discovery, inheritance-chain building, graph context, and output writing.
- Reorganizes the existing grid_core HTML template and generator to use the shared utilities, removing the old monolithic
html-template.ts.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/docs/scripts/shared/types.ts | Adds shared type definitions for heritage/base-class metadata and inheritance chains. |
| packages/devextreme/js/__internal/grids/docs/scripts/shared/output-writer.ts | Centralizes JSON/HTML output writing and CLI flag handling. |
| packages/devextreme/js/__internal/grids/docs/scripts/shared/inheritance.ts | Adds a reusable inheritance-chain builder with cycle/depth handling hooks. |
| packages/devextreme/js/__internal/grids/docs/scripts/shared/html-helpers.ts | Extracts shared CSS and interactive JS used by multiple diagram templates. |
| packages/devextreme/js/__internal/grids/docs/scripts/shared/graph-context.ts | Introduces a shared graph-building context for Cytoscape element creation/deduping. |
| packages/devextreme/js/__internal/grids/docs/scripts/shared/file-discovery.ts | Extracts reusable TS source discovery + relative path normalization. |
| packages/devextreme/js/__internal/grids/docs/scripts/shared/cli.ts | Exports CliArgs and improves unknown-arg messaging. |
| packages/devextreme/js/__internal/grids/docs/scripts/shared/ast-helpers.ts | Adds shared TypeScript AST helpers (imports, export detection, mixin parsing, heritage parsing). |
| packages/devextreme/js/__internal/grids/docs/scripts/html-template.ts | Removes the previous single HTML template file (migrated into per-generator templates + shared helpers). |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/types.ts | Reuses shared types and aligns inheritance entry shape (className, chain). |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/resolver.ts | Refactors resolver logic to use shared inheritance + mixin utilities and improves some lookups. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/parser.ts | Refactors parser to use shared AST helpers and shared relative-path/discovery helpers. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/html-template.ts | Adds the new grid_core HTML template using shared CSS/JS helpers. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/graph-builder.ts | Refactors graph building to use shared graph context and new edge classes. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/generate.ts | Updates the grid_core generator entrypoint to use shared discovery/output writing. |
| packages/devextreme/js/__internal/grids/docs/scripts/grid_core/constants.ts | Fixes root/output paths and keeps grid_core-specific discovery exclusions. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/types.ts | Defines data_grid parser + resolved architecture output types. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/resolver.ts | Implements module classification, extender pipelines, inheritance chains, and cross-dependency analysis. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/parser.ts | Adds a data_grid-specific parser for registerModule usage, extenders, and module order. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/html-template.ts | Adds the DataGrid interactive HTML visualization template (modules, targets, pipelines). |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/graph-builder.ts | Builds Cytoscape elements for the DataGrid diagram using shared graph context. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/generate.ts | Adds the data_grid generator entrypoint and integrates grid_core JSON as an input. |
| packages/devextreme/js/__internal/grids/docs/scripts/data_grid/constants.ts | Adds data_grid-specific roots, excluded directories, feature-area mapping, and other constants. |
packages/devextreme/js/__internal/grids/__docs__/scripts/data_grid/parser.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/__docs__/scripts/data_grid/resolver.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/__docs__/scripts/data_grid/parser.ts
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.