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

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

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

@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.43% 53724 / 126610
🔵 Statements 42.43% 53724 / 126610
🔵 Functions 47.92% 2767 / 5774
🔵 Branches 78.78% 10267 / 13031
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 #30151 for commit 41fcdd5 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 Tue, 11 Feb 2025 14:23:54 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 27.0 efps (37ms) 23.0 efps (44ms) +7ms (+17.6%)
article (body) 67.1 efps (15ms) 72.2 efps (14ms) -1ms (-/-%)
article (string inside object) 27.8 efps (36ms) 24.7 efps (41ms) +5ms (+12.5%)
article (string inside array) 24.4 efps (41ms) 22.2 efps (45ms) +4ms (+9.8%)
recipe (name) 43.5 efps (23ms) 47.6 efps (21ms) -2ms (-8.7%)
recipe (description) 47.6 efps (21ms) 58.8 efps (17ms) -4ms (-19.0%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (5ms) -1ms (-/-%)
synthetic (title) 19.2 efps (52ms) 20.4 efps (49ms) -3ms (-5.8%)
synthetic (string inside object) 19.6 efps (51ms) 19.6 efps (51ms) +0ms (-/-%)

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) 37ms 40ms 45ms 400ms 136ms 11.3s
article (body) 15ms 18ms 52ms 224ms 282ms 5.8s
article (string inside object) 36ms 39ms 63ms 176ms 136ms 6.5s
article (string inside array) 41ms 43ms 48ms 69ms 336ms 7.2s
recipe (name) 23ms 25ms 27ms 54ms 12ms 7.4s
recipe (description) 21ms 22ms 24ms 33ms 0ms 5.0s
recipe (instructions) 6ms 7ms 9ms 35ms 0ms 3.2s
synthetic (title) 52ms 54ms 57ms 237ms 831ms 13.6s
synthetic (string inside object) 51ms 53ms 59ms 256ms 657ms 8.2s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 44ms 48ms 59ms 357ms 859ms 11.2s
article (body) 14ms 17ms 23ms 250ms 346ms 5.7s
article (string inside object) 41ms 43ms 45ms 56ms 140ms 6.7s
article (string inside array) 45ms 47ms 51ms 163ms 409ms 7.5s
recipe (name) 21ms 22ms 30ms 41ms 1ms 6.8s
recipe (description) 17ms 18ms 19ms 22ms 0ms 4.5s
recipe (instructions) 5ms 6ms 7ms 12ms 0ms 3.1s
synthetic (title) 49ms 53ms 62ms 398ms 887ms 13.5s
synthetic (string inside object) 51ms 54ms 74ms 167ms 581ms 8.0s

📚 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 11, 2025 2:26 PM (UTC)

❌ Failed Tests (4) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 7s 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) 52s 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) 27s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 7s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 36s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 2m 5s 21 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 2m 25s 20 0 1
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 from e3e190d to 2670754 Compare February 11, 2025 14:10
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.

1 participant