feat(cli): alias to styled-components fork
Description
The following PR aliases 'styled-components' to our temporary fork of styled-components that includes the performance benefits of useInsertionEffect.
This PR:
- adds
@sanity/styled-componentsas a dependency in thesanitypackage. this should make our fork install automatically by package managers - updates
aliases.tsto aliasstyled-componentsto@sanity/styled-components - updates
buildVendorDependencies.tsto use our styled-components fork
What to review
Ensure my thought process for this one is sound. I think it's relatively low risk since we only support styled-components 6 now and we already do aliasing and deduping of this. I also wrapped resolving of our fork in try/catch and the default behavior should continue otherwise.
Testing
The existing test suite overlaps and I did additional manual testing by building locally, packing the result, installing the tarball in another studio. I ran sanity preview to test the aliases in dev mode and then sanity build and sanity build --auto-updates (followed by npx serve dist). All scenarios work as intended.
Notes for release
- Improves performance by utilizing a temporary fork of styled-components that includes the performance benefits of
useInsertionEffect
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 | Aug 8, 2024 2:47pm |
| performance-studio | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 8, 2024 2:47pm |
| test-compiled-studio | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 8, 2024 2:47pm |
| test-next-studio | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 8, 2024 2:47pm |
| test-studio | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 8, 2024 2:47pm |
1 Skipped Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| studio-workshop | ⬜️ Ignored (Inspect) | Visit Preview | Aug 8, 2024 2:47pm |
No changes to documentation
Component Testing Report Updated Aug 8, 2024 2:53 PM (UTC)
| File | Status | Duration | Passed | Skipped | Failed |
|---|---|---|---|---|---|
| comments/CommentInput.spec.tsx | ✅ Passed (Inspect) | 43s | 15 | 0 | 0 |
| formBuilder/ArrayInput.spec.tsx | ✅ Passed (Inspect) | 8s | 3 | 0 | 0 |
| formBuilder/inputs/PortableText/Annotations.spec.tsx | ✅ Passed (Inspect) | 31s | 6 | 0 | 0 |
| formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx | ✅ Passed (Inspect) | 37s | 11 | 7 | 0 |
| formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx | ✅ Passed (Inspect) | 0s | 0 | 12 | 0 |
| formBuilder/inputs/PortableText/Decorators.spec.tsx | ✅ Passed (Inspect) | 17s | 6 | 0 | 0 |
| formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx | ✅ Passed (Inspect) | 10s | 3 | 0 | 0 |
| formBuilder/inputs/PortableText/DragAndDrop.spec.tsx | ✅ Passed (Inspect) | 3m 0s | 0 | 0 | 0 |
| formBuilder/inputs/PortableText/FocusTracking.spec.tsx | ✅ Passed (Inspect) | 43s | 15 | 0 | 0 |
| formBuilder/inputs/PortableText/Input.spec.tsx | ✅ Passed (Inspect) | 1m 43s | 21 | 0 | 0 |
| formBuilder/inputs/PortableText/ObjectBlock.spec.tsx | ✅ Passed (Inspect) | 1m 15s | 18 | 0 | 0 |
| formBuilder/inputs/PortableText/PresenceCursors.spec.tsx | ✅ Passed (Inspect) | 9s | 3 | 9 | 0 |
| formBuilder/inputs/PortableText/RangeDecoration.spec.tsx | ✅ Passed (Inspect) | 26s | 9 | 0 | 0 |
| formBuilder/inputs/PortableText/Styles.spec.tsx | ✅ Passed (Inspect) | 18s | 6 | 0 | 0 |
| formBuilder/inputs/PortableText/Toolbar.spec.tsx | ✅ Passed (Inspect) | 1m 14s | 21 | 0 | 0 |
| formBuilder/tree-editing/TreeEditing.spec.tsx | ✅ Passed (Inspect) | 1m 48s | 30 | 0 | 0 |
| formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx | ✅ Passed (Inspect) | 19s | 3 | 0 | 0 |