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): allow credentials when adding CORS entry #8191

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

RostiMelk
Copy link
Member

Description

Allowing credentials when adding CORS entry on remote template init. This is because some of the remote templates embeds a Studio, which requires your CORS entry to allow for credentials.

My initial idea was to somehow dynamically figure out if you need to allow for credentials, but given that we're only dealing with localhost entries here, I think it's fine to just hardcode it.

Testing

Run

sanity init --template sanity-io/sanity-template-nextjs-clean

Your project should have a CORS entry for localhost:3000 with credentials allowed

Notes for release

N/A

@RostiMelk RostiMelk requested a review from a team as a code owner January 6, 2025 11:51
@RostiMelk RostiMelk requested review from ryanbonial and removed request for a team January 6, 2025 11:51
Copy link

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

@RostiMelk RostiMelk requested a review from bjoerge January 6, 2025 11:52
Copy link
Contributor

github-actions bot commented Jan 6, 2025

No changes to documentation

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Component Testing Report Updated Jan 6, 2025 12:04 PM (UTC)

❌ Failed Tests (2) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 3s 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) 26s 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 40s 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 ❌ Failed (Inspect) 3m 3s 19 0 2
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 6, 2025

⚡️ Editor Performance Report

Updated Mon, 06 Jan 2025 12:05:14 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 28.6 efps (35ms) 27.8 efps (36ms) +1ms (+2.9%)
article (body) 51.7 efps (19ms) 53.1 efps (19ms) -0ms (-2.6%)
article (string inside object) 27.0 efps (37ms) 28.6 efps (35ms) -2ms (-5.4%)
article (string inside array) 25.0 efps (40ms) 25.0 efps (40ms) +0ms (-/-%)
recipe (name) 52.6 efps (19ms) 58.8 efps (17ms) -2ms (-10.5%)
recipe (description) 58.8 efps (17ms) 66.7 efps (15ms) -2ms (-11.8%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (6ms) +0ms (-/-%)
synthetic (title) 18.9 efps (53ms) 19.6 efps (51ms) -2ms (-3.8%)
synthetic (string inside object) 20.4 efps (49ms) 20.0 efps (50ms) +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) 35ms 39ms 84ms 200ms 321ms 10.8s
article (body) 19ms 22ms 34ms 265ms 361ms 5.7s
article (string inside object) 37ms 39ms 54ms 70ms 139ms 6.5s
article (string inside array) 40ms 42ms 48ms 159ms 142ms 6.7s
recipe (name) 19ms 21ms 22ms 42ms 0ms 8.1s
recipe (description) 17ms 19ms 21ms 36ms 0ms 4.4s
recipe (instructions) 6ms 7ms 10ms 22ms 0ms 3.1s
synthetic (title) 53ms 55ms 58ms 438ms 637ms 13.6s
synthetic (string inside object) 49ms 51ms 56ms 124ms 419ms 8.3s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 36ms 39ms 46ms 193ms 239ms 10.5s
article (body) 19ms 22ms 28ms 79ms 62ms 5.3s
article (string inside object) 35ms 37ms 42ms 158ms 133ms 6.2s
article (string inside array) 40ms 44ms 53ms 184ms 244ms 7.1s
recipe (name) 17ms 18ms 19ms 40ms 0ms 7.4s
recipe (description) 15ms 16ms 17ms 26ms 0ms 4.2s
recipe (instructions) 6ms 8ms 9ms 19ms 0ms 3.1s
synthetic (title) 51ms 54ms 61ms 149ms 567ms 13.0s
synthetic (string inside object) 50ms 51ms 66ms 494ms 961ms 8.8s

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

@RostiMelk RostiMelk added this pull request to the merge queue Jan 6, 2025
Merged via the queue into next with commit b57cb26 Jan 6, 2025
57 checks passed
@RostiMelk RostiMelk deleted the feat/cli/cors-entry-allow-credentials branch January 6, 2025 13:30
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