-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Data Grid] Avoid <GridRoot />
double-render pass on mount in SPA mode
#15648
Open
lauri865
wants to merge
142
commits into
mui:master
Choose a base branch
from
lauri865:avoid-double-render-pass-in-spas
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 128 commits
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
c0944e1
add useIsSSR hook to with useSyncExternalStore to avoid double-render…
lauri865 ad08bcd
remove unused import
lauri865 2ff2567
add missing dependency
lauri865 128234a
add missing types
lauri865 8da261b
fix failing test
lauri865 e680805
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 eb491c6
lint
lauri865 8d2a78d
fix some tests
lauri865 c8580d9
fix flicker on mount
lauri865 c459ad6
don't hydrate widths unless there's a flex column
lauri865 01cbb00
fix tests
lauri865 d4707a1
lint
lauri865 5ca918f
fix: aggregation should trigger column update directly, and not lean …
lauri865 9cd2134
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 4287d0a
Fix for grid aggregation out of order column hydration
lauri865 903554e
fix grid dimension calling updateRenderContext before dimensions have…
lauri865 91cd557
link
lauri865 20f87a0
remove debug
lauri865 a51aa8e
use selectors for pinnedrow heights to update dimensions
lauri865 6d01710
cleanup
lauri865 063c0b0
fix
lauri865 f87588c
fix
lauri865 95f3f08
fix
lauri865 8fdcb8c
fix
lauri865 d6ee4a2
fix
lauri865 2eab88c
test
lauri865 f709da6
fix
lauri865 7313c34
fix
lauri865 52c051d
test
lauri865 5cc425f
test
lauri865 0b1f757
test
lauri865 4514cd4
test
lauri865 b861e41
fix selector returning stale data
lauri865 b366708
test alternative rendercontext updates
lauri865 9176ec0
fix dimension->renderContext propagation
lauri865 f29dfbc
fix aggregation cache not being initialized properly
lauri865 6995ed7
fix filler border top showing on first row
lauri865 4b7f544
fix jumping autoheight
lauri865 1495b06
Merge remote-tracking branch 'upstream/master' into avoid-double-rend…
lauri865 d4eb696
lint: reorder package.json
lauri865 35cf5e3
remove `calculatePinnedRowsHeight`
lauri865 631c6b6
revert to throttle
lauri865 1397dbc
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 2ee5a28
fix test
lauri865 8bb087e
oops
lauri865 30c10ba
fix
lauri865 14c42f4
control update flow
lauri865 989811c
refactor
lauri865 0a91c02
fix renderedRowsIntervalChange
lauri865 c19f001
fix
lauri865 f88d9a2
fix
lauri865 0ecb2dd
test
lauri865 73d0ff7
properly initialize static dimensions
lauri865 6201f02
fix order
lauri865 c4190fb
fix
lauri865 9f5a709
cleanup
lauri865 051db9c
split ownership of renderContext updates between `useGridDimensions` …
lauri865 666bf4c
remove unnecessary event handler
lauri865 94a1caf
fix flaky test
lauri865 e6c32a9
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 b72df72
remove !
lauri865 5b8686d
deprecate forceupdate
lauri865 68e79df
typo
lauri865 663a5dd
lint
lauri865 7a93d2e
remove unused prop
lauri865 f9f250c
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 18e4361
refactor debounce logic
lauri865 4388740
perf: don't filter data if there are no filters
lauri865 4c3fda2
lint
lauri865 bed334e
lint
lauri865 281bd96
stable filter lookup base state
lauri865 9cfa9d9
simplify
lauri865 24b5ae0
remove repeated line
lauri865 a66231d
perf: check for autogenerated rows only if model doesn't exist
lauri865 fcd3c9c
lint `useGridDimensions`
lauri865 9c72ea7
Merge remote-tracking branch 'upstream/master' into avoid-double-rend…
lauri865 10bdcd8
use empty object for `useGridSelector` deps
lauri865 bf8bcf4
fix
lauri865 ac18ea5
fix row editing selector
lauri865 fc18204
lint
lauri865 0cfce51
ci
lauri865 4325795
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 8932863
perf: improve resize performance
lauri865 c2f90cb
perf: resize performance / use granular selectors for dimensions
lauri865 b600821
ci
lauri865 c78076c
reorg
lauri865 bc44121
fix
lauri865 e8b451c
fix
lauri865 5b0df33
fix styles re-evaluating on each render
lauri865 5e4eb36
watermark as const
lauri865 c42a435
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 f2b57b0
perf: +10-15 fps
lauri865 008bf87
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 cf2cd66
ci
lauri865 d8e7f0c
fix tests
lauri865 51eea10
fix
lauri865 abcd947
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 53b1e82
Merge remote-tracking branch 'upstream/master' into avoid-double-rend…
lauri865 560a436
ci
lauri865 c3f54b3
fix test
lauri865 1c5fc8c
lint
lauri865 bbcb8a3
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 3a57406
stable obj
lauri865 ffa1efc
reduce unnecessary calls to `hydrateRowsMeta`
lauri865 0fc0226
Merge remote-tracking branch 'upstream/master' into avoid-double-rend…
lauri865 ae6cc13
lint
lauri865 34f24b3
fix recipe
lauri865 56f75fa
lint
lauri865 2415b59
fix grid selector timing issue
lauri865 b63c07a
lint
lauri865 37cf769
lint
lauri865 b10a81f
readability
lauri865 45f70a1
add `rootMount` event
lauri865 d92c4d8
use `useSyncExternalStore` for `useGridSelector`
lauri865 43829e8
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 25998ec
fix
lauri865 e6399e2
fix
lauri865 d4b652b
make typescript happy
lauri865 9f95fee
alternative syncexternalstore implementationgetState
lauri865 32e4dc2
fix
lauri865 bae6d94
fix
lauri865 cddb1bf
fuck me
lauri865 74d77a9
update changelog
cherniavskii e8963eb
update diff
cherniavskii 5d0109b
perf: `rowsHeightsChange` event to streamline dimensions/renderContex…
lauri865 12e0e74
lint
lauri865 ee91dbc
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 3449782
narrow filteredRowsLookup type
cherniavskii 4c5fa74
Merge branch 'master' into avoid-double-render-pass-in-spas
lauri865 26be717
fix
lauri865 b4ab00c
fix
lauri865 eb577a3
fix detailpanel
lauri865 d628881
remove some newly introduced selectors
lauri865 9760a27
column render context override
lauri865 7005366
revert
lauri865 680d823
Merge branch 'master' into avoid-double-render-pass-in-spas
cherniavskii af40788
narrow visibleRowsLookup type
cherniavskii 0b6bcda
update changelog
cherniavskii 676da6b
useEventCallback
cherniavskii 76fb889
Merge branch 'master' into avoid-double-render-pass-in-spas
cherniavskii f8ca726
Revert "useEventCallback"
cherniavskii e45e07a
Merge branch 'master' into avoid-double-render-pass-in-spas
cherniavskii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 agree with the proposed change, but why doesn't the previous implementation work anymore?
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.
Due to this change:
mui-x/packages/x-data-grid/src/hooks/features/filter/useGridFilter.tsx
Lines 457 to 459 in cddb1bf
If we can skip
filteredRowsLookup
assigning values for bothtrue
andfalse
, we can easily skip manyO(n)
operations (e.g. buildingfilteredRowsLookup
to begin with, but there was more cascading ones) if there are no filters present, as well have a smaller resulting object. Then we can just check forisObjectEmpty
and skip the ops. There was only once instance internally that checked fortrue
value and everything else checked forfilteredRowsLookup[id] !== false
.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.
E.g. editing cells in this demo should be a few frames faster now when you commit the changes (same for initial mount and row updates):
https://deploy-preview-15648--material-ui-x.netlify.app/x/react-data-grid/#pro-version
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.
Makes sense 👍🏻
I'll mention this change in the changelog, and perhaps revert it in a v7 cherry-pick PR to avoid breaking things.