Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] Replace eval with new Function #11557

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Jan 3, 2024

I was curious if we could improve this logic:

@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label Jan 3, 2024
@mui-bot
Copy link

mui-bot commented Jan 3, 2024

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

Generated by 🚫 dangerJS against e6095c3

@oliviertassinari oliviertassinari added the core Infrastructure work going on behind the scenes label Jan 3, 2024
oliviertassinari and others added 2 commits January 3, 2024 14:35
Co-authored-by: Rom Grk <romgrk@users.noreply.github.com>
Signed-off-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Comment on lines 294 to 291
const filterItem: GridFilterItemApplierNotAggregated = (row, shouldApplyItem) => {
return filterItemCore(apiRef.current.getRowId, appliers, row, shouldApplyItem);
};
filterItemsApplierId += 1;

return filterItem;
return (row, shouldApplyItem) => filterItemCore(appliers, row, shouldApplyItem);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sometimes I like assigning functions to a variable because it gives a better debugging experience, the stack entry would read filterItem - .../gridFilterUtils.js:294 instead of (anonymous) - .../gridFilterUtils.js:291. It's useful when stepping through code but also when collecting performance profiles. With this change I'm also not sure what the name of filterItemCore becomes.

It's fine to leave as it is, but just fyi.

@oliviertassinari oliviertassinari merged commit 7388dee into mui:next Jan 3, 2024
15 checks passed
@oliviertassinari oliviertassinari deleted the avoid-eval branch January 3, 2024 17:49
@oliviertassinari
Copy link
Member Author

@romgrk thanks for the reviews.

@cherniavskii cherniavskii added feature: Filtering Related to the data grid Filtering feature bug 🐛 Something doesn't work and removed core Infrastructure work going on behind the scenes labels Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Filtering Related to the data grid Filtering feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@mui/x-data-grid-premium "ReferenceError: atob is not defined"
4 participants