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

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 10, 2025

Component Testing Report Updated Feb 18, 2025 11:42 AM (UTC)

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

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 28.2 efps (36ms) 28.2 efps (36ms) +0ms (-/-%)
article (body) 77.8 efps (13ms) 77.5 efps (13ms) +0ms (-/-%)
article (string inside object) 27.8 efps (36ms) 27.8 efps (36ms) +0ms (-/-%)
article (string inside array) 24.4 efps (41ms) 25.0 efps (40ms) -1ms (-2.4%)
recipe (name) 52.6 efps (19ms) 52.6 efps (19ms) +0ms (-/-%)
recipe (description) 58.8 efps (17ms) 58.8 efps (17ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 20.2 efps (50ms) 20.0 efps (50ms) +1ms (+1.0%)
synthetic (string inside object) 19.2 efps (52ms) 20.0 efps (50ms) -2ms (-3.8%)

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) 36ms 40ms 45ms 88ms 34ms 9.6s
article (body) 13ms 15ms 25ms 177ms 254ms 5.2s
article (string inside object) 36ms 39ms 43ms 50ms 136ms 6.7s
article (string inside array) 41ms 43ms 46ms 136ms 127ms 6.5s
recipe (name) 19ms 21ms 22ms 33ms 0ms 7.2s
recipe (description) 17ms 19ms 20ms 36ms 0ms 4.5s
recipe (instructions) 5ms 6ms 8ms 10ms 0ms 3.0s
synthetic (title) 50ms 56ms 66ms 251ms 719ms 13.3s
synthetic (string inside object) 52ms 53ms 58ms 212ms 725ms 7.9s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 36ms 39ms 46ms 238ms 129ms 10.6s
article (body) 13ms 15ms 26ms 143ms 178ms 5.3s
article (string inside object) 36ms 38ms 41ms 132ms 113ms 6.3s
article (string inside array) 40ms 43ms 46ms 80ms 142ms 6.8s
recipe (name) 19ms 20ms 23ms 38ms 0ms 8.2s
recipe (description) 17ms 19ms 21ms 39ms 0ms 4.5s
recipe (instructions) 5ms 7ms 8ms 11ms 0ms 3.0s
synthetic (title) 50ms 56ms 65ms 239ms 701ms 13.7s
synthetic (string inside object) 50ms 52ms 56ms 412ms 940ms 8.2s

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

@EsaNuurtamo EsaNuurtamo changed the title WIP: Cli/server side schemas Cli/server side schemas Feb 14, 2025
@EsaNuurtamo EsaNuurtamo requested a review from snorrees February 14, 2025 12:33
Copy link
Contributor

github-actions bot commented Feb 17, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.94% 54800 / 127616
🔵 Statements 42.94% 54800 / 127616
🔵 Functions 48.08% 2788 / 5798
🔵 Branches 79.44% 10616 / 13362
File CoverageNo changed files found.
Generated in workflow #30625 for commit 859744e by the Vitest Coverage Report Action

@EsaNuurtamo EsaNuurtamo changed the title Cli/server side schemas feat: cli server side schemas Feb 19, 2025
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