-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
chore: Upgrade AG Grid to use tree shaking #32334
base: master
Are you sure you want to change the base?
Conversation
@justinpark could you please verify if I included all modules that we use in the table in SQL Lab? There's a tool that helps selecting the correct modules here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've completed my review and didn't find any issues.
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/setup/setupAGGridModules.ts | ✅ |
superset-frontend/src/views/App.tsx | ✅ |
superset-frontend/src/components/GridTable/index.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Documentation ✅ Logging ✅ Error Handling ✅ Readability ✅ Design ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
@kgabryje Ephemeral environment spinning up at http://52.12.1.165:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup. |
@kgabryje Ephemeral environment spinning up at http://52.12.1.165:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@kgabryje I pinged @justinpark and he'll take a look. Please don't merge it just yet 😉 |
@@ -363,7 +368,7 @@ describe('ResultSet', () => { | |||
); | |||
}); | |||
const { getByRole } = setup(mockedProps, mockStore(initialState)); | |||
expect(getByRole('treegrid')).toBeInTheDocument(); | |||
expect(getByRole('grid')).toBeInTheDocument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, in jest runtime, the ag grid root had a role "grid", not "treegrid"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for upgrade
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait. it looks like the header menu has gone in this version. Could you check what is missing?
RowApiModule, | ||
CellApiModule, | ||
RenderApiModule, | ||
ClientSideRowModelModule, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check if there's an api for column header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't, the closest thing is ColumnApiModule which we include here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CustomFilterModule might be the one.
Which header menu? I'm comparing before/after side by side and I can't see a difference. Also nothing happens on right-click in both versions. In the recording, I'm running master on localhost, and the other tab is the ephemeral env for this PR. Screen.Recording.2025-02-21.at.19.18.25.mov |
@@ -216,21 +231,16 @@ function GridTable<RecordType extends object>({ | |||
`} | |||
> | |||
<AgGridReact | |||
// TODO: migrate to Theme API - https://www.ag-grid.com/react-data-grid/theming-migration/ | |||
theme="legacy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that it's not related to this change but this ant dropdown migration. I will fix the dropdown menu issue separately. |
SUMMARY
Upgrade AG Grid to version 33. This version improved modules architecture, which lets us specify exactly which parts of the library we use and tree-shake the rest, thus improving the bundle size.
Additionally, I wrapped some props passed to AG Grid in
useMemo
to avoid rerendersBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual changes
TESTING INSTRUCTIONS
The AG Grid table in SQL Lab should work like before
ADDITIONAL INFORMATION