Skip to content

Conversation

@cherniavskii
Copy link
Member

No description provided.

@mui-bot
Copy link

mui-bot commented Dec 12, 2025

Deploy preview: https://deploy-preview-20645--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 7288439

Comment on lines +4 to +5
private plugins: Map<string, Plugin<any, any, any, any, any>> = new Map();
private pluginOrder: Plugin<any, any, any, any, any>[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both?

We can keep the order via the register method.
It will check the dependencies and re-create the map, so when you iterate through plugins, they will be ordered correctly.

// 1. Create registry with internal + user plugins (order maintained)
const registry = new PluginRegistry(internalPlugins, options.plugins);

// 2. Initialize internal plugin states FIRST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have our dependencies set correctly, we don't have to do this
Plugins that don't have any dependencies can be initialized in any order.

Comment on lines +5 to +6
sortable?: boolean;
filterable?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to come from plugins (they should be able to extend ColumnDef). The same goes for row metadata.

TState,
TApi,
TParams extends Record<string, any> = any,
TRequiredApi extends Record<string, any> = {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea that the plugin can require a specific API instead of another plugin. This way, you only need to satisfy the requirement. Another plugin doesn't have to provide exactly the same API (its API can have more optional parameters, but can still be used as a dependency).
For example, I need something that provides selectRow(id), but you give me selectRow(id, propagate = true).

The problem with this is how do you figure out if your requirement is fulfilled, if it comes from another plugin?

export { useDataGrid } from './hooks/useDataGrid';

// Plugins
export { default as sortingPlugin } from './plugins/sorting';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in the core, we can only re-export everything from the plugin's index, and each plugin should make sure it has the correct exports there

setColumns(generateColumns());
};

React.useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use this for checking the state and methods assigned to the grid instance object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants