npm @sanity/cli 3.65.0
v3.65.0

5 hours ago

✨ Highlights

React Compiler Beta

The sanity and @sanity/vision packages are now precompiled with the React Compiler.
So far, 1,231 out of 1,411 components have been compiled, resulting in a 20%-30% overall reduction in render time and latency. We anticipate even greater improvements as we refactor the remaining 180 components to support auto-memoization.

For several weeks, we’ve already been shipping key packages—including our design system (@sanity/ui), the PortableText editor (@portabletext/editor), and react-rx (responsible for state management across Sanity Studio)—precompiled with the React Compiler.

We continue to see impressive results in our profiling and analysis, and with the release of React Compiler in beta we are excited to add support for auto-memoizing your own studio code:

pnpm add react-compiler-runtime@beta && pnpm add --save-dev babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta
yarn add react-compiler-runtime@beta && yarn add --save-dev babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta
npm install --save-exact react-compiler-runtime@beta && npm install --save-exact --save-dev babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta

And in your sanity.cli.ts add:

import {defineCliConfig} from 'sanity/cli'

export default defineCliConfig({
   api: {
      projectId: 'abc123',
      dataset: 'production',
   },
   reactStrictMode: true,
+  reactCompiler: {target: '18'},
})

If you decide to give the React Compiler a try make sure you share your feedback and experience using it with the Working Group!

Sanity plugin authors, provided they're using @sanity/pkg-utils, can also ship pre-compiled plugins by running:

pnpm add react-compiler-runtime@beta && pnpm add --save-dev @sanity/pkg-utils@latest babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta
yarn add react-compiler-runtime@beta && yarn add --save-dev @sanity/pkg-utils@latest babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta
npm install --save-exact react-compiler-runtime@beta && npm install --save-exact --save-dev @sanity/pkg-utils@latest babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta

and changing the package.config.ts to:

import {defineConfig} from '@sanity/pkg-utils'

export default defineConfig({
   // ...
+  babel: {reactCompiler: true},
+  reactCompilerOptions: {target: '18'},
})

History UI updates

The history inspector UI has been updated to display edits collapsed into the Published event they belong to. From and To revision selectors are added to the top of the inspector.

history

Install or upgrade Sanity Studio

To initiate a new Sanity Studio project or upgrade an existing one, please refer to our comprehensive guide on Installing and Upgrading Sanity Studio.

If you are updating from a version earlier than 3.37.0, you should also check out this article to ensure your dependencies are up to date.

📓 Full changelog

Author Message Commit
Cody Olsen feat: add support for React Compiler beta (#7702) 8aace40
renovate[bot] chore(lockfile): update dependency react-focus-lock to v2.13.2 (#7848) e8c7e68
renovate[bot] chore(lockfile): update dependency @sanity/asset-utils to v2.2.0 (#7847) b7b0a84
renovate[bot] chore(deps): update dependency turbo to ^2.3.0 (#7846) c52a456
Espen Hovlandsdal chore(cli): temporarily disable telemetry tests (#7845) 9b5f565
Pedro Bonamin feat(structure): History UI updates (#7462) 16532a8
Pedro Bonamin fix(core): discard announcements dialog onClickOutside (#7863) 7888272
ecospark[bot] fix(deps): update React Compiler dependencies 🤖 ✨ (#7872) 6fbae0b
Cody Olsen chore(ci): max react compiler warnings are now 79 363235e
ecospark[bot] chore(deps): dedupe pnpm-lock.yaml (#7873) 1ebdc17
renovate[bot] fix(deps): update dependency react-rx to ^4.1.7 (#7874) 456187c
renovate[bot] fix(deps): update dependency @portabletext/editor to ^1.11.3 (#7865) a43bf85
Bjørge Næss fix(telemetry): log (well known) workspace and dataset names (#7859) b97d4aa
renovate[bot] fix(deps): update dependency @sanity/ui to ^2.8.25 (#7876) ecce434
renovate[bot] fix(deps): Update dev-non-major (#7875) 4baafb1
renovate[bot] fix(deps): update dependency @sanity/presentation to v1.18.5 (#7881) 00cc366
renovate[bot] fix(deps): update dependency @sanity/insert-menu to v1.0.13 (#7880) 71a5524

Don't miss a new cli release

NewReleases is sending notifications on new releases.