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

chore(core): replace 'sanity' imports for relative paths in core #8160

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

pedrobonamin
Copy link
Contributor

@pedrobonamin pedrobonamin commented Jan 2, 2025

Description

Adds a new rule to avoid imports from sanity in files inside packages/src/core/** and replaces all the necessary imports.
Importing from sanity in core creates issues with the tests running with vitest, mocking sanity inside a test in core generates inconsistent imports and could produce hard to follow tests errors.
example:
Screenshot 2025-01-02 at 15 55 02

What to review

Is this change correct?

Testing

No new functionalities added, existing tests passing should be enough

Notes for release

n/a this is internal

Copy link

vercel bot commented Jan 2, 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 Jan 2, 2025 2:42pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 2:42pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 2:42pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2025 2:42pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Jan 2, 2025 2:42pm

Copy link
Contributor

github-actions bot commented Jan 2, 2025

No changes to documentation

Copy link
Contributor

github-actions bot commented Jan 2, 2025

Component Testing Report Updated Jan 2, 2025 2:52 PM (UTC)

✅ All Tests Passed -- 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) 12s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 38s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 50s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 25s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 6s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 28s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 39s 18 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 43s 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 Jan 2, 2025

⚡️ Editor Performance Report

Updated Thu, 02 Jan 2025 14:54:43 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 25.6 efps (39ms) 27.0 efps (37ms) -2ms (-5.1%)
article (body) 64.3 efps (16ms) 67.3 efps (15ms) -1ms (-/-%)
article (string inside object) 26.3 efps (38ms) 27.8 efps (36ms) -2ms (-5.3%)
article (string inside array) 23.3 efps (43ms) 22.7 efps (44ms) +1ms (+2.3%)
recipe (name) 52.6 efps (19ms) 62.5 efps (16ms) -3ms (-15.8%)
recipe (description) 58.8 efps (17ms) 62.5 efps (16ms) -1ms (-5.9%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 18.5 efps (54ms) 19.6 efps (51ms) -3ms (-5.6%)
synthetic (string inside object) 19.6 efps (51ms) 20.4 efps (49ms) -2ms (-3.9%)

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) 39ms 43ms 59ms 451ms 679ms 10.2s
article (body) 16ms 17ms 23ms 184ms 215ms 5.2s
article (string inside object) 38ms 40ms 51ms 226ms 270ms 6.8s
article (string inside array) 43ms 45ms 49ms 87ms 271ms 7.2s
recipe (name) 19ms 21ms 23ms 40ms 0ms 6.9s
recipe (description) 17ms 19ms 20ms 29ms 0ms 4.4s
recipe (instructions) 5ms 7ms 8ms 21ms 0ms 3.0s
synthetic (title) 54ms 59ms 70ms 261ms 752ms 16.9s
synthetic (string inside object) 51ms 53ms 61ms 105ms 97ms 7.9s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 37ms 41ms 58ms 504ms 766ms 10.6s
article (body) 15ms 17ms 25ms 153ms 217ms 5.3s
article (string inside object) 36ms 39ms 50ms 167ms 142ms 6.6s
article (string inside array) 44ms 47ms 49ms 161ms 393ms 7.4s
recipe (name) 16ms 18ms 20ms 29ms 0ms 7.2s
recipe (description) 16ms 17ms 19ms 33ms 0ms 4.3s
recipe (instructions) 5ms 7ms 9ms 20ms 0ms 3.0s
synthetic (title) 51ms 56ms 80ms 314ms 470ms 12.1s
synthetic (string inside object) 49ms 51ms 55ms 247ms 58ms 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.

@pedrobonamin pedrobonamin marked this pull request as ready for review January 3, 2025 09:21
@pedrobonamin pedrobonamin requested a review from a team as a code owner January 3, 2025 09:21
@pedrobonamin pedrobonamin requested review from bjoerge and removed request for a team January 3, 2025 09:21
Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

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

Great!

@pedrobonamin pedrobonamin added this pull request to the merge queue Jan 3, 2025
Merged via the queue into next with commit 32ae6ec Jan 3, 2025
60 checks passed
@pedrobonamin pedrobonamin deleted the replace-core-sanity-imports branch January 3, 2025 13:32
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