refactor(cli): migrate from zod to zod/mini#847
Merged
Conversation
|
Claude finished @binoy14's task in 1m 23s —— View job ReviewNo issues found. The migration is correct:
|
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (fe45fbe) | vs v6.3.1 |
|---|---|---|---|
| Internal (raw) | 2.1 KB | - | - |
| Internal (gzip) | 799 B | - | - |
| Bundled (raw) | 10.95 MB | -120.3 KB, -1.1% | +9.01 MB, +464.9% |
| Bundled (gzip) | 2.06 MB | -20.4 KB, -1.0% | +1.58 MB, +331.9% |
| Import time | 841ms | -6ms, -0.8% | +26ms, +3.2% |
bin:sanity
| Metric | Value | vs main (fe45fbe) | vs v6.3.1 |
|---|---|---|---|
| Internal (raw) | 975 B | - | - |
| Internal (gzip) | 460 B | - | - |
| Bundled (raw) | 9.84 MB | - | +9.13 MB, +1287.6% |
| Bundled (gzip) | 1.77 MB | - | +1.60 MB, +940.8% |
| Import time | 1.99s | -3ms, -0.2% | +1.08s, +118.6% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (fe45fbe6) · v1.3.0 (npm)
| Metric | Value | vs main (fe45fbe) | vs v1.3.0 |
|---|---|---|---|
| Internal (raw) | 92.3 KB | +93 B, +0.1% | +93 B, +0.1% |
| Internal (gzip) | 21.6 KB | +28 B, +0.1% | +28 B, +0.1% |
| Bundled (raw) | 21.53 MB | -118.6 KB, -0.5% | +9.02 MB, +72.0% |
| Bundled (gzip) | 3.41 MB | -20.5 KB, -0.6% | +1.58 MB, +85.9% |
| Import time | 795ms | -5ms, -0.7% | +51ms, +6.9% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Contributor
Coverage Delta
Comparing 9 changed files against main @ Overall Coverage
|
Zod 4's zod/mini variant provides the same validation with ~10KB less bundle weight by dropping method chaining in favor of wrapper functions. Also adds an ESLint no-restricted-imports rule to prevent future imports from 'zod' instead of 'zod/mini'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4efe43b to
0d7584e
Compare
Contributor
Coverage Delta
Comparing 9 changed files against main @ Overall Coverage
|
mttdnt
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zodimports tozod/miniacross@sanity/cliand@sanity/cli-corefor ~10KB smaller bundle size.optional()method chaining toz.optional()wrapper,.email()toz.email(), andz.ZodErrortoz.core.$ZodErrorper the zod/mini APIno-restricted-importsESLint rule to prevent future imports fromzodinstead ofzod/miniTest plan
🤖 Generated with Claude Code