🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup
Back to changelog

New init flags, virtualized arrays, improved configuration in Vite, and more

Installation and upgrading

To initiate a new Studio without installing the CLI globally:

npx create-sanity@latest

To upgrade an existing Studio (v3):

npm install sanity@latest

✨ Highlights

New init flags: --bare, --env

The npm create sanity and sanity init CLI commands now have two new flags available:

  • --bare - skips the installation of a Sanity Studio. Instead, it takes you through the project and dataset creation process and prints the project ID and dataset names to the console.
  • --env [path] - detects the framework used in the current directory and creates a .env file with the correct prefix for environment variables. The path is optional; the default value is .env, but you can change it to anything beginning with .env, for example, .env.local.example.

These flags are useful when you want to integrate an application with a new or existing project, when you have some existing Studio code you want to set up, or when you only need the Content Lake capabilities.

Improved performance on large arrays

Lists of objects and references are now virtualized in the Sanity Studio UI. This should significantly improve performance in documents with large arrays.

Improvements for custom Vite configuration

Any custom Vite configuration defined in sanity.cli.ts will now be merged with the default configuration using Vite’s merge logic. This improvement will make it easier customize the Vite configuration without having to deeply understand the defaults. The configuration now also has improved TypeScript types.

Other features

  • The schema validator now checks for fields that use the block type outside of an array, which is not currently supported (thanks @pauloborges!)

🐛 Notable bugfixes

  • Resolves an error that occurred when attempting to create a document of a certain type with an empty object as the initial value, resulting in a permission error
  • Addresses an issue where CSS files were not properly updated with a configured Studio base path
  • Fixes a bug that caused the Studio to crash when trying to fetch user data without proper permissions
  • Resolves a problem where multiple sorting options could be selected at the same time in a dropdown menu
  • Addresses an issue where long filenames/MIME types were not truncated in the file picker list
  • Resolves a bug that caused the Portable Text Editor to crash when encountering an invalid value.

Documentation affected by this release

Published April 18, 2023