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

docs(core): exposing usePerspective and updating tsDoc #8528

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

jordanl17
Copy link
Member

@jordanl17 jordanl17 commented Feb 6, 2025

Description

Making the usePerspective hook @beta for tsdocs. Also updating the associated types used in PerspectiveContextValue

What to review

  • Is it right to move to @beta for these types
  • The comment added to usePerspective - does this look ok?

Testing

Notes for release

N/A

Copy link

vercel bot commented Feb 6, 2025

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 Feb 12, 2025 2:05pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 2:05pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 2:05pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 12, 2025 2:05pm
test-next-studio ⬜️ Ignored (Inspect) Feb 12, 2025 2:05pm

@jordanl17 jordanl17 force-pushed the docs/corel-public-usePerspective branch from 6b7c5ef to 7d59ee6 Compare February 6, 2025 18:38
Copy link
Contributor

github-actions bot commented Feb 6, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.46% 53775 / 126619
🔵 Statements 42.46% 53775 / 126619
🔵 Functions 47.95% 2772 / 5781
🔵 Branches 78.85% 10307 / 13070
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/sanity/src/core/perspective/types.ts 0% 0% 0% 0%
packages/sanity/src/core/perspective/usePerspective.ts 85.71% 50% 100% 85.71% 23
packages/sanity/src/core/releases/store/types.ts 100% 100% 100% 100%
Generated in workflow #30264 for commit d852d90 by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Feb 7, 2025

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 7, 2025

⚡️ Editor Performance Report

Updated Wed, 12 Feb 2025 19:38:42 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 24.1 efps (42ms) 26.0 efps (39ms) -3ms (-7.2%)
article (body) 73.0 efps (14ms) 72.2 efps (14ms) +0ms (-/-%)
article (string inside object) 26.7 efps (38ms) 25.6 efps (39ms) +2ms (+4.0%)
article (string inside array) 23.8 efps (42ms) 22.2 efps (45ms) +3ms (+7.1%)
recipe (name) 45.5 efps (22ms) 43.5 efps (23ms) +1ms (+4.5%)
recipe (description) 52.6 efps (19ms) 48.8 efps (21ms) +2ms (+7.9%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (6ms) +1ms (-/-%)
synthetic (title) 19.2 efps (52ms) 19.2 efps (52ms) +0ms (-/-%)
synthetic (string inside object) 18.2 efps (55ms) 19.2 efps (52ms) -3ms (-5.5%)

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) 42ms 48ms 52ms 247ms 380ms 11.7s
article (body) 14ms 15ms 25ms 123ms 261ms 5.1s
article (string inside object) 38ms 40ms 45ms 71ms 135ms 6.8s
article (string inside array) 42ms 43ms 46ms 220ms 427ms 7.5s
recipe (name) 22ms 24ms 30ms 83ms 8ms 7.4s
recipe (description) 19ms 21ms 22ms 38ms 0ms 4.7s
recipe (instructions) 5ms 7ms 8ms 10ms 0ms 3.1s
synthetic (title) 52ms 55ms 60ms 234ms 1027ms 14.3s
synthetic (string inside object) 55ms 57ms 60ms 393ms 1351ms 8.8s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 39ms 41ms 44ms 403ms 333ms 11.2s
article (body) 14ms 15ms 19ms 78ms 79ms 5.0s
article (string inside object) 39ms 40ms 44ms 136ms 157ms 7.0s
article (string inside array) 45ms 47ms 49ms 145ms 412ms 7.4s
recipe (name) 23ms 24ms 27ms 44ms 7ms 7.6s
recipe (description) 21ms 22ms 25ms 48ms 0ms 5.1s
recipe (instructions) 6ms 8ms 9ms 11ms 0ms 3.2s
synthetic (title) 52ms 54ms 56ms 238ms 663ms 12.9s
synthetic (string inside object) 52ms 54ms 59ms 148ms 510ms 7.7s

📚 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.

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Component Testing Report Updated Feb 12, 2025 2:14 PM (UTC)

❌ Failed Tests (3) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 8s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 2m 35s 3 0 3
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 53s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 15s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 28s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 9s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 35s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 2m 6s 21 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 45s 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

@jordanl17 jordanl17 force-pushed the docs/corel-public-usePerspective branch from c6e0495 to 592067d Compare February 10, 2025 11:42
@jordanl17 jordanl17 force-pushed the docs/corel-public-usePerspective branch from 592067d to 0e3c0f2 Compare February 10, 2025 12:01
@jordanl17 jordanl17 force-pushed the docs/corel-public-usePerspective branch 2 times, most recently from 21b6b23 to 45b97e5 Compare February 11, 2025 10:21
@jordanl17 jordanl17 force-pushed the docs/corel-public-usePerspective branch 2 times, most recently from 2670754 to 41fcdd5 Compare February 11, 2025 14:10
@jordanl17 jordanl17 marked this pull request as ready for review February 11, 2025 15:04
@jordanl17 jordanl17 requested review from a team as code owners February 11, 2025 15:04
@jordanl17 jordanl17 requested a review from RitaDias February 11, 2025 15:04
Copy link
Contributor

@RitaDias RitaDias left a comment

Choose a reason for hiding this comment

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

@jordanl17 jordanl17 enabled auto-merge (squash) February 12, 2025 13:57
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