villebro commented on a change in pull request #16444:
URL: https://github.com/apache/superset/pull/16444#discussion_r695669877
##########
File path: superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
##########
@@ -100,6 +101,8 @@ const ChartOverlay = styled.div`
`;
export default class Chart extends React.Component {
+ static whyDidYouRender = true;
+
Review comment:
do we want to start introducing these in the codebase now? I'm fine
either way
##########
File path:
superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts
##########
@@ -68,13 +69,15 @@ export default function getFormDataWithExtraFilters({
// if dashboard metadata + filters have not changed, use cache if possible
if (
- (cachedFiltersByChart[sliceId] || {}) === filters &&
- (colorScheme == null ||
- cachedFormdataByChart[sliceId].color_scheme === colorScheme) &&
- cachedFormdataByChart[sliceId].color_namespace === colorNamespace &&
- isEqual(cachedFormdataByChart[sliceId].label_colors, labelColors) &&
+ cachedFiltersByChart[sliceId] === filters &&
+ (colorScheme === null ||
+ cachedFormdataByChart[sliceId]?.color_scheme === colorScheme) &&
+ cachedFormdataByChart[sliceId]?.color_namespace === colorNamespace &&
+ isEqual(cachedFormdataByChart[sliceId]?.label_colors, labelColors) &&
!!cachedFormdataByChart[sliceId] &&
- dataMask === undefined
+ areObjectsEqual(cachedFormdataByChart[sliceId]?.dataMask, dataMask, {
+ ignoreUndefined: true,
+ })
Review comment:
While we're modifying code here and for the sake of DRY, would it make
sense to break out
```js
const cachedFormdata = cachedFormdataByChart[sliceId];
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]