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): use @vercel/frameworks in bootstrapRemoteTemplate #8001

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

RostiMelk
Copy link
Member

@RostiMelk RostiMelk commented Dec 10, 2024

Description

  • detecting a framework per package, instead of just checking the root. This also fixes an issue with using Next.js in monorepos.
  • using @vercel/frameworks in bootstrapRemoteTemplate for detecting the framework.

Pretty much the same way it's implemented in initCommand.ts, just using a different path.

Testing

Run

sanity init --template vercel/next.js/examples/cms-sanity

See if the directory includes a .env.local file

Notes for release

N/A

@RostiMelk RostiMelk requested a review from a team as a code owner December 10, 2024 12:17
@RostiMelk RostiMelk requested review from RitaDias and removed request for a team December 10, 2024 12:17
Copy link

vercel bot commented Dec 10, 2024

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 Dec 10, 2024 1:34pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 1:34pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 1:34pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 1:34pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Dec 10, 2024 1:34pm

@@ -410,16 +410,6 @@ export async function validateRemoteTemplate(
}
}

export async function isNextJsTemplate(root: string): Promise<boolean> {
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed in favour of @vercel/frameworks

Copy link
Contributor

No changes to documentation

@bjoerge bjoerge requested review from bjoerge and removed request for RitaDias December 10, 2024 12:29
Copy link
Contributor

github-actions bot commented Dec 10, 2024

Component Testing Report Updated Dec 10, 2024 1:21 PM (UTC)

✅ All Tests Passed -- 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) 16s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 43s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 1m 1s 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) 1m 44s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 16s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 2m 50s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 51s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 15s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 43s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 0s 12 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 Dec 10, 2024

⚡️ Editor Performance Report

Updated Tue, 10 Dec 2024 13:17:57 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 24.7 efps (41ms) 24.4 efps (41ms) +1ms (+1.2%)
article (body) 72.5 efps (14ms) 77.5 efps (13ms) -1ms (-/-%)
article (string inside object) 28.6 efps (35ms) 25.0 efps (40ms) +5ms (+14.3%)
article (string inside array) 25.6 efps (39ms) 23.0 efps (44ms) +5ms (+11.5%)
recipe (name) 52.6 efps (19ms) 51.3 efps (20ms) +1ms (+2.6%)
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.8 efps (48ms) 19.6 efps (51ms) +3ms (+6.3%)
synthetic (string inside object) 20.0 efps (50ms) 18.5 efps (54ms) +4ms (+8.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) 41ms 44ms 47ms 160ms 167ms 10.5s
article (body) 14ms 16ms 27ms 145ms 183ms 4.9s
article (string inside object) 35ms 40ms 54ms 239ms 246ms 6.8s
article (string inside array) 39ms 40ms 44ms 188ms 261ms 7.1s
recipe (name) 19ms 21ms 26ms 54ms 8ms 6.9s
recipe (description) 17ms 18ms 20ms 35ms 0ms 4.5s
recipe (instructions) 5ms 6ms 7ms 10ms 0ms 3.0s
synthetic (title) 48ms 52ms 56ms 136ms 124ms 11.8s
synthetic (string inside object) 50ms 53ms 70ms 500ms 855ms 8.7s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 41ms 45ms 77ms 257ms 247ms 10.8s
article (body) 13ms 15ms 19ms 104ms 198ms 5.0s
article (string inside object) 40ms 42ms 50ms 199ms 149ms 6.8s
article (string inside array) 44ms 46ms 53ms 77ms 273ms 7.2s
recipe (name) 20ms 21ms 22ms 39ms 0ms 6.6s
recipe (description) 17ms 19ms 21ms 35ms 0ms 4.5s
recipe (instructions) 5ms 6ms 7ms 7ms 0ms 3.0s
synthetic (title) 51ms 55ms 61ms 102ms 176ms 13.0s
synthetic (string inside object) 54ms 60ms 104ms 490ms 908ms 8.6s

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

bjoerge
bjoerge previously approved these changes Dec 10, 2024
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.

Very nice - thank you @RostiMelk!

@bjoerge bjoerge added this pull request to the merge queue Dec 10, 2024
Merged via the queue into next with commit 60537c8 Dec 10, 2024
58 checks passed
@bjoerge bjoerge deleted the feat/cli/check-package-framework branch December 10, 2024 14:08
bjoerge added a commit that referenced this pull request Dec 12, 2024
* next: (49 commits)
  fix: delays rendering the Start in Create banner until document is ready (#8020)
  fix(deps): update dependency @sanity/ui to ^2.10.9 (#8009)
  chore(deps): dedupe pnpm-lock.yaml (#8023)
  test(playwright-ct): fix issues and flake (#8016)
  feat(cli): misc copy changes (#8003)
  feat(cli): remove is-builtin-module (#6579)
  v3.67.1
  chore(deps): bump minimum requirement of @sanity/import and @sanity/export (#8012)
  chore(deps): update dependency @sanity/pkg-utils to v6.12.0 (#8010)
  fix(core): tasks UpdatedTimeAgo should be a hook (#8011)
  v3.67.0
  chore(prettier): fix unformatted files 🤖 ✨ (#8006)
  chore: reduce renovate double PR noise
  fix(deps): update dependency @sanity/ui to ^2.10.7 (#8005)
  fix(deps): update dependency @sanity/ui to ^2.10.7 (#7998)
  feat(cli): use `@vercel/frameworks` in `bootstrapRemoteTemplate` (#8001)
  feat: switch create integration to opt-out flow (#8002)
  feat: use eslint 9 for new studios (#7978)
  fix(sanity): optimise getLeafWeights to not stack overflow (#7999)
  feat(test-studio): enable `groq2024` search strategy
  ...
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