refactor(structure): skip lazy-loading of default pane types #6772
+53
−16
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.
Edit: This seems to have broken production builds, which now gets
Unclear to me at this time why this happens. Circular imports?
Description
We're currently lazy-loading the different pane types that can appear in structure. The benefit of this is extremely slim, as 99% of all Sanity studios will include both the list, document list and document pane types - and the remaining
UserComponent
pane is fairly slim.Additionally, this lazy loading has caused a few code splitting/chunk issues in the past. It also causes an extra delay while loading the module. If we know we're going to need it in most cases, I feel it's better to load it up-front.
This PR removes the lazy loading. I also took the liberty of de-barreling a few of the subfolders here, since we're moving in that direction generally. Also explicitly listed the things that are exported from
structure/panes
, since I'd prefer us not to blindly export things.There is a new list in the test studio, "Structure pane types", which can be used to test all the different pane types.
What to review
Testing
I did not add any new tests, as this is baseline functionality that is tested on pretty much every page load.
Notes for release
None. Internal change.