theia-trace-extension icon indicating copy to clipboard operation
theia-trace-extension copied to clipboard

Upgrade ag-grid

Open marcdumais-work opened this issue 1 year ago • 0 comments

Adapt to later ag-grid version

Dependabot opened a PR to suggest we update our "ag-grid" dependencies. However, the PR did not build, because ir proposes we jump forward 3 major releases forward, and there were API changes between that version and what we use.

In consequence, it's necessary to make changes in how we import and use this dependency. Here are a few highlights:

  • Switch to use the "@ag-grid-community/*" modules
  • Theme ag-theme-balham.css: both light and dark themes are now bundled in the same file
  • ColumnApi has been deprecated, then removed. its features have been moved to the GridApi, which we now need to use
  • need to explicitly import and register infinte-row-model module, before we can use it to scroll in our tables: @ag-grid-community/infinite-row-model
  • no longer possible to set data source using "api.setDatasource([...])". now using "api.setGridOption('datasource', [...])" instead

TODO:

  • ~~the tests in packages/react-components/src/components/__tests__/table-renderer-components.test.tsx do not pass anymore - they were relying on having access to the gridApi/columnApi objects, which has been restricted in later versions of ag-grid.~~ At the suggestion of @MatthewKhouzam I have disabled the failing tests for the moment. See related commit for more details.
  • the vscode trace viewer pulls the ag-grid packages. At first look it seems to be just to use the .css files [1], but to be safe it's probably better to test the vscode extension using this PR's version of the "react components" package.

[1]: if that's the case, I think the packages can be replaced by the much smaller @ag-grid-community/styles

marcdumais-work avatar Jul 22 '24 19:07 marcdumais-work