refactor: Fix fast refresh invalidations #1150
Merged
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.
Fixes #727 as best we can w/o requiring major changes. HMR works best w/ functional components and that's too big of a change to switch everything to functional components just for HMR.
Added an eslint rule which will warn about things that will almost certainly invalidate HMR. Fixed the warnings it emitted.
Tested locally by changing some displayed text values in some panels and seeing if the page triggered a full reload. I didn't have any specific files/cases that triggered full reloads previously and it seems Vite 4 has made it better on its own. If we start running into cases.
Saving
GridRenderer
doesn't trigger a full page reload (didn't before either), but massively slows the page (also had this behavior prior to this change). The change eventually propagates and refreshesWe should keep an eye on vitejs/vite#12062 which will likely also fix the slow HMR issues on some components. There seems to be duplication of modules in the update list and it can explode at times (like GridRenderer triggers 14 unique modules, but 20k updates consisting of just those 14)
BREAKING CHANGE:
Renamed
renderFileListItem
toFileListItem
.Renamed
RenderFileListItemProps
toFileListItemProps
.Removed exports for
ConsolePlugin.assertIsConsolePluginProps
,GridPlugin.SUPPORTED_TYPES
,FileList.getPathFromItem
,FileList.DRAG_HOVER_TIMEOUT
,FileList.getItemIcon
,Grid.directionForKey
,GotoRow.isIrisGridProxyModel
, andAggregations.SELECTABLE_OPTIONS
. These were all only being consumed within their own file and are not consumed in enterprise