Conversation
|
Claude finished @jordanl17's task in 3m 12s —— View job Review
Issues1. JSDoc claim doesn't match runtime behavior — The comment says 2. PR description is stale relative to the second commit The PR body still says 3. Changeset summary is too long for repo convention — Recent changesets in this repo are one short sentence ( ---
'@sanity/cli': minor
---
`sanity dev` no longer forces `reactStrictMode: false` when unset; `renderStudio`'s default applies (off in Studio v5, on in Studio v6). Set `reactStrictMode` in `sanity.cli.ts` or `SANITY_STUDIO_REACT_STRICT_MODE` to override.4. The changeset only lists 5. Generated module emits literal The output now contains: renderStudio(document.getElementById("sanity"), studioConfig, {reactStrictMode: undefined, basePath: "/"})This works only as long as
Worth at least a comment in 6. No e2e/integration check that The unit tests verify Nits
|
📦 Bundle Stats —
|
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.97 MB | - |
| Bundled (gzip) | 2.06 MB | - |
| Import time | 837ms | +6ms, +0.7% |
bin:sanity
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 1023 B | - |
| Internal (gzip) | 486 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 1.94s | +3ms, +0.2% |
🗺️ 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 (7d2118d4)
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 96.3 KB | - |
| Internal (gzip) | 22.7 KB | - |
| Bundled (raw) | 21.64 MB | - |
| Bundled (gzip) | 3.43 MB | - |
| Import time | 786ms | -9ms, -1.1% |
🗺️ 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 — create-sanity
Compared against main (7d2118d4)
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| Import time | ❌ ChildProcess denied: node | - |
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.
Coverage Delta
Comparing 4 changed files against main @ Overall Coverage
|
|
Re: rollout coordination - this CLI default flip is intended to land together with the companion Studio V6 work in sanity-io/sanity#12916, which contains the component StrictMode-safety fixes (render-purity, telemetry one-shot, manifest upload cancellation, a subscription-leak fix). Both ship as part of Studio V6. If this CLI change were to ship before those fixes are in a published |
Description
Defers the
reactStrictModedefault forsanity devto thesanitypackage instead of having the CLI decide it.getDevServerConfigno longer forces a value whenreactStrictModeis unset, andgetEntryModuleemitsreactStrictMode: undefinedsorenderStudio's own destructuring default applies. That default is off in Studio v5 and on in Studio v6, so the on-by-default behavior now lives entirely insanity@6and reaches users only when they upgrade the Studio. Explicit config (reactStrictMode: falseortrue) and theSANITY_STUDIO_REACT_STRICT_MODEenv var still take precedence. Production builds (sanity build) are unaffected. Part of SAPP-3841.This reverses the earlier approach on this branch. Previously the CLI flipped the default itself (
cliConfig?.reactStrictMode ?? true), but becausesanity@5depends on@sanity/clivia^6.x, a minor CLI release would have leaked StrictMode-on to existingsanity@5users runningsanity dev. Making the CLI a pass-through keeps this change non-breaking for currentsanity@5users and confines the breaking default to thesanity@6major (sanity-io/sanity#12916), which also covers the component audit.What to review
getDevServerConfig.ts- drops the?? truefallback; the resolved value is nowboolean | undefined.getEntryModule.ts- emits the literalundefinedinstead of coercing withBoolean()whenreactStrictModeis unset, so the generated entry letsrenderStudio's default decide.DevServerOptions/RuntimeOptions-reactStrictModewidened toboolean | undefined(internal types, not part of the public export surface).sanity buildstill passes a literalfalse.Testing
Updated
getDevServerConfigtests: the unset case now resolves toundefined(deferring to the studio), with an added explicitreactStrictMode: trueconfig case; the env-var-true, env-var-false, and explicit-false cases are unchanged. Added a newgetEntryModuletest asserting the generated entry containsreactStrictMode: undefinedwhen unset (for both the config and no-config templates), concretetrue/falsewhen set, and never referencesreactStrictModefor the app entry. All pass; types and format clean.Note
Medium Risk
Changes default dev behavior when neither config nor env is set (now follows Studio major version), though explicit overrides remain; avoids turning StrictMode on for existing sanity@5 projects via a CLI-only default.
Overview
For
sanity dev, the CLI stops choosing a default forreactStrictModewhen it is omitted fromsanity.cli.tsandSANITY_STUDIO_REACT_STRICT_MODEis not set.getDevServerConfignow passes throughcliConfig?.reactStrictMode(includingundefined) instead of coercing withBoolean(), andgetEntryModulewrites the literalreactStrictMode: undefinedin the generated runtime entry instead offalse, sorenderStudioin the installedsanitypackage applies its own default (off on v5, on on v6).Explicit
reactStrictMode: true|falsein CLI config and the env var still resolve to concrete booleans. Internal types (DevServerOptions,RuntimeOptions,getEntryModule) acceptboolean | undefined.CliConfigJSDoc now documents default true for the option when documented at the config layer. New tests cover dev resolution and generated entry output; a changeset records the@sanity/climinor behavior note.Reviewed by Cursor Bugbot for commit 6bb3bed. Bugbot is set up for automated code reviews on this repo. Configure here.