sanity icon indicating copy to clipboard operation
sanity copied to clipboard

feat(cli): alias to styled-components fork

Open ricokahler opened this issue 1 year ago • 3 comments

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-components as a dependency in the sanity package. this should make our fork install automatically by package managers
  • updates aliases.ts to alias styled-components to @sanity/styled-components
  • updates buildVendorDependencies.ts to 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

ricokahler avatar Aug 07 '24 03:08 ricokahler

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

vercel[bot] avatar Aug 07 '24 03:08 vercel[bot]

No changes to documentation

github-actions[bot] avatar Aug 07 '24 03:08 github-actions[bot]

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

github-actions[bot] avatar Aug 07 '24 04:08 github-actions[bot]