Reductions in bundle size, updated theming, column header content customization
What's New
AG Grid 33 significantly reduces bundle size via modularization and enhances functionality, theming and accessibility as described in the release post. These major improvements require certain breaking changes as listed below.
Please use the codemods to start your migration, then review the changes to modules and themes.
AG Grid 33 is aimed at addressing long-standing community feedback around bundle size and theming. Naturally, given the significance of these changes, this release has introduced more breaking changes than usual. We recognise that not all users can immediately benefit from these improvements.
Therefore we are launching Long-Term Support (LTS) versions of AG Grid (v32-lts) and AG Charts (v10-lts), ensuring you can continue receiving bug fixes without upgrading to the latest major release. We will proactively identify necessary fixes, but please feel free to report any issues you encounter against our LTS versions.
Changes to Modules / Packages
Version 33 introduces a major change to how modules work to allow for smaller bundle sizes. Previously AG Grid supported two approaches - modules and packages. These have now been merged together to allow for simpler configuration and greater optimisation of bundle size.
Migrating from AG Grid Community
ag-grid-community
To match the existing behaviour of simply register the AllCommunityModule via the ModuleRegistry before
any grid is created. This module contains all the features that were previously automatically included as part of ag-grid-community.
import { AllCommunityModules, ModuleRegistry } from 'ag-grid-community';
ModuleRegistry.registerModules([AllCommunityModules]); Migrating from AG Grid Enterprise
ag-grid-enterprise
To match the existing behaviour simply register the AllEnterpriseModule via the ModuleRegistry before any
grid is created. A good place to add this code is alongside your LicenseManager.
import { AllEnterpriseModule, LicenseManager, ModuleRegistry } from 'ag-grid-enterprise';
LicenseManager.setLicenseKey('your License Key');
ModuleRegistry.registerModules([AllEnterpriseModule]); Migrating from AG Grid Modules
@ag-grid-community/** / @ag-grid-enterprise/**
In v33 there is no longer a requirement for separate NPM feature modules to achieve tree shaking. This means we can
simply export all the modules from either ag-grid-community or ag-grid-enterprise as follows:
-
@ag-grid-community/reactis replaced withag-grid-react -
All
@ag-grid-community/**packages are replaced withag-grid-communityApart from
@ag-grid-community/localewhich remains unchanged.
- All
@ag-grid-enterprise/**packages are replaced withag-grid-enterprise.
Here is an example of a typical package.json diff for the migration:
an example package.json diff
AG Grid Community
"dependencies": {
- "@ag-grid-community/react": "^32.3.0",
- "@ag-grid-community/client-side-row-model": "^32.3.0",
- "@ag-grid-community/csv-export": "^32.3.0",
+ "ag-grid-react": "33.0.3",
+ "ag-grid-community": "33.0.3",
} AG Grid Enterprise
"dependencies": {
- "@ag-grid-community/react": "^32.3.0",
- "@ag-grid-community/client-side-row-model": "^32.3.0",
- "@ag-grid-community/csv-export": "^32.3.0",
- "@ag-grid-enterprise/clipboard": "^32.3.0",
- "@ag-grid-enterprise/master-detail": "^32.3.0",
- "@ag-grid-enterprise/row-grouping": "^32.3.0",
+ "ag-grid-react": "33.0.3",
+ "ag-grid-enterprise": "33.0.3",
} After updating your package.json file, we recommend using the Codmod to assist your migration as it will update all your applications import paths and module registration to ensure backwards compatibility.
npx @ag-grid-devtools/cli@33.0 migrate --from=$FROM_VERSION
Validation Module
To help identify missing modules and configuration issues at development time, we recommend including the ValidationModule in your development build. This will provide helpful details on missing modules for a particular feature. This is provided
as a separate module so that it can be excluded from production builds saving even more bundle size. It is included in
the AllCommunityModule.
Changes to Existing Modules
The following changes have been made to the existing modules to ensure that each feature only includes the minimal code required for that feature:
ColumnsToolPanelModule- no longer imports theRowGroupingModuleExcelExportModule- no longer imports theCsvExportModule-
MenuModule- split intoColumnMenuModulefor the Column Menu, andContextMenuModulefor the Context Menu. RangeSelectionModule- replaced withCellSelectionModule.-
RowGroupingModule- split into several modules.RowGroupingModule- Row Grouping onlyTreeDataModule- Tree DataPivotModule- PivotingRowGroupingPanelModule- Row Grouping Panel / Pivot PanelGroupFilterModule- Group Filter
-
GridChartsModule- replaced withIntegratedChartsModuleand requires AG Charts module to be registered. -
SparklinesModule- requires AG Charts module to be registered.
The codemod will include the new modules to match the existing behaviour of v32 module dependencies. For example, if you were importing the ExcelExportModule in v32 then the codemod will automatically include the CsvExportModule in v33.
Optimizing Bundle Size
To take full advantage of the new modules you may wish to use the Module Selector to work out which modules you require for a give set of features.
Integrated Charts / Sparklines
AG Grid Enterprise no longer includes AG Charts as part of its distribution to avoid bloating the bundle size. If you are using either Integrated Charts or Sparklines, you must now explicitly include either the community / enterprise AG Charts library as a dependency.
Migration Steps
The following shows the changes required for an application using Integrated Charts / Sparklines via the AllEnterpriseModule with the Enterprise version of AG Charts.
"dependencies": {
"ag-grid-enterprise": "33.0.3",
+ "ag-charts-enterprise": "11.0.3-beta.20241217.1237",
}
import { AllEnterpriseModule, LicenseManager, ModuleRegistry } from 'ag-grid-enterprise';
import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';
LicenseManager.setLicenseKey('your License Key');
ModuleRegistry.registerModules([
AllEnterpriseModule.with(AgChartsEnterpriseModule)
]);
If you are using AG Grid Modules, then both the IntegratedChartsModule and SparklinesModule also require the AG Charts module to be registered when they are used.
import { IntegratedChartsModule, SparklinesModule, LicenseManager, ModuleRegistry } from 'ag-grid-enterprise';
import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';
LicenseManager.setLicenseKey('your License Key');
ModuleRegistry.registerModules([
IntegratedChartsModule.with(AgChartsEnterpriseModule),
SparklinesModule.with(AgChartsEnterpriseModule)
]); Theming
The new and improved Theming API is now the default theming method for AG Grid. If you wish to migrate to the Theming Api see the Theming API Migration Guide. However, this is not a requirement to upgrade to v33.
Continue with Legacy Themes
If you want to upgrade to v33 without immediately adopting the Theming API, you can opt back in to the v32 style of
themes by passing the string "legacy" to the theme grid option. You can then continue to use
legacy themes.
If you have multiple grids you may find using a Global Grid Option to be a convenient way to set the theme to "legacy" for all grids in your application. Enterprise users can define this alongside their license key.
import { provideGlobalGridOptions } from 'ag-grid-community';
// Mark all grids as using legacy themes
provideGlobalGridOptions({
theme: "legacy",
});
Codemods
Follow these steps to upgrade your project's AG Grid version to 33.0.3:
-
Locate your project's
package.jsonand note the version of AG Grid that you are currently using. -
Update any AG Grid dependencies listed in the
package.jsonas outline above to version33.0.3. -
Open a terminal and navigate to your project's root folder.
-
Run the
migratecommand of version33.0of the AG Grid codemod runner, where$FROM_VERSIONrefers to your project's existing AG Grid version:npx @ag-grid-devtools/cli@33.0 migrate --from=$FROM_VERSIONThis will update your project's source files to prepare for the new release.
By default the Codemod runner will locate all source files within the current directory. For projects with more specific requirements, pass a list of input files to the
migratecommand, or specify the--helpargument to see more fine-grained usage instructions.
The Codemod runner will check the state of your project to ensure that you don't lose any work. If you would
rather see a diff of the changes instead of applying them, pass the --dry-run argument.
The codemod only transforms source files that make use of deprecated features, so if you aren't currently making use of any of those APIs your source code will be unaffected by the codemod.
See the Codemods documentation for more details.
Breaking Changes
The full list of breaking changes across all features for v33.
Breaking Changes
This release includes the following breaking changes:
Changes To Modules / Packages
Changes outline above in the Changes to Modules / Packages section
Integrated Charts / Sparklines
Changes outline above in the Integrated Charts / Sparklines section
Property Value Coercion
For non-TS users and users who use TS but avoid type validation there's changes in property value coercion:
For boolean values provided as strings, “false” is no longer converted to false anymore - all string values are truthy.
React
-
AgReactUiPropsremoved, please useAgGridReactPropsinstead. -
AgGridReactProps:-
disableStaticMarkupno longer used. -
legacyComponentRenderingno longer used.
-
-
AgReactComponent:-
getReactContainerStyleremoved, apply styling directly toag-react-containerif needed. -getReactContainerClassesremoved, apply styling directly toag-react-containerif needed. -
IHeaderGroupReactCompremoved, please useIHeaderGroupinstead. -
IHeaderReactCompremoved, please useIHeaderinstead. -
IDateReactCompremoved, please useIDateinstead. -
IFilterReactCompremoved, please useIFilterinstead. -
IFloatingFilterReactCompremoved, please useIFloatingFilterinstead. -
ICellRendererReactCompremoved, please useICellRendererinstead. -
ICellEditorReactCompremoved, please useICellEditorinstead. -
ILoadingCellRendererReactCompremoved, no interface required. -
ILoadingOverlayReactCompremoved, please useILoadingOverlayinstead. -
INoRowsOverlayReactCompremoved, please useINoRowsOverlayinstead. -
IStatusPanelReactCompremoved, please useIStatusPanelinstead. -
IToolPanelReactCompremoved, please useIToolPanelinstead. -
ITooltipReactCompremoved, no interface required.
-
Custom Icons
Setting any of the custom icons listed below will have the provided custom icon only apply in the specific use case its name indicates, instead of all cases as before. To have the custom icon apply to additional cases, set the additional icon keys pointing to the same custom icon. See list of icons changed:
-
smallDown(deprecated):advancedFilterBuilderSelectfor Advanced Filter Builder dropdown-
selectOpenfor Select cell editor and dropdowns (e.g., Integrated Charts menu) richSelectOpenfor Rich Select cell editor
-
smallLeft(deprecated):panelDelimiterRtlfor Row Group Panel / Pivot PanelsubMenuOpenRtlfor sub-menus
-
smallRight(deprecated):panelDelimiterfor Row Group Panel / Pivot PanelsubMenuOpenfor sub-menus
-
previous:previousfor paginationchartsThemePreviousfor Integrated Charts theme picker
-
next:nextfor paginationchartsThemeNextfor Integrated Charts theme picker
-
cancel:cancelfor column drag pillsrichSelectRemovefor Rich Select cell editor pills
-
menu:menufor button to launch the legacy column menulegacyMenufor legacy column menu tab header
-
menuAlt:menuAltfor new column menuchartsMenufor Integrated Charts menu
-
columns:columnsfor the column menu/column choosercolumnsToolPanelfor the Columns Tool Panel tab icon
-
filter:filterfor buttons that open the filter (header/menu)filtersToolPanelfor the Filters Tool Panel tab icon-
filterActivefor displaying the filter is active (header with legacy column menu, Filters Tool Panel item) filterTabfor the filter tab of the legacy tabbed column menu
-
save:savefor the export menuchartsDownloadfor Integrated Charts download
-
columnSelectClosed:-
columnSelectClosedfor the Columns Tool Panel/Column Chooser/column tab in the legacy tabbed column menu -
accordionClosedfor accordions (Filters Tool Panel, Integrated Charts tool panels)
-
-
columnSelectOpen:-
columnSelectOpenfor the Columns Tool Panel/Column Chooser/column tab in the legacy tabbed column menu -
accordionOpenfor accordions (Filters Tool Panel, Integrated Charts tool panels)
-
-
columnSelectIndeterminate:-
columnSelectIndeterminatefor the Columns Tool Panel/Column Chooser/column tab in the legacy tabbed column menu -
accordionIndeterminatefor accordions (Filters Tool Panel, Integrated Charts tool panels)
-
Server-side Rendering
AG Grid no longer patches global properties that are not present in a Server environment, i.e HTMLElement and others. If possible you should avoid rendering AG Grid on the server as this is not supported.
Stricter Types
The following properties are now strictly typed to only their valid values instead of string:
-
gridOption -
chartMenuItems -
gridOption -
getMainMenuItemsandgetContextMenuItemsincluding thedefaultItemsparameter in the callback - columnDefs -
mainMenuItemsandcontextMenuItems
Column Menu
The column property is now optional in the callback to get column menu items (in the grid option
getMainMenuItems or colDef.mainMenuItems). column will be null when a
column group header or empty column space is right-cpcked on. A new property columnGroup
will be provided when a column group header is right-clicked on.
Row Drop Zone
api.getRowDropZoneParams() returns undefined if the RowDragModule is not registered.
Server-side Row Model
Server-side Row Model full store (activated by suppressServerSideInfiniteScroll property) is now
removed. Please use the standard server-side row model functionality as documented.
Column State
Column state properties in the column definition are no longer parsed to number/boolean. Provide the correct types instead of strings.
Grid State
Grid state colId ag-Grid-ControlsColumn is now named ag-Grid-SelectionColumn.
Restoring grid state with the old colId will have no effect.
Integrated Charts
navigator is removed from ChartFormatPanelGroup. Navigator setting is now part of
the Integrated Charts Advanced Settings.
Sparklines
-
type: 'column'- removed, usetype: 'bar'anddirection: 'vertical'instead. -
tooltip.rendererno longer returns tooltip font colour and opacity - use CSS instead. tooltip.xOffset / tooltip.yOffset- removed, use CSS instead.tooltip.container- removed, AG Charts now handles this.marker.formatter- removed, usemarker.itemStylerinstead.-
sparklineOptions.[line, area, bar, column]to apply styles - removed, usesparklineOptionsproperties instead. -
highlightStylenow follows the AG Charts options - for more customisation options use anitemStylerinstead. -
sparklineOptions.valueAxisDomain- removed, usesparklineOptions.min/maxinstead. -
sparklineOptions.paddingInner / sparklineOptions.paddingOuter- removed, usesparklineOptions.axis.paddingInner / sparklineOptions.axis.paddingOuterinstead. sparklineOptions.container- removed.-
sparklineOptions.label.placement- updated to use AG Charts Label Placement. Instead ofinsideBase,center,insideEndandoutsideEnd, please useinside-center,inside-start,inside-endoroutside-end
Removal of Deprecated APIs
The following APIs have been deprecated since at least v31 and have now been removed.
Removed Deprecated APIs
Grid API
new Grid()- removed, usecreateGridinstead.-
api- no longer mutated onto the providedgridOptionsfor Javascript users. -
First argument of
selectAllanddeselectAllgrid API methods is now the selection mode, the event source is now the second argument. Both are optional. -
getFirstDisplayedRow- removed, usegetFirstDisplayedRowIndexinstead. getLastDisplayedRow- removed, usegetLastDisplayedRowIndexinstead.getModel()- removed, use the appropriate grid API methods instead.getValue- removed, usegetCellValueinstead.-
showColumnMenuAfterButtonClick- removed, useIHeaderParams.showColumnMenuwithin a header component, orapi.showColumnMenuelsewhere. -
showColumnMenuAfterMouseClick- removed, useIHeaderParams.showColumnMenuAfterMouseClickwithin a header component, orapi.showColumnMenuelsewhere. -
autoSizeColumn(key)- removed, please useautoSizeColumns([colKey])instead. -
setColumnWidths(key, newWidth)- removed, please usesetColumnWidths([{key: newWidth}])instead. -
moveColumn(key, toIndex)- removed, please usemoveColumns([key], toIndex)instead. -
addAggFunc(key, func)- removed, please useaddAggFuncs({ key: func })instead. -
removeValueColumn(colKey)- removed, please useremoveValueColumns([colKey])instead. -
addValueColumn(colKey)- removed, please useaddValueColumns([colKey])instead. -
removeRowGroupColumn(colKey)- removed, please useremoveRowGroupColumns([colKey])instead. -
addRowGroupColumn(colKey)- removed, please useaddRowGroupColumns([colKey])instead. -
removePivotColumn(colKey)- removed, please useremovePivotColumns([colKey])instead. -
addPivotColumn(colKey)- removed, please useaddPivotColumns([colKey])instead. -
setColumnVisible(key, visible)- removed, please usesetColumnsVisible([key], visible)instead. -
setColumnPinned(key, pinned)- removed, please usesetColumnsPinned([key], pinned)instead. -
To get/set individual filter models, use
getColumnFilterModelorsetColumnFilterModelinstead.
Grid Options
suppressServerSideInfiniteScroll- removed without replacement.-
Interface
getServerSideGroupLevelParams-suppressInfiniteScrollproperty removed without replacement. -
advancedFilterModel- removed, please useinitialState.filter.advancedFilterModelinstead. suppressAsyncEvents- removed, Events should be handled asynchronously.cellFlashDelay- removed, please usecellFlashDurationinstead.cellFadeDelay- removed, please usecellFadeDurationinstead.-
enableCellChangeFlash- removed, setenableCellChangeFlashin theColDefordefaultColDeffor all columns. suppressGroupMaintainValueType- removed.groupIncludeFooter- removed, please usegroupTotalRowinstead.groupIncludeTotalFooter- removed, please usegrandTotalRowinstead.serverSideSortOnServer- removed.serverSideFilterOnServer- removed.tabToNextCellreturningnull- removed.tabToNextHeaderreturningnull- removed.
ColDef
-
suppressCellFlash- removed, please useenableCellChangeFlash: falsein theColDef. columnsMenuParams- removed, please usecolumnChooserParamsinstead.suppressMenu- removed, please usesuppressHeaderMenuButtoninstead.
Floating Filters
Floating filters provided via the colDef.filter values text, number,
date, set, multi, and group no longer work. Use the values
agTextColumnFilter, agNumberColumnFilter, agDateColumnFilter,
agSetColumnFilter, agMultiColumnFilter, and agGroupColumnFilter
instead.
Interfaces
-
RowDragEventinterface:vDirectionproperty is now typed as'up' | 'down' | null. -
IFloatingFilterParams:suppressFilterButton- removed, please usecolDef.suppressFloatingFilterButtoninstead. -
ITextFilterParams:textCustomComparator- removed, please usetextMatcherinstead. -
IFloatingFilter:onParamsUpdated- removed, please userefreshinstead. -
IFilterParams:valueGetter- removed, please usegetValueinstead. -
IDate:onParamsUpdated- removed, please userefreshinstead. -
IGroupCellRendererParams:footerValueGetter- removed, please usetotalValueGetterinstead. -
FlashCellsParams:flashDelay- removed, please useflashDurationinstead.fadeDelay- removed, please usefadeDurationinstead.
-
ToolPanelColumnCompParams:ToolPanelColumnCompParams- removed, please useIToolPanelColumnCompParamsinstead. ExcelAlignment: Legacy propertyverticalText- removed.ExcelFont: Legacy propertycharSet- removed.ExcelStyle: Legacy propertyname- removed.
Deprecations
Deprecations
Modules
-
ModuleRegistry.register(module)- deprecated, useModuleRegistry.registerModules([module])instead. -
MenuModule- deprecated, useColumnMenuModulefor the Column Menu and/orContextMenuModulefor the Context Menu instead. RangeSelectionModule- deprecated, useCellSelectionModuleinstead.
Column Object
-
Column.isHovered()- deprecated, useapi.isColumnHovered(column)instead.
Grid API
-
deselectAllFiltered- deprecated, usedeselectAll('filtered')instead. -
deselectAllOnCurrentPage- deprecated, usedeselectAll('currentPage')instead. selectAllFiltered- deprecated, useselectAll('filtered')instead.-
selectAllOnCurrentPage- deprecated, useselectAll('currentPage')instead.
Grid Options
-
cellRendererParams.checkbox- deprecated, userowSelection.checkboxLocation = "autoGroupColumn"instead. -
gridOptions.sortingOrder- deprecated, usedefaultColDef.sortingOrderinstead. -
gridOptions.unSortIcon- deprecated, usedefaultColDef.unSortIconinstead. -
groupRemoveLowestSingleChildren- deprecated, usegroupHideParentOfSingleChild: 'leafGroupsOnly'instead. -
groupRemoveSingleChildren- deprecated, usegroupHideParentOfSingleChild: trueinstead. -
suppressMakeColumnVisibleAfterUnGroup- deprecated, usesuppressGroupChangesColumnVisibility: "suppressShowOnUngroup"instead. -
suppressPropertyNamesCheck- deprecated without replacement. Previously used for adding user properties ingridOptionsandcolumnDefs. Now, use thecontextproperty in both for storing arbitrary metadata. -
suppressRowGroupHidesColumns- deprecated, usesuppressGroupChangesColumnVisibility: "suppressHideOnGroup"instead. -
When setting both
suppressMakeColumnVisibleAfterUnGroupandsuppressRowGroupHidesColumnstotrue, usesuppressGroupChangesColumnVisibility: trueinstead.
Row Node
-
childIndex- deprecated, userowNode.parent?.childrenAfterSort?.findIndex(r => r === rowNode)instead. -
firstChild- deprecated, userowNode.parent?.childrenAfterSort?.[0] === rowNodeinstead. -
lastChild- deprecated, use!!rowNode.parent?.childrenAfterSort && (rowNode.parent.childrenAfterSort[rowNode.parent.childrenAfterSort.length - 1] === rowNode)instead.
Row Node Events
-
childIndexChanged- deprecated, use the globalmodelUpdatedevent to determine when row children have changed. -
firstChildChanged- deprecated, use the globalmodelUpdatedevent to determine when row children have changed. -
lastChildChanged- deprecated, use the globalmodelUpdatedevent to determine when row children have changed.
Theming Custom Icons
-
smallDown- deprecated, use:advancedFilterBuilderSelectfor Advanced Filter Builder dropdown.-
selectOpenfor Select cell editor and dropdowns (e.g., Integrated Charts menu). richSelectOpenfor Rich Select cell editor.
-
smallLeft- deprecated, use:panelDelimiterRtlfor Row Group Panel / Pivot Panel.subMenuOpenRtlfor sub-menus.
-
smallRight- deprecated, use:panelDelimiterfor Row Group Panel / Pivot Panel.subMenuOpenfor sub-menus.