[go: up one dir, main page]

Skip to content
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

refactor(structure): skip lazy-loading of default pane types #6772

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

rexxars
Copy link
Member
@rexxars rexxars commented May 24, 2024

Edit: This seems to have broken production builds, which now gets

Error: Pane: missing context value

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

  • Do all the pane types still load as expected? Then we should be good to go 👍
  • Are there drawbacks of this refactor that has not been considered?

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.

@rexxars rexxars requested review from a team as code owners May 24, 2024 22:51
@rexxars rexxars requested review from ricokahler and removed request for a team May 24, 2024 22:51
Copy link
vercel bot commented May 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 10:52pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 10:52pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 10:52pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 10:52pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) May 24, 2024 10:52pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated May 24, 2024 10:59 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 25s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 15s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 6s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 20s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 30s 12 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant