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

refactor: remove legacy exports #9036

Merged
merged 2 commits into from
Apr 1, 2025
Merged

refactor: remove legacy exports #9036

merged 2 commits into from
Apr 1, 2025

Conversation

stipsan
Copy link
Member

@stipsan stipsan commented Mar 24, 2025

Description

We've stopped using legacyExports in @sanity/ui a while back, and it's no longer a feature in @sanity/pkg-utils@7. It's time to remove it from sanity and related monorepo packages as well.
This reduces the way we ship code to npm from dual ESM + CJS + legacy ESM to just dual ESM + CJS.
Building legacy exports accounts for 33% of the total build time by @sanity/pkg-utils, which impacts how long it takes for the monorepo to run pnpm build, and every CLI task that needs pnpm build, which is all of the E2E test suites, as well as the eFPS suite.
All to support legacy Node.js runtimes, and test runners like older Jest versions, that doesn't support the package.json exports field.

What to review

It builds and makes sense.

Testing

If it builds it works.

Notes for release

Legacy ESM is no longer shipped to npm. Ensure you're on Node.js v18 or later, and if using Jest make sure you're on v28 or later.

Copy link

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

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Mar 24, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 43.31% 56330 / 130045
🔵 Statements 43.31% 56330 / 130045
🔵 Functions 47.25% 2787 / 5898
🔵 Branches 79.59% 10500 / 13191
File CoverageNo changed files found.
Generated in workflow #33081 for commit ba59097 by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Mar 24, 2025

📊 Playwright Test Report

Download Full E2E Report

This report contains test results, including videos of failing tests.

Copy link
Contributor

github-actions bot commented Mar 25, 2025

⚡️ Editor Performance Report

Updated Tue, 01 Apr 2025 12:58:17 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 24.4 efps (41ms) 23.3 efps (43ms) +2ms (+4.9%)
article (body) 59.2 efps (17ms) 59.3 efps (17ms) -0ms (-0.3%)
article (string inside object) 25.0 efps (40ms) 25.0 efps (40ms) +0ms (-/-%)
article (string inside array) 21.7 efps (46ms) 21.3 efps (47ms) +1ms (+2.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) 18.9 efps (53ms) 18.9 efps (53ms) +0ms (-/-%)
synthetic (string inside object) 20.0 efps (50ms) 17.7 efps (57ms) +7ms (+13.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 45ms 55ms 156ms 196ms 11.0s
article (body) 17ms 19ms 29ms 146ms 305ms 5.9s
article (string inside object) 40ms 42ms 53ms 279ms 397ms 7.7s
article (string inside array) 46ms 48ms 54ms 281ms 427ms 7.8s
recipe (name) 22ms 23ms 28ms 45ms 0ms 8.4s
recipe (description) 20ms 21ms 22ms 29ms 0ms 4.9s
recipe (instructions) 5ms 6ms 8ms 19ms 0ms 3.1s
synthetic (title) 53ms 57ms 67ms 423ms 1357ms 13.9s
synthetic (string inside object) 50ms 55ms 75ms 554ms 1135ms 9.2s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 43ms 45ms 55ms 281ms 377ms 11.8s
article (body) 17ms 21ms 27ms 256ms 359ms 6.0s
article (string inside object) 40ms 44ms 51ms 213ms 257ms 7.4s
article (string inside array) 47ms 51ms 57ms 108ms 330ms 7.7s
recipe (name) 22ms 24ms 25ms 42ms 0ms 8.5s
recipe (description) 20ms 21ms 23ms 51ms 0ms 4.9s
recipe (instructions) 6ms 7ms 9ms 21ms 0ms 3.2s
synthetic (title) 53ms 55ms 57ms 180ms 919ms 14.7s
synthetic (string inside object) 57ms 58ms 70ms 238ms 1049ms 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.

@stipsan stipsan marked this pull request as ready for review April 1, 2025 12:39
@stipsan stipsan requested review from a team as code owners April 1, 2025 12:39
@stipsan stipsan requested review from bjoerge and removed request for a team April 1, 2025 12:39
@stipsan stipsan enabled auto-merge (squash) April 1, 2025 12:39
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.

This is great!

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