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: replace useForwardedRef with useImperativeHandle #6830

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

stipsan
Copy link
Member

@stipsan stipsan commented May 31, 2024

Description

The useForwardedRef hook in @sanity/ui is deprecated in v2.3.0, details here: sanity-io/ui#1324
As useForwardedRef uses useLayoutEffect internally we should see a nice little speed boost by the reduction of side-effect cycles with this refactor 🥰

What to review

Does it make sense?

Testing

Existing tests should be sufficient 🙌

Notes for release

N/A

@stipsan stipsan requested review from a team as code owners May 31, 2024 15:54
@stipsan stipsan requested review from skogsmaskin and juice49 and removed request for a team May 31, 2024 15:54
Copy link

vercel bot commented May 31, 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 Jun 7, 2024 1:32pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 1:32pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 1:32pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 1:32pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 1:32pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jun 7, 2024 1:32pm

Copy link

socket-security bot commented May 31, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/@codemirror/commands@6.6.0

View full report↗︎

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented May 31, 2024

Component Testing Report Updated Jun 7, 2024 1:36 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 27s 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) 9s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 37s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 16s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 4s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 21s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 31s 12 0 0

Copy link

socket-security bot commented Jun 3, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@babel/core@7.24.6, npm/@babel/helpers@7.24.6, npm/@babel/register@7.23.7, npm/@babel/runtime@7.24.6, npm/@codemirror/commands@6.5.0, npm/@codemirror/language@6.10.1, npm/@codemirror/view@6.26.3, npm/@lezer/lr@1.4.0, npm/@react-three/fiber@8.16.6, npm/@sanity/bifur-client@0.4.0, npm/@sanity/import@3.37.4

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@stipsan
Copy link
Member Author

stipsan commented Jun 3, 2024

@SocketSecurity ignore-all

@stipsan stipsan force-pushed the refactor-use-forwarded-ref branch from e2b1484 to 58fbaa6 Compare June 6, 2024 15:34
@stipsan stipsan force-pushed the refactor-use-forwarded-ref branch from 58fbaa6 to d9eece3 Compare June 7, 2024 11:30
Copy link
Contributor

@juice49 juice49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

@stipsan stipsan added this pull request to the merge queue Jun 10, 2024
Merged via the queue into next with commit 23bac62 Jun 10, 2024
44 checks passed
@stipsan stipsan deleted the refactor-use-forwarded-ref branch June 10, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants