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

feat: cli server side schemas #8570

Draft
wants to merge 16 commits into
base: next
Choose a base branch
from
Draft

Conversation

EsaNuurtamo
Copy link

@EsaNuurtamo EsaNuurtamo commented Feb 10, 2025

Description

  • New commands added
    • sanity schema store --workspace some --path custom-path-for-schemas
      • Stores the schema for the workspace in the project dataset
      • If path is added it takes the create-manifest.json from that location
    • sanity schema fetch --id sanity.workspace.schema.name
      • Get the schema fro current dataset and for workspace defined in the parameter
    • sanity deploy
      • Schemas are automatically saved to content lake on deploy and you can again use custom path for local development

Problems

  • There can only be one schema in Content lake for each workspace. If someone has same exact create-manifest.json in multiple studios (same dataset, projectId, workspace name) this can cause an issue

What to review

  • Install tagged release to your project: npm install sanity@server-side-schemas
  • Try the above commands, here are more details: notion doc

Testing

Notes for release

Copy link

vercel bot commented Feb 10, 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 21, 2025 0:50am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 0:50am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 0:50am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 0:50am
test-next-studio ⬜️ Ignored (Inspect) Feb 21, 2025 0:50am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 10, 2025

Component Testing Report Updated Feb 21, 2025 1:00 PM (UTC)

❌ Failed Tests (6) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 22s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 2m 41s 3 0 3
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 59s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 17s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ❌ Failed (Inspect) 2m 37s 13 0 2
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 56s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ❌ Failed (Inspect) 3m 1s 20 0 1
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 15s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 2m 2s 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 Feb 10, 2025

⚡️ Editor Performance Report

Updated Fri, 21 Feb 2025 12:55:43 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 25.3 efps (40ms) 23.8 efps (42ms) +3ms (+6.3%)
article (body) 68.0 efps (15ms) 67.6 efps (15ms) +0ms (-/-%)
article (string inside object) 27.8 efps (36ms) 25.0 efps (40ms) +4ms (+11.1%)
article (string inside array) 24.7 efps (41ms) 23.3 efps (43ms) +3ms (+6.2%)
recipe (name) 45.5 efps (22ms) 45.5 efps (22ms) +0ms (-/-%)
recipe (description) 50.0 efps (20ms) 50.0 efps (20ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (6ms) +1ms (-/-%)
synthetic (title) 20.4 efps (49ms) 20.4 efps (49ms) +0ms (-/-%)
synthetic (string inside object) 20.4 efps (49ms) 20.8 efps (48ms) -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) 40ms 45ms 51ms 351ms 154ms 10.3s
article (body) 15ms 20ms 36ms 201ms 214ms 5.8s
article (string inside object) 36ms 39ms 46ms 255ms 262ms 7.1s
article (string inside array) 41ms 43ms 48ms 148ms 234ms 7.2s
recipe (name) 22ms 25ms 27ms 57ms 1ms 7.2s
recipe (description) 20ms 21ms 23ms 42ms 0ms 5.0s
recipe (instructions) 5ms 7ms 8ms 16ms 0ms 3.2s
synthetic (title) 49ms 53ms 56ms 306ms 900ms 13.3s
synthetic (string inside object) 49ms 52ms 56ms 109ms 992ms 8.1s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 42ms 47ms 73ms 466ms 940ms 11.3s
article (body) 15ms 17ms 24ms 290ms 455ms 6.0s
article (string inside object) 40ms 42ms 46ms 139ms 206ms 7.3s
article (string inside array) 43ms 46ms 48ms 156ms 208ms 7.2s
recipe (name) 22ms 24ms 29ms 42ms 0ms 7.5s
recipe (description) 20ms 22ms 24ms 51ms 8ms 5.1s
recipe (instructions) 6ms 7ms 8ms 10ms 0ms 3.1s
synthetic (title) 49ms 52ms 55ms 270ms 480ms 12.9s
synthetic (string inside object) 48ms 49ms 69ms 272ms 770ms 8.1s

📚 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 17, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 43% 54993 / 127865
🔵 Statements 43% 54993 / 127865
🔵 Functions 48.11% 2796 / 5811
🔵 Branches 79.51% 10655 / 13400
File CoverageNo changed files found.
Generated in workflow #30817 for commit 12d4138 by the Vitest Coverage Report Action

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