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

fix(deps): drop react-copy-to-clipboard dependency #8041

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Dec 13, 2024

Description

We have a dependency on react-copy-to-clipboard which currently is not flagged to support React 19, and has not been updated in a few years. It is a very thin wrapper on top of copy-to-clipboard and we are only using it in a single spot (when you are deleting a document that is referenced using cross-dataset references).

I replaced it with using the native clipboard API - since this is triggered by a user interaction, it shouldn't need to prompt for permissions - and even if it does the user would be expecting this.

This gets rid of another dependency and moves us towards a fully React 19 compatible world.

What to review

  • Implementation looks good

Testing

Have done some manual testing in Chrome and Firefox, seems to work fine.

Notes for release

None

Copy link

vercel bot commented Dec 13, 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 Dec 13, 2024 4:08pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 4:08pm
test-next-studio 🛑 Canceled (Inspect) Dec 13, 2024 4:08pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 4:08pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Dec 13, 2024 4:08pm

@rexxars rexxars changed the title fix(deps): replace react-copy-to-clipboard dependency fix(deps): drop react-copy-to-clipboard dependency Dec 13, 2024
@rexxars rexxars force-pushed the fix/react-copy-to-clipboard branch from 1fcf52a to daf76c0 Compare December 13, 2024 15:47
@rexxars rexxars marked this pull request as ready for review December 13, 2024 15:47
@rexxars rexxars requested a review from a team as a code owner December 13, 2024 15:47
@rexxars rexxars requested review from ryanbonial and removed request for a team December 13, 2024 15:47
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Component Testing Report Updated Dec 13, 2024 3:59 PM (UTC)

❌ Failed Tests (6) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 15s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 40s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 56s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 28s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 16s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ❌ Failed (Inspect) 4m 27s 0 0 6
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 14s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 3m 6s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 51s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 15s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 44s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 56s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Dec 13, 2024

⚡️ Editor Performance Report

Updated Fri, 13 Dec 2024 15:59:26 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 26.3 efps (38ms) 24.7 efps (41ms) +3ms (+6.6%)
article (body) 69.9 efps (14ms) 77.5 efps (13ms) -1ms (-/-%)
article (string inside object) 25.6 efps (39ms) 27.0 efps (37ms) -2ms (-5.1%)
article (string inside array) 23.3 efps (43ms) 23.8 efps (42ms) -1ms (-2.3%)
recipe (name) 50.0 efps (20ms) 52.6 efps (19ms) -1ms (-5.0%)
recipe (description) 58.8 efps (17ms) 58.8 efps (17ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 19.2 efps (52ms) 18.9 efps (53ms) +1ms (+1.9%)
synthetic (string inside object) 19.6 efps (51ms) 19.2 efps (52ms) +1ms (+2.0%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 38ms 40ms 44ms 109ms 22ms 10.3s
article (body) 14ms 17ms 28ms 265ms 389ms 5.6s
article (string inside object) 39ms 42ms 52ms 81ms 235ms 7.1s
article (string inside array) 43ms 45ms 52ms 77ms 160ms 7.2s
recipe (name) 20ms 22ms 27ms 46ms 0ms 7.8s
recipe (description) 17ms 19ms 21ms 27ms 0ms 4.5s
recipe (instructions) 5ms 7ms 8ms 23ms 0ms 3.1s
synthetic (title) 52ms 56ms 62ms 90ms 253ms 13.9s
synthetic (string inside object) 51ms 57ms 66ms 499ms 1005ms 9.0s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 41ms 45ms 54ms 108ms 199ms 11.9s
article (body) 13ms 16ms 22ms 118ms 197ms 5.1s
article (string inside object) 37ms 41ms 45ms 83ms 128ms 6.6s
article (string inside array) 42ms 46ms 53ms 168ms 146ms 7.1s
recipe (name) 19ms 21ms 23ms 54ms 0ms 7.4s
recipe (description) 17ms 18ms 21ms 38ms 0ms 4.5s
recipe (instructions) 5ms 6ms 7ms 18ms 0ms 3.1s
synthetic (title) 53ms 57ms 68ms 146ms 314ms 12.9s
synthetic (string inside object) 52ms 56ms 63ms 517ms 962ms 8.5s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

@rexxars rexxars added this pull request to the merge queue Dec 14, 2024
Merged via the queue into next with commit 37b3065 Dec 14, 2024
50 of 53 checks passed
@rexxars rexxars deleted the fix/react-copy-to-clipboard branch December 14, 2024 00:38
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.

2 participants