๐Ÿ”ฎ Sanity Create is here. Writing is reinvented. Try now, no developer setup

API Changelog

2022-04-07

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Dry run mode for sanity graphql deploy

    You can now preview GraphQL deployments and check for breaking changes without deploying.

2023-09-15

  • Installation and upgrading

    Fresh install

    To install and initiate a new Sanity Studio without installing the Sanity CLI globally, run the following command in the terminal:

    npm create sanity@latest
    

    Upgrade

    To upgrade an existing instance to Sanity Studio v3, run the following commands in the terminal:

    # Go to the root folder of the installed Sanity Studio instance
    cd /sanity-studio/root-folder
    
    # Upgrade Studio to v3
    npm install sanity@latest
    

    โœจ Highlights

    ๐Ÿšข This release: 3.16.7

    In a nutshell:

    • Blocks only accept objects as members.
    • Easier navigation in Sanity Studio.
    • Import concurrency increase for faster dataset import.

    Improved validation of block members

    Previously, blocks also accepted non-object types as members. From this release, it's no longer possible to use primitive types as members of a block. Members of a block must be object-like type.

    Title updates in Desk Tool

    In this release, we improved the navigation inside the studio by updating the <title> element to make it more specific to the current route every time a user navigates in the studio. This makes it easier to browse documents and switch tools.

    Increased performance for dataset imports

    Past versions encountered challenges with concurrent operations during parallel reference strengthening. This issue was addressed in a past release. This release enhances import performance by further optimizing the parallel strengthening of references. The concurrency improvement boosts import performance significantly.

    Other features

    • Simplified managing reference publishing icons by adding aria-labels for accessibility.

    ๐Ÿ› Notable bugfixes

    • Fixes a visibility issue related to breadcrumbing in the review changes section. Breadcrumbs are now consistent with the new breadcrumb styling.
    • Fixes an issue where dialogs wouldn't correctly appear at smaller breakpoints.
    • Fixes a minor issue affecting restoring document history in the studio desk tool with multiple nested panes.
    • Fixes an issue in the studio desk tool using the index as a key instead of the path when handling multiple validation errors for the same field/node.

2023-10-31

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    This release adds support for styled-components v6. This is an optional upgrade as we'll continue to support v5 during the lifecycle of Sanity Studio v3.

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where pasting HTML lists into the Portable Text Input would disregard schema configuration for list blocks.
    • Fixes an issue where logos of custom auth providers were missing on login screen.
    • Fixes an issue where pasting from Google Docs to the Portable Text editor would apply bold formatting to the pasted content on Windows computers.
    • Fixes minor issue causing the annotation toolbar popover to not always display correctly. Fixes a bug where the Portable Text input would capture focus trying to edit an inline object's field named .text.
    • Fixes an issue where certain patches would apply differently in the studio and in Content Lake, leading to the studio UI not reflecting the new values for some fields.
    • Fixes an issue where certain remote patches would not cleanly apply in the studio, requiring a reload of the document to see the changes.
    • Fixes an issue where using >= or <= JSONMatch filters for patch operations would cause the studio to return error messages and not apply the patch correctly.
    • Fixes published and edits message in the document list.

2022-04-01

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes regression in the previous release regarding pasting of HTML into the Portable Text Editor.
    • Fixes a rare bug with pasting plain text into the Portable Text editor where it sometimes would error and deny the paste.

2022-08-24

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Improved search ๐Ÿ•ต๏ธ

    • Adds support for filtering search results by any number of document types. You can also browse documents from any number of types without entering a search query.
    • Search is now toggleable with a hotkey (Command/Control-K) and fully navigable by keyboard.
    • Recent searches (including selected document types) are stored for later use
    • Search terms and results are retained upon close: handy if you want to quickly revisit or amend your last search
    • Improves performance when rendering and scrolling through large result sets
    • The search dialog is wider, giving you more space for the search result listing

    NOTE: Documents listed in search results will no longer resolve custom components for block content and array views

2023-07-25

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Implements the 'document' creation context in the document.newDocumentOptions API
    • Fixes an issue where exported datasets with cross-dataset references could not be imported to different projects. Note that referenced datasets must exist within same project - otherwise use --skip-cross-dataset-references.
    • Removes warning about missing titles for schema types (titles are automatically created based on schema type name - a title is only necessary if the automatic name is incorrect/inaccurate)
    • Titles are now automatically applied to field groups and fieldsets, in the same way as with schema types
    • Improves error messages from configuration errors
    • Boolean inputs will now show validation errors at the input level
    • Fixes alignment/scrolling issues of references in delete/unpublish dialog
    • Fixes accessibility issues in tooltip text color contrast
    • Fixes various accessibility label issues in the desk tool
    • Fixes issue where focus would jump to first element when hovering divider in menu
    • Fixes an issue where the fallback editor had the title "Editor", instead of the name of the document being edited

2021-11-16

  • Portable Text Editor Input migrated to Sanity UI

    We have now migrated the Portable Text (PT) editor in the Sanity Studio to use Sanity UI. This marks the completion of the migration of the entire Studio to @sanity/ui.

    OLD! Portable Text Editor in v2.21.11
    NEW! Portable Text Editor in v2.22.0

    In addition to the migration:

    • Generally improved stability and performance of the PT editor.
    • Added a new affordance for editing/removing text annotations. This will make it easier to e.g. edit link details.
    • Fixed a bug where undo/redo history was not maintained in memory when collapsing/expanding the editor.

    Other features

    • Allows plan selection with sanity init --project-plan <plan>
    • Improves usability of ValidationError by making cloneWithMessage optional

2024-04-16

  • Installation and upgrading

    Install

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    Upgrade

    In most cases upgrading your studio is as straight-forward as installing the latest version:

    npm install sanity@latest

    For more information, visit the article on upgrading Sanity Studio in the docs.

    If you are upgrading from a version earlier than 3.37.0, you also need to upgrade styled-components and @sanity/ui. To learn more, visit this help article on keeping dependencies up to date.

    โœจ Highlights

    • Improved global search with better performance and new features.
    • Custom styles are now displayed in the Portable Text Editor (PTE) style selector.

    Enhanced Global Search

    We've optimized the search functionality in the Studio for increased performance, especially in workspaces with large schemas. This improvement includes support for wildcard (*) and negation (-) tokens in search queries, allowing for more flexible and powerful search options. This enhanced search feature uses an internal API that is not yet documented for public use.

    If you need to revert to the previous search behavior for any reason, you can disable the new search functionality by setting search.enableLegacySearch to true in your configuration.

    Other features

    • Fixes tooltip text for the publish button to correctly display "yesterday" without the "ago" suffix when appropriate.

    ๐Ÿ› Notable bugfixes

    • Fixes a crash in the image hotspot and cropping tool within Next.js embedded Studios.
    • Improves focus handling in PTE and the document pane.
    • Fixes an edge case where PTE threw exceptions after resizing the validation panel.
    • Fixes issue where annotations in PTE would incorrectly retain markup if all fields were null.
    • Resolves an issue where custom sort orders, or sort orders in lists that are not documentTypeLists, would send invalid requests to the persistent user settings backend.
    • Fixes regression that hid tool buttons when Sanity Studio was embedded in Next.js applications.
    • Fixes a bug where the caret was not visible on code-formatted text within the PTE when using the dark scheme.
    • Fixes an issue where the component for custom PTE styles was not being rendered in the style selector.
    • Fixes an issue where copying strikethrough text from a google doc would remove the strikethrough once pasted in the PTE.

2023-11-14

  • Installation and upgrading

    Fresh install

    To install and initiate a new Sanity Studio without installing the Sanity CLI globally, run the following command in the terminal:

    npm create sanity@latest
    

    Upgrade

    To upgrade an existing instance to Sanity Studio v3, run the following commands in the terminal:

    # Go to the root folder of the installed Sanity Studio instance
    cd /sanity-studio/root-folder
    
    # Upgrade Studio to v3
    npm install sanity@latest
    

    ๐Ÿšข This release: 3.19.3

    ๐Ÿ› Notable bugfixes

    • Makes field actions keyboard-accessible:
      • Enables pressing the Esc (Escape) key to discard a comment.
      • Fixes an issue where hovering over field actions (for example: Comments, AI Assist) when they're not visible would cause them to flicker.
    • Fixes an issue where nested Portable Editor input fieldsโ€”Portable Text input inside an object that is inside another Portable Text inputโ€”would occasionally behave unexpectedly.
    • When importing and exporting datasets with the import dataset and export dataset CLI commands, the output message includes information about the projectId and the dataset in question.

      Example:
    Output message of the import dataset CLI command
    Output message of the export dataset CLI command

2021-09-01

  • Previously, the @sanity/image-url library would return `null` if you passed an invalid source (such as an object without the expected properties, or an invalid image asset ID). From 1.0.0 and onwards, the library will throw when receiving an invalid source. This makes it more obvious when there is invalid data passed to it, as well as ensuring that the function always returns a string (which is a much requested feature for TypeScript users).

2023-08-02

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Various microcopy improvements
    • Adds isSlug() method to @sanity/types for type-safe asserting of a slug object
    • Fixes an issue where using multiple desk tools in the same studio would cause duplicate "review changes" actions and validation lists to appear. Thanks @andparsons!
    • userHasRole will now accept null as well as a user object, making it more convenient in certain situations where the user might not yet be accessible
    • Fixes issue with auto scrolling on collapsed fieldset
    • Fixes issue where array list would not display all items when wrapped in a custom element
    • Fixes issue where array list would not display when inside a popover


2021-11-02

  • Fixes a regression introduced in #2884 that caused the saving spinner to not appear while a change was still syncing

2022-03-03

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes a number of issues with the sanity upgrade command when using --tag and/or --range (#3176)
    • Fixes a bug in the Portable Text editor where selecting all the content and overwriting it by inserting text would cause an error

2022-03-30

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Select organization with the CLI

    Allow selecting an organization to attach new projects to during sanity init.

    Other features

    • Update image input height based on image size.
    • Adds support for @sanity/language-filter to fallback to a different language select implementation when the current one is not relevant. (thank you @LiamMartens)

    ๐Ÿ› Notable bugfixes

    • Improves how patches are sent to the server in the Portable Text editor, potentially fixing a very rare heisenbug where the latest change in the editor would not be persisted.
    • Fixes a regression in the Portable Text editor's custom paste handler support.
    • Fixes issues in the Portable Text editor when merging two paragraphs with text annotations in some circumstances.
    • Fixes an issue where the number input wasn't allowing for decimal numbers (when the input is active).
    • Fixes an issue with the changelog when filtering out entries without data to display.

2021-12-02

  • Fixes a bug that disabled all options in the global 'create document'-menu due to insufficient permissions.

2021-04-13

  • Bugfixes

    • Bring back the gatsbyImageData on image nodes
    • Set more specific peer dependencies and engines update

    Explore the diff

2021-08-25

  • A lot of you have been waiting for this for a while: A way to show and hide fields based on the value of some other field. The wait is over! In this release of the Sanity Studio the hidden field has been upgraded to take a callback function.

    export default {
     type: 'object',
     name: 'dropdownExample',
     fields: [
       {
         name: 'kind',
         type: 'string',
         options: {list: ['foo', 'bar', 'baz']},
       },
       {
         name: 'fooOptions',
         type: 'object',
         hidden: ({parent}) => !(parent?.kind === 'foo'),
         fields: [/* ... */],
       },
       {
         name: 'barOptions',
         type: 'number',
         hidden: ({parent}) => !(parent?.kind === 'bar'),
         fields: [/* ... */],
       },
     ],
    }
    Conditional Fields with dropdown

    Get more code examples and read more about the details in our docs.

2023-06-06

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Custom block, inlineBlock and annotation form components

    Adds support for block, inlineBlock and annotation form components. You can now write plugins or create workspace configuration that change how these types are rendered in the studio. (Documentation forthcoming)

    ๐Ÿ› Notable bugfixes

    • Fixes a regression that broke document-level readOnly
    • Fixes a bug that caused conditional field callbacks inside fieldsets to get passed a wrong parent value
    • Improves deep linking to the Portable Text Input for visual editing
    • Fixes an issue where @sanity/block-tools would remove whitespace from <pre> tags
    • Fixes an issue that could sometimes cause newly inserted array items to be immediately removed

2024-05-14

  • 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.

    โœจ Highlights

    Save Vision Query Results

    You can now conveniently save the results of your Sanity Vision queries as JSON or CSV files. Simply run your query and click on the new "save result as" buttons in the bottom right corner.

    Custom Components with Intent Handling in Structure Builder

    Custom components included in the Structure Builder (like S.component(MyCustomComponent)) can now handle intents. This is especially useful for routing to custom components from global search results or other links. You can achieve this by using the canHandleIntent parameter.

    S.listItem()
      .id('translate')
      .title('Translate Test')
      .child(S.component(TranslateExample).id('example')
        .canHandleIntent((intent, params, context) =>  {
          console.log(intent, params, context)
          return true
        }
      ))
    

    ๐Ÿ› Notable Bugfixes

    • Fixes an issue where Boolean inputs were not always clearly indicated as read-only and disabled.
    • Makes the search/filter in the document "Inspect" dialog case-insensitive.
    • Prevents inputs within the Portable Text Editor from calling element.onFocus() on any opened block or inline-object, thus avoiding unintended modal closures.
    • Prevents extra work on preview prepare functions, ensuring better performance.
    • Fixes miscellaneous bugs and performance issues with Portable Text Editor's block extras and highlight rendering. For example, pointer events are now correctly disabled to avoid unnecessary cursor changes or rendering thrashes.
    • Fixes an issue where the document history panel would appear to load indefinitely
  • 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.

    ๐Ÿ› Notable bugfixes

    • Resolves a Maximum update depth exceeded crash in Presentation Tool.

2023-03-08

  • โš ๏ธย THIS IS A MAINTENANCE RELEASE OF A PREVIOUS MAJOR VERSION OF SANITY

    We recommend updating to Sanity Studio v3 which provides exceptional flexibility and an unparalleled developer experience. The core packages for Sanity Studio v2 will only receive critical bug fixes until Dec 7th, 2023

    Please head over to the documentation for Sanity Studio v3 to learn more.

    You can find migration guides from Studio v2 here.

    Installation and upgrading

    Upgrade the v2 version of the Command Line Interface (CLI) with:

    npm install --global @sanity/cli@v2

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes issue where clicking a document reference while still loading would result in an invalid link and cause the studio to crash
    • Fixes an issue that might cause the studio to crash when trying to view history in a dataset copied with the --skip-history flag
  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • General search performance improvements on larger studios (containing thousands of fields)
    • Desk Structure is now able to auto-generate IDs from non-ascii source values (for instance cyrillic characters)
    • Allows fractional section of a number to have leading zeros (thanks @pauloborges!)
    • Fixes studio authentication when using a custom API hostname
    • Makes schemas in Shopify online storefront template compatible with GraphQL deployments
    • Fixes an issue of document type icons not showing up in array fields
    • Fixes a bug where opening a reference field dropdown would not trigger a defined filtering function
    • Restores functionality of the "Open in new tab" function for arrays of references
    • Fixes issue where clicking a document reference while still loading would result in an invalid link and cause the studio to crash
    • Fixes several issues that might occur when dealing with duplicate document IDs across workspaces
    • Fixes an issue that might cause the studio to crash when trying to view history in a dataset copied with the --skip-history flag

2022-08-29

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixed an issue where incorrect references to image and file assets would crash the studio and display invalid diffs

2022-04-26

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    First step of Get Started carousel

    As part of a general effort to improve our onboarding experience, this release updates the studio templates available in the CLI.

    These release notes also covers v.2.29.6

2021-03-29

  • Most changes in this version are improvements and bug fixes behind the scenes โ€“ however there are a few new APIs:

    New properties

    • Introduced the onItemSelect property ((index: number) => void) to the Menu component props, to make it possible to subscribe to which MenuButton is currently selected.
    • The MenuItem now takes the selected property (boolean) to indicate which item in a Menu should be selected by default.
    • The MenuButton component now takes the popover property (PopoverProps), which is an object containing properties for the Popover component (like arrow, preventOverflow, portal, and so on).
    • The Popover component now takes a matchReferenceWidth property (boolean) to render the popover with same width as the referred element.

2021-10-21

  • Fixes match operator bug

    Up until now, the matchย operator has not handled wildcards correctly in some specific situations.

    For example, name match "foo.*bar" would be equivalent to foo * bar, because . would be considered a word-splitting character, and so foo.*bar would never match the string foo.bar.

    While rare, this also turned out to affect some languages where we would split words incorrectly: "ๅ‰ตๅ‚ทใ‚ฑใ‚ข" match "ๅ‰ตๅ‚ทใ‚ฑใ‚ข*" would return false, but "ๅ‰ตๅ‚ทใ‚ฑใ‚ข" match "ๅ‰ตๅ‚ทใ‚ฑใ‚ข" would return true.

    We are now releasing the API version 20211021, which fixes this.

    In short, the new algorithm honours Unicode word segmentation rules and considers the wildcard character, *, to be a word character. This fixes the internal tokenization to be consistent.

    Correct Content-Type for /history and /export

    Previously the /export and /history endpoints was returning Content-Type: text/plain even though they were streaming JSON. After this version they return Content-Type: application/x-ndjson instead.

  • Fixes an issue that could cause an error saying โ€œThis document is of type X and cannot be edited as Y.โ€ when navigating between singleton documents

2021-05-13

  • The first version of next-sanity shipped with the picosanity client built-in. This caused some confusion for people who wants not only to pull data from their Sanity.io content lake, but also send patches and mutations via API routes. Since picosanity only supported fetching content, it had a smaller bundle size than the full SDK.

    This version replaces picosanity with the full client. You can use Next.js' tree shaking to keep the client out of the app bundle or install picosanity if you still prefer to use that.

2021-10-06

  • Fully migrated @sanity/default-layout to Sanity UI

    The navbar and all of its elements have been migrated with @sanity/ui. The migration fixes a long-standing issue with responsiveness of the navbar, especially when it comes to the tool menu.

    Fully migrated @sanity/desk-tool to Sanity UI

    The pane system has been rewritten from scratch, and the UI of Desk Tool is completely refactored to using @sanity/ui.

    Panes now support dynamic minimum and maximum widths, to provide a more responsive behavior.

    Other features:

    • Newly initialized studios will now include a .gitignore
    • Speed of dataset imports improved when assets already exists
    • sanity hook commands updated to be forwards-compatible with upcoming webhook changes

    Notable bugfixes:

    • fix(language-filter): fixes popover placement issue when language list is long (#2801)

2023-03-07

    • The set of origin IP addresses for webhook calls are now published in the documentation and always kept up-to-date. See more details on the documentation page here.
    • Webhook calls now include by default Sanity-specific headers with additional metadata useful for debugging. See more details on the documentation page here.
  • Document deletion mutations can now fully purge the history of a document, specially important for privacy and compliance requirements.

    See more information in the documentation page here.

2022-08-05

  • Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where desk tool document lists would sometimes fail to resolve a schema type for new documents when pane supports multiple types
    • Reduces amount of requests triggered by new reference indication
    • Fixes 404-errors being printed in developer console when checking references for unpublished documents


2023-05-26

  • 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.

    Bugfixes

    Disables the new search API introduced in v3.38.0 due to a few discovered issues. We'll re-enable it in a future release.

2022-09-14

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes styling of a columnar fieldsets
    • Fixes an issue where older versions of Safari might crash when opening a referenced document
    • Fixes an issue with the cursor disappearing when arrowing down to the bottom of a collapsed Portable Text Input field
    • Fixes a Safari issue where the Portable Text editor's selection is reset when returning from an object edit modal of an embedded Portable Text object
    • Improved read only mode for the Portable Text Input

2024-03-21

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes a bug that caused inputs to lose focus when their value changed

2023-02-08

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    A custom API hostname can now be configured for the studio through the apiHost configuration parameter. Note that the configured API host must behave the same as Sanity's API. This is mostly useful for enterprise customers with custom API CNAME enabled (get in touch if you are interested in this feature).

    ๐Ÿ› Notable bugfixes

    • Disables sorting of array items when readOnly is set
    • Updates design of the presence menu to make non-clickable users appear greyed out
    • Updates @sanity/schema module with a new named export โ€“ the default export is now deprecated and will give a warning when used
    • Fixes behaviour so that the editing pane will now scroll the relevant field into view when validation does not pass
    • Improves readability for tags array inputs in read-only mode
    • Enables fetching unresolved cross-dataset references through GraphQL API
  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    Notable changes

    • Added ability to mark project studio templates as typescript-only

2023-12-12

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes virtualization issue which caused array items to erroneously be hidden when navigating between groups inside a modal
    • Fixes Portable Text Editor in expanded mode not closing when switching tabs/views
    • Fixes date/datetime inputs and date search filters showing incorrect weekday in the calendar

2022-01-26

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where pasting into an empty Portable Text Editor would cause an error
    • Fixes race condition that caused a crash in the studio when arrays were used
  • Breaking changes:

    • The client will now fetch from the API CDN when a token and useCdn: true are passed together.
    • The client now only supports Node.js v12 and higher.
    • The deprecated merge patch operator was removed.
    • The deprecated document property on assets.upload was removed.
    • client.observable.fetch() returns a cold observable.
  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes a bug introduced in v2.25.1 where inserting object blocks in the Portable Text Editor would cause an error
  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes some permission issues where users weren't able to edit documents when they should be
    • Fixes a bug where placeholder text in an empty Portable Text Editor would be stuck for a split second when it should not be
    • Fixes a bug where splitting lines in the Portable Text Editor including an inline object would corrupt the inline object data
    • Fixes an issue in Vision where controls and result were cut off in smaller viewports
  • Adds filtering by name, email and roles in project members list

2023-06-27

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    • New Document inspector @betaย API
    • Document validation now opens in a sidepanel

    ๐Ÿ› Notable bugfixes

    • Improves behavior of popovers in the Portable Text editor
    • sanity debug now outputs all the roles of the currently authenticated user

2022-05-31

  • Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes hovering issue in array input with portable text block
    • Fixes issue where selected list ordering in desk structure would not be respected
    • Fixes issue where document list appeared to be loading forever when changing the ordering
    • Fixes issue where the the code input file name field would disappear when the language option was set
    • Improves error message when copying a dataset and the target dataset already exists, but a copy operation is already in progress

2024-03-28

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where clicking "Publish" and possible other actions would throw the error Sanity LocaleContext value missing.
    • Fixes an issue in which users' names were sometimes displayed in lowercase in the tasks assignee list.

2022-03-13

  • Added a new point of presence for our APICDN in Mumbai, India.

2023-06-14

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes a issue where documents wasn't locked while a document was being synced
    • Fixes a bug where certain references would result in invalid GraphQL union types (thanks @james2doyle!)

2024-01-30

  • Installation and upgrading

    To initiate a new Sanity Studio without installing the CLI globally:

    npm create sanity@latest
    

    To upgrade a Sanity Studio, run this command in its folder:

    npm install sanity@latest
    

    โœจ Highlights

    New CLI command sanity migration create|list|run

    You can now create, list, and run content migrations from the Sanity CLI. The new tooling lets you scaffold content migrations as code and run them in dry and production mode. It also introduces a new API for defining content migration with helper functions (defineMigration()).

    You can explore the documentation for schema and content migrations; or learn more by running the following CLI commands in a Sanity Studio project folder:

    sanity migration --help
    

    You can run sanity migration create to explore our new content migration templates.

    New CLI command: sanity schema validate

    You can now validate a Sanity Studio schema with the CLI command sanity schema validate. Among other things, it will identify problems with your schema-type definitions. This tooling can be useful for running in CI/CD pipelines or debugging your schema configuration.

    Learn more by running:

    sanity schema validate ---help
    

    Other features

    • Adds Studio UI localization support to the comments plugin
    • Adds support for validating dataset import and export files with sanity documents validate
    • Adds intentUrl in json and ndjson formats for sanity documents validate

2023-12-07

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where studio would crash when embedded inside a vite app

2022-01-04

  • Changes to sanity upgrade

    sanity upgrade now behaves slightly different:

    • It now respects the version ranges and pinned versions declared in your package.json
    • Tries not to upgrade non-studio modules such as @sanity/block-content-to-html
    • Shows a more prominent message if there are major updates available with a link to the changelog

    Bugfixes

    • Fixes an issue that caused a crash instead of a warning screen when omitting schemaType from S.documentList() (#3022)
    • Fixes an issue that caused singleton documents to never load if no schemaType was provided (#3043)

2021-03-25

  • New features:

    • Optimize *[a[].b match "foo"]
    • Optimize nested paths (e.g. *[foo[].bar[].baz match "bar"]). This also makes them possible to use inside score().

    Bug fixes:

    • Fix *[foo == null] when foo refers to an empty object
    • Fix some edge case bugs related to negation.
  • Content Lake is a full refactor of Sanity's backend and query engine. You can start using it by upgrading and specifying an API version for your client. Content Lake follows the GROQ specification and introduces both bug fixes and new features.

    We have updated the documentation to reflect the newest version. This changelog contains the breaking changes and migration paths you need to take. You can take your time and stay on v1 for as long as you need, while you test and compare your queries against the new version. You can also specify the API version for only new queries to gradually move over. Let us know in the community if you have questions or need help.

    Breaking changes from v1 to v2021-03-25

    Correct parent operator behavior (^)

    The GROQ ^ operator now works correctly in all scopes.

    This fixes the known issue where the ^ operator only worked in subqueries. In all other scopes, it returned the root of the current scope, instead of the parent scope.

    *[_type=="person"]{
      name,
      someObj{
        name,
        // Old Behavior: "parentName" returns someObj.name
        // New Behavior: "parentName" returns root name value
        "parentName": ^.name
      }
    }

    Consistent handling of true/false/null for equality/comparisons operators

    GROQ now uses three-valued logic consistently:

    • >, >=, <, <= returns null when the operands are of different types.
    • &&, || handles null "as expected": null && true โ‡’ null and null || true โ‡’ true.

    Note that == has changed slightly:

    • It now always return either true or false (never null).
    • You can compare against null and get the expected result: 123 == null โ‡’ false and null == null โ‡’ true.
    • Comparisons between other types than strings/booleans/numbers always return false.

    This also means that in works with null: null in foo will return true if foo is [null, 1, 2].

    in null always returns null.

    Consistent array traversal

    We have cleaned up the behavior for array traversal. For example, queries that contained multiple array traversals that don't work in v1, now work as expected in v2021-03-25 and onward.

    *["link" in body[].markDefs[]._type]
    // v1: No results
    // v2021-03-25: An array of documents that has a link annotation in their "body" field
    
    // Data:
    [
      {
        "_type": "book",
        "authors": [
          { "names": ["MH", "Holm"] },
          { "names": ["Bob"] },
        ]
      }
    ]
    
    // Query:
    *[_type == "book"].authors[].names
    
    // v1:
    [null]
    
    // v2021-03-25:
    [
      [
        "MH",
        "Holm",
      ],
      [
        "Bob"
      ]
    ]
    
    // You can also add an additional `[]` to flatten it completely:
    
    // Query:
    *[_type == "book"].authors[].names[]
    
    // v2021-03-25:
    [
      "MH",
      "Holm",
      "Bob"
    ]

    Null values are not removed in projections

    If you have stored null values in your documents, these are no longer removed in projections.

    Override attributes while spreading objects and arrays (...)

    You can now override attributes while using the spread operator (...).

    // Data
    [{"title": "A", "customTitle": "B", "_type": "post"}]
    
    // Query:
    *[_type == "post"]{..., "title": customTitle}
    
    // Output from v1: 
    [{"title": "A"}]
    
    // Output from v2021-03-25:
    [{"title": "B"}]

    All numbers are float64

    All numbers are now 64-bit floats. Previously we used 64-bit integer representation in certain contexts.

    String ordering is more consistent

    Previously ordering by strings would in some context use a "smart" numeric ordering instead of proper string comparison:

    // Query:
    ["foo4", "foo12"]|order(@)
    
    // v1:
    ["foo4", "foo12"]
    
    // v2021-03-25:
    ["foo12", "foo4"]
    
    // However, *|order(foo) has always (both before and after) used proper string comparison.

    Deprecated: The is prefix operator

    The is operator has been deprecated. You can use the equivalent comparison instead:

    // v1:
    *[_type is "post"]
    
    // v2021-03-25:
    *[_type == "post"]

    Deprecated: Function calls without parentheses

    Previously you could call functions without parentheses: *[length "foo" > 3]. This is now no longer possible and is a syntax error. You should use *[length(foo) > 3] instead.

    Deprecated: $now and $identity

    You can use now() and identity() instead.

    Projections only work on objects, and returns null otherwise

    Whenever you apply the projection operator ({}) on a non-object then it returns null instead of executing the object expression.

    This means that the following query *[foo == bar][0]{a} now correctly returns null if there were no results. Previously this returned {}.

    Negative indexes are respected in slicing

    Previously negative indexes were not respected: [_type == "article"][-1]ย was equivalent toย [_type == "article"][1]. This has now been fixed and -1 returns the last document.

    Creating an empty attribute is now an error

    The following query now fails: *[_type == "bar" && @[""] == "bar"] since empty attribute keys are not allowed.

    order() only works on arrays, and returns null otherwise

    Passing | order(โ€ฆ) on non-arrays return a null value instead of converting it to an array.

    defined()

    defined(x) is now only false when x is null. Previously it was false for empty arrays and objects as well.

    Pipe operator works in fewer situations

    The pipe operator (|) used to work between nearly all access operators, filters, and slices (e.g., * | [filter], * | (foo), * | [2..4], and * | [2] were all permitted). The pipe operator remains required before the score() and order() pipe functions, and is optional before a projection, but using one before a filter or traversal syntax will throw an error.

    New features for GROQ

    Namespaces

    Namespaces allow for a stronger grouping of functionality within the GROQ specification. They create dedicated spaces for global functions, as well as safer distinctions for specific implementations of GROQ. Learn more.

    New functions: score() and boost()

    The score() function computes a _score for each document from how well the expression matches the document. The documents will also be sorted by score (from high to low) if no other order() function is specified. Note that all documents will be scored (even those that don't match it at all) so you typically want to add a limit. Read more about scoring and boosting.

    Portable Text to plain-text: pt::text()

    The pt::text() function takes either a Portable Text block or an array of blocks and returns a string in which blocks are appended with a double newline character (\n\n). Text spans within a block are appended without space or newline. Read more about getting plain text from Portable Text.

    New functions for geospatial queries

    The geo namespace contains a number of useful functions for creating and querying against locations in your data. Query for distance, intersections, and more.

    Performance improvements

    Ordering and filtering on date times

    It's now possible to filter and order efficiently on date times:

    // Filter
    *[_type == "post" && dateTime(publishedAt) > dateTime("2021-01-01T12:00:00")]
    
    // Order
    *[_type == "post"]|order(dateTime(publishedAt) desc)

    Projections on huge documents

    If you have huge documents, but your queries have projections that filter away most of the data (e.g., *[_type == "post"]{title, description}) you may see performance improvements.

    Expressions with mixed && and ||

    Expressions that use both && and || will now often be much faster (depending on how complicated they are).

    *[
      _type == "post" &&
      slug == "hello" &&
      ("news" in tags || products[0].name == "Sanity")
    ]
    
    // v1: Slow!
    // v2021-03-25: Much faster!
  • The following bugfixes has been put into production:

    • Make listeners work in v2021-03-25
    • Fix bug where it was possible to change the _id of a document.
    • Fix bug which prevented datasets to be deleted
  • This release fixes smaller bugs for GROQ v2021-03-25.

    • Fixes a bug where dereferencing inside sliced arrays (e.g. *[_type == "book"]{"authors": authors[0...2]{era->}}) would return incorrect result.
    • Fixes a bug where scoping was incorrect while dereferencing arrays: *[_type == "book"]{"authors": authors[]->{..., "bookName": ^.name}}
    • select now produces a query error when given invalid arguments. Examples of invalid arguments are select(title, title2) (multiple fallback values) and select(title, isGood => title2) (alternatives after the fallback)
  • This release targeting v2021-03-25 and v2021-10-21 of the Content Lake brings several new function namespaces to GROQ, as well as introduces the first formalized version of the GROQ language specification.

    New GROQ functions

    There are three new namespaces for functions added to the specification, which have been implemented across all GROQ tooling. These are:

    array::ย functions: Perform array operations on lists, such as removing all null values, building text strings from a list of names, or generating a list of all unique document _types.

    • array::compact(<array>) - removes all null values from an array
    • array::join(<array>, <token>) - concatenates all array elements into one string, separated by a specified token.
    • array::unique(<array>) - removes duplicate values from an array (this works for values that can be compared for equality, specifically numbers, strings, booleans, and null, and will not work for values that are arrays or objects)

    math::ย functions: Run common mathematical operators on numeric values. For example, you can add the prices across multiple products or return the maximum discount available within a cart of products.

    • math::avg(<array-of-numbers>) - calculates the average value (arithmetic mean) of an array of numbers.
    • math::max(<array-of-numbers>) - returns the largest numeric value of an array of numbers.
    • math::min(<array-of-numbers>) - returns the smallest numeric value of an array of numbers.
    • math::sum(<array-of-numbers>) - calculates the sum of an array of numbers.

    string::ย functions: Manipulate text or validate that information matches a given prefix. For example, get a list of the articles that start with โ€œHow toโ€ or split a comma-separated string of author names into an array.

    • string::split(<string>, <delimiter-token>) - turns a string into an array of substrings based on a delimiting token.
    • string::startsWith(<string>, <string-pattern>) - checks if a prefix string exactly matches the start of another string.

    To learn all about the new GROQ functions, read the developer update accompanying this release, and visit our documentation.

    GROQ1.revision1

    With this release, we are also pleased to announce the formal language specification of GROQ, as well as a new versioning scheme. Taking inspiration from other well-known language specs, like HTML and SQL, we settled on the following format:

    GROQ-<major version #>.revision<#>

    The current version of the specification is GROQ-1.revision1. This version does not include any breaking changes. To learn more about the history and future of the GROQ language, read the blog post from Co-founder and CTO Simen Svale Skogsrud: Content is Queryable: (Re)Introducing GROQ.

  • We've identified and fixed a bug where a GROQ OR-filter inside a subquery would some times return too many results.

2021-10-08

    • Fixes UX issues with collapsing and expanding panes in the Desk Tool.
    • Adds support for scrolling in the date pickerโ€˜s popover, when itโ€™s not able to show all the contents at once.

2022-10-12

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an issue causing content to be inserted twice when using custom paste handler

2022-11-15

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an edge case where a cross dataset reference to a deleted document would prevent you from changing the referring document

2022-08-04

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Notable changes

    • A document that has references to it will now clearly indicate this with a differently colored header/footer, as well as with a link symbol. Additionally, prior to publishing a referenced document, a confirmation dialog will indicate that the change might affect referencing documents
    • Added support for the presence feature when not using cookies for authentication
    • Dependencies upgraded for the Portable Text Editor, fixing issues where Chrome would be reported as missing beforeInput- support after Chrome went above version 100. This broke spellchecking in Chrome and degraded performance
    • Updated UI of dashboard feeds

    ๐Ÿ› Notable bugfixes

    • Fixes rare occurring bug in the Portable Text Editor where it would stop producing patches due to non-updated instance props
    • Fixes issue where the newest get-started templates did not include a gitignore file
    • Fixes a potential error when trying to access a file that does not exist
    • Fixes issue where field validation tooltips would sometimes be cut off when inside of modals
    • Fixes an issue where exporting certain old assets would fail because of an md5 mismatch
    • Fixes an issue where the unpublish dialog would use the term "delete" instead of "unpublish" in the confirm dialog
    • Fixes a few warnings from being printed when navigating the dashboard
    • Fixes an issue where documents with a large amount of references would sometimes fail to be published because of a failing request
    • Fixes an issue where a stray margins property would be passed to a div-element (thanks @KittyGiraudel!)
    • Fixes a few typos in the pets project template (thanks @nick-krantz!)Upgrade the Command Line Interface (CLI) with:

2021-10-14

    • Fixes an issue that caused the GraphQL schema deployment to either be slow or hang on schemas with many references
    • Fixes an error where the image and file inputs might throw an error about unsetting deep values on a primitive value
    • Fixes glitches in logo animation when the studio is loading
    • Fixes an issue where the desk tool would in certain cases give an error message saying Unknown document type *
    • Fixes an issue where document list items inside of non-document lists would be rendered with โ€œUntitledโ€ as the title, instead of the full document preview
    • Fixes an issue where the schema error summary would not be displayed because the studio would crash before being able to display it
    • Fixes a regression that caused the withDocument higher-order component to get stuck on an initial null value
    • Fixes an error where the client would fail to set up a listener when sending huge queries, without giving a developer-friendly error message

2024-04-03

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue in the Portable Text editor in which annotations were not opening (bug introduced in v3.36.3)
    • Fixes a potential cross-origin error from being shown in the developer console

2023-01-11

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจHighlights

    RxJS upgraded to v7

    This is an internal change, but if you have RxJS as a dependency in your Studio project you should make sure to upgrade to v7 of RxJS in your package.json. Otherwise you may get build errors due to changes in the Observable interface between v6 and v7 (note: this is a type change only, and should not affect the runtime behavior of your studio).

    If you get a build error saying something similar to:

    TS2322: Type 'Observable<โ€ฆ>' is not assignable to type 'ObservableInput<any>'. Type 'Observable<โ€ฆ>' is not assignable to type 'Observable<any>'. The types of 'source.operator.call' are incompatible between these types. โ€ฆ

    Then the solution is to upgrade the version of RxJS used in your project or library to 7.x. See the full list of breaking changes in RxJS 7

    Vite upgraded to v4

    This is an internal change, but theoretically there might be small changes to how assets are handled between v3 and v4. If you're using custom Vite plugins or you are loading CSS or other files, please make sure they still work after the upgrade.

    Notable changes

    • Reintroduces some flags for sanity graphql deploy. Note that flags will apply to all configured GraphQL APIs.

    ๐Ÿ› Notable bugfixes

    • Fixes issue with useFormValue hook lagging one iteration behind
    • Fixes issue where the uploaded images menu was inaccessible
    • Fixes some incorrect typings in defineField() when using Rule.valueOfField() - thanks @fritz-c
    • Adds schema validation error when defining already defined field names for image and file types
    • Supports Node ESM (>=14)
  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    RxJS upgraded to v7

    This is an internal change, but if you have RxJS as a dependency in your Studio project you should make sure to upgrade to v7 of RxJS in your package.json. Otherwise you may get build errors due to changes in the Observable interface between v6 and v7 (note: this is a type change only, and should not affect the runtime behavior of your studio).

    If you get a build error saying something similar to:

    TS2322: Type 'Observable<โ€ฆ>' is not assignable to type 'ObservableInput<any>'. 
      Type 'Observable<โ€ฆ>' is not assignable to type 'Observable<any>'. 
      The types of 'source.operator.call' are incompatible between these types. 
    โ€ฆ

    Then the solution is to upgrade the version of RxJS used in your project or library to 7.x. See the full list of breaking changes in RxJS 7

    Vite upgraded to v4

    This is an internal change, but theoretically there might be small changes to how assets are handled between v3 and v4. If you're using custom Vite plugins or you are loading CSS or other files, please make sure they still work after the upgrade.

    Notable changes

    • Reintroduces some flags for sanity graphql deploy. Note that flags will apply to all configured GraphQL APIs.

    Notable bugfixes

    • Fixes issue with useFormValue hook lagging one iteration behind
    • Fixes issue where the uploaded images menu was inaccessible
    • Fixes some incorrect typings in defineField() when using Rule.valueOfField() - thanks @fritz-c
    • Adds schema validation error when defining already defined field names for image and file types
    • Supports Node ESM (>=14)

2022-08-15

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Improved the UX of the new reference indicator in document pane.

2020-12-07

  • Breaking changes between gen2 and gen3

    The third generation of the GraphQL API adds support for querying all documents through the new allDocument type. However, with a new generation comes breaking changes.

    We had to rename a type to avoid conflicts. DocumentFilter has been renamed to Sanity_DocumentFilter. In other words, if you for example have a query like this:

    query GetAllUser($docFilter: Sanity_DocumentFilter) {
      allUser(_: $docFilter) {
        _id
      }
    }
    

    It should now look like this in gen3:

    query GetAllUser($docFilter: DocumentFilter) {
      allUser(_: $docFilter) {
        _id
        
      }
    }

2023-03-01

  • Installation and upgrading Comment

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the accept option for file and image schema types would not be respected by the image and file picker, only new uploads
    • Fixes dialog closing behavior in the studio to be more consistent
    • Improves readability of date and datetime diffs in the review changes panel
    • Fixes an issue where the first focusable element in a document was not focused when opening the document
    • Fixes an issue where form dialogs were not closing as esxpected when navigating to a new document
    • Fixes an issue where the selected sort option in the document list was not highlighted in the UI
    • Fixes an issue where the correct default fieldgroup was not set in an array of objects
    • Fixes an issue where opening a browser from the CLI tool on Windows might cause the login process to crash
    • Adds missing options in mobile sidebar menu
    • Fixes a regression from v3.4.0 in the Portable Text Editor that could corrupt text when typing fast and toggling text decorators (I.e. bold or italic) while typing
    • Fixes a regression from v3.4.0 in the Portable Text Editor where it sometimes would error when toggling between different versions in the History View

2021-12-08

  • References in place

    Users can now create a reference to a draft within the context of the referring document. This allows for a smoother workflow where having to leave the document you are working on in order to create and publish the document you wish to refer to is no longer necessary,
    This new behavior of the reference input can be disabled by setting the property disableNew: true.

    More:

    Conditional readOnly fields and fieldsets

    The ability to define if a field is editable based on conditions defined in a schema.

    Info-level validation

    In addition to being able to provide validation errors, developers can also provide guidance with โ„น๏ธ -symbols to give in-line help to editors.

    New modal options in Portable Text editor

    The Portable Text editor now supports a new modal option with a type and width property. This means you can customize the size of annotation popovers (a much requested feature).

      type: 'block',
      marks: {
        annotations: [
          {
            type: 'object',
            name: 'link',
            title: 'Link',
            options: {
              // ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
              modal: {
                type: 'popover',
                width: 'medium' // the default is "small"
              },
              // ๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†
            },
          },
        ],
      },
      // ...
    • Fixes a case where the sanity graphql deploy command would not exit after a successful deploy.
    • Fixes a bug where importing the @sanity/eventsource module in non-browser, non-node.js environments could potentially crash because of a window reference.

2021-12-14

    • Fixes an issue where previews of a reference to a document with a field named 'title' did not display correctly
    • Fixes a visual error where popover dialogs were appearing beneath other panes
    • Fixes an issue where 'create' intents set in custom structures would not appear in pane headers
    • Fixes sanity dataset import when targeting an ndjson file with relative file URLs
    • Fixes a bug preventing sanity logout from working in the case of expired sessions
    • Fixes a bug where the CLI would not be able to log a user in if an existing invalid/expired session was present

    Other features

    • Added support for HTTP proxies when using dataset import/export commands
    • Validation menu button now reflects the highest level of validation

2023-03-28

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    Improved global create menu

    The global create menu has been updated with alphabetically sorted options and a search field, providing a more convenient way to find a desired document. The menu has also been redesigned to appear in a popover instead of a full screen dialog for improved UX and less context switching.

    ๐Ÿ› Notable bugfixes

    • Fixes a recent regression in the Portable Text Editor where pasting content into an empty editor would cause an error
    • Fixes content overflow bug for query results in Vision and adds scroll bars to the result pane
    • Fixes issue where focus was not being returned to the editor after changing the style of a Portable Text block
    • Improves performance and issues related to validation in the Portable Text Editor

2022-02-22

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    • Adds keyboard arrow navigation in the Portable Text Editor toolbar (#3126)

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where spellchecking in the Portable Text Editor would not be enabled when omitted in schema options. (#3146)
    • Fixes a bug where Portable Text block values without a defined style property would throw an error when editing that block. (#3161)
    • Improves the performance of the reference search. (#3159)

2022-10-28

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an issue with documents not loading when rxjs version 7 is installed as a dependency

2022-12-07

  • This is the release of the stable, production-ready version the new major version (v3) of Sanity Studio. It deprecates Studio v2 and earlier versions. Studio v3 brings new features for content creators and developers, as well as a completely rewritten studio customization framework.

    High-level improvements

    • The Parts system is deprecated and replaced with a new studio customization framework
    • Custom webpack tooling is replaced with Vite
    • Sanity Studio now ships as a single npm dependency (sanity) with JavaScript-based configuration (sanity.config.js|ts / sanity.cli.js|ts)
    • The Studio module also has full ECMAScript Modules (ESM) support and CommonJS fallback and can be run in all modern browsers without bundling and embedded in any web project
    • Full TypeScript coverage with annotated APIs (@internal, @beta, @public), new helper functions (defineType,defineField), and emerging inline documentation with TS Doc
    • Better abstractions for wrapping and composing Studio and Form Components with renderDefault(props)ย and other convenience functions.
    • New Plugins API with plugin development tooling (plugin-kit) that makes it easier to build, maintain, and publish plugins on npm
    • New Studio v3 templates that let you get up and running with best practices

    Learn more about Studio v3

2021-11-17

  • Fixes an issue where some custom styles implementations for the Portable Text Editor caused an error.

2024-03-20

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Increases width of all inline popovers in the Portable Text Editor
    • Fixes an issue where incorrect studio version was shown in the help menu
    • Fixes an issue where incorrect loading message shown while a pane is resolving in the structure tool

2021-09-13

  • styled-component as a first-level dependency

    We've been hard at work migrating the internals of Sanity Studio from CSS modules Sanity UI, which is based on styled-components.

    Over the past releases, we've seen a few reported issues where multiple versions of the styled-components dependency could end up in the same studio, causing issues that were hard to understand (sanity is undefined) and would require a full dependency tree reinstall to resolve (rm -rf node_modules && sanity install).

    In this version, we're introducing styled-components as a first-level dependency in the studio, in the same way that react and react-dom is.

    The first time you run sanity start, sanity build or sanity upgrade after the upgrade, you will be asked to install the dependency - and in non-interactive it will install automatically.

    This migration should be seamless for most studios. We anticipate that in certain cases (custom monorepo setups, for instance) it might require manual changes, like adding styled-components as a dependency of the studio.

    For a more in-depth look at the rationale behind this change, see the pull request for this change.

    Specify API version for CLI query command

    The sanity documents query CLI command now has a new flag: --api-version.

    This is useful for testing how queries behave in different API versions. For now, the command will still use v1 as the default.

    Notable bugfixes

    • Fixes a rare case where an error could be thrown during the React render lifecycle without being an Error instance, which would crash the error boundary


  • Login screens are refactored to use Sanity UI.

2023-11-02

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    Notable changes

    • Adds v2022-03-08 to list of predefined API versions in the Vision plugin
    • Hotkeys are now displayed using platform-aware keys (eg Opt instead of Alt on Mac)

    Notable bugfixes

    • Fixes an issue where references would not open in-place, instead yielding an error about being changed after opening

2024-02-13

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the alert messages for published or deleted documents sometimes displayed incorrect titles
    • Fixes a comments-related error dialog from inadvertently showing up to users
    • Removes layout shift when loading document locations when the Presentation tool is used (#5702)
    • Fixes a bug that hid unpublished documents in "Documents on this page" in the Presentation tool (#5702)
    • Fixes a bug that caused the document pane to stay open in the Presentation tool (#5702)

    Other features

    • Adds support for importing system documents via --allow-system-documents for dataset imports
    • Adds support for parameterized templates in the Presentation tool (#5694)
  • โœจ Highlights

    Sanity AI Assist 2.0 comes with new features and breaking changes that bring consistency to the plugin's configuration.

    Paid feature

    This article is about a feature currently available for all projects on the Growth plan and up.

    To upgrade to the latest version of AI Assist:

    npm i sanity@latest @sanity/assist@latest

    Content translation

    Sanity AI Assist can now translate localized content with a simple action. Built to support the localization models used by the Document Internationalization and Internationalized Array plugins.

    Image generation

    You can now instruct AI Assist to generate images for image fields. It also supports a two-step process where you instruct AI Assist to generate an instruction for image generation for better results.

    Image description support

    AI Assist can now add image descriptions to an image field. This is useful for generating alternative text and image captions. AI Assist will automatically run when an image is uploaded and replaced.

    Reference field support

    AI Assist can now work with reference fields to pull in content that's described in an instruction. Requires setting up an Embeddings Index for documents you wish to refer to.

    Other improvements

    • You can now explicitly filter what fields an instruction is allowed to interact with
    • Support for conditionally hidden and readOnly fields
    • Image generation instruction will always show when enabled
    • Translation actions will be disabled if AI Assist is not initialized
    • AI context blocks are now always visible in the instruction editor

    Migrating breaking changes

    AI Assist's schema option properties have changed and been moved into a common namespace (aiAssist). Some configuration properties have been renamed for clarity.

    All AI Assist schema options now live under options.aiAssist:

    • options.aiWritingAssistance.exclude -> options.aiAssist.exclude
    • options.aiWritingAssistance.embeddingsIndex options.aiAssist.embeddingsIndex
    • options.aiWritingAssistance.translateAction -> options.aiAssist.translateAction
    • options.imagePromptField -> options.aiAssist.imageInstructionField
    • options.captionField

2023-07-11

  • ๐Ÿ› Notable bugfixes

    • Fixes an issue where the styled-components dependency would not be installed when installing Sanity in an existing project
    • Fixes an issue where the "Restore" document action would sometimes not restore the document
    • Fixed an issue where the fallback editor had the title "Editor", instead of the name of the document being edited

2023-02-21

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    Improved .env/environment variable handling

    Over the past few releases we have been addressing some inconsistencies in how environment variables can be used. This release greatly improves how "dotenv" (.env) files are handled. To summarize the new behavior of environment variables and dotenv files from this release (v3.5.0) and onward:

    • All environment variables with the SANITY_STUDIO_ prefix is exposed to the bundle, and is available through process.env.SANITY_STUDIO_.... While they are theoretically also available under import.meta.env, it is not recommended to use them this way since itโ€™s behavior specific to Vite, and thus not available under the same location in Node.js and other environments.
    • We now load both .env, .env.local, .env.<mode> and .env.<mode>.local files from the studio root folder. This is consistent with Viteโ€™s behavior.
    • The .env files are loaded in the following order:
      • .env
      • .env.local
      • .env.<mode>
      • .env.<mode>.local
    • By default, sanity build and sanity deploy will use the production mode, while all other commands will default to the development mode.
      • Setting NODE_ENV to production will set the mode to production, but setting it to other values (such as test) will not change the mode.
      • To use a custom mode, you can set the SANITY_ACTIVE_ENV environment variable.
      • Both NODE_ENV and SANITY_ACTIVE_ENV must be set as a regular shell environment variable, not in .env files, since knowing which .env file to load is based on it.
    • Environment variables set in the shell will override variables set in the .env files.
    • The environment variables are loaded into both the browser bundle environment, and the CLI context. In other words, running scripts through sanity exec will have access to the same environment variables as the Studio bundle, and you can use environment variables in your sanity.cli.ts/sanity.config.ts files. Make sure you use process.env and not import.meta.env for cross-environment support.

    Note that we encourage you to use environment variables sparingly, and define them in a single location instead of spreading them throughout the code base. This makes it easier to see which environment variables are in use, and allows you to easier transition between different environments should you need to. For instance, one might create a src/environment.ts file which re-exports the environment variables:

    export const myCompanyInternalApiUrl = process.env.SANITY_STUDIO_MY_COMPANY_INTERNAL_API_URL
    export const someOtherVariable = process.env.SANITY_STUDIO_SOME_OTHER_VARIABLE

    Programmatic usage

    Should you want to reuse the environment variable handling in other contexts (your own scripts, or using a different bundler etc), you can import and utilize the new getStudioEnvironmentVariables() method from sanity/cli:

    import {getStudioEnvironmentVariables} from 'sanity/cli'
    
    console.log(getStudioEnvironmentVariables())
    // {SANITY_STUDIO_SOME_VAR: 'yourVariableValue'}

    Note that .env files are not loaded by default when using this method. To do so, pass an envFile option:

    import {getStudioEnvironmentVariables} from 'sanity/cli'
    
    console.log(
      getStudioEnvironmentVariables({
        envFile: {
          mode: 'production',
          envDir: '/path/to/some-dotenv-root'
        }
      })
    )

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where generation 1 GraphQL APIs would have changed pluralization rules for types ending with a number.

2023-05-17

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue causing field groups to be hidden if they only contain fieldsets

2024-03-27

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the studio might crash on "orphaned marks" in the Portable Text Editor.
    • Fixes an issue that caused the tasks plugin to be inserted multiple times in studios using more than one instance of the Structure Tool.

2024-01-10

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Updated legacy theme customization

    Legacy themes for Sanity Studio will now handle custom colors without losing the scaffolding provided by the default studio theme. This improvement means that the custom colors you define will no longer revert to default values, but instead integrate seamlessly with Sanity Studio.

    Experimental document pane title opt-out

    A new flag __experimental_formPreviewTitle has been introduced, allowing you to hide the large preview title displayed in the document pane form. This grants more control to users with custom implementations that do not benefit from this title being displayed.

    import {defineType} from 'sanity'
    
    export const playlistType = defineType({
      name: 'playlist',
      type: 'document',
      // ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
      __experimental_formPreviewTitle: false,
      // ๐Ÿ‘†๐Ÿ‘†๐Ÿ‘†
      // ...
    })
    

    Comments feature now enabled by default

    The comments feature within Sanity Studio is now enabled by default, embracing collaboration and social interactions on your documents right out of the box.

    Importing Structure as structureTool

    The import path for the structure tool has been updated. Developers should now import from sanity/structure instead of sanity/desk. A helpful codemod is available to facilitate the migration of any existing code. Existing imports to sanity/desk will still work but those imports have been marked as deprecated and will be removed in a later major version.

    A codemod is available to migrate any code that may be using it:

    npx @sanity/cli codemod deskRename

    Be sure to check in any local changes to version control before running the codemod in case it should fail.

    GraphQL deployment optimization

    A new opt-in cache, --with-union-cache, improves GraphQL schema generation speed by up to 95% for schemas with numerous self-referencing documents. This optimization is essential for larger projects and significantly improves the deploy experience.

    ๐Ÿ› Notable bugfixes

    • Fixes a regression where custom document action modal dialogs were not rendering footer content correctly.
    • Resolves issues related to incorrect default locale strings, ensuring the restoration process of document revisions is accompanied by proper messaging.
    • Fixes problems with the strike-through formatting when pasting content from Google Docs.
    • Corrects font weight rendering issues on iOS16, ensuring consistent visual experience across platforms.
    • Fixes the improper alignment of button text in the Portable Text Editor to match standard UI practices.
    • Ensures annotation toolbar popover in PTE follows the correct element on scroll, enhancing usability.
    • Fixes fieldset border issues in forms for a cleaner UI presentation.
    • Resolves console warnings stemming from passing non-DOM properties to styled-components.
    • Updates navbar button positions for better user discoverability and accessibility by adding aria labels to expand buttons in PTE.

2021-03-17T14:29:00.000Z

  • This release includes a ground-up rewrite of the default Date and DateTime inputs in the Sanity Studio. The new date inputs are powered by Sanity UI and come with improved keyboard accessibility and fewer bugs.

    Before
    After

2024-01-23

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

      npm create sanity@latest
    

    To upgrade a v3 Studio, run this command in its folder:

      npm install sanity@latest
    

    โœจ Highlights

    Deprecation support for Documents and Fields

    This release introduces the option to mark document and field types as deprecated. This can be used to gently steer Studio users towards updated schemas or to phase out legacy fields without abrupt changes.

    export const deprecatedDocument = defineType({
      name: 'deprecatedDocument',
      title: 'Deprecated Document',
      type: 'document',
      deprecated: {
        reason: 'Use the Author document type instead',
      },
      fields: [
        defineField({
          name: 'title',
          type: 'string',
          deprecated: {
            reason: 'This field was used in a legacy system and is no longer used.',
          },
        }),
      ],
    })
    

    When a field or document is deprecated, an informative message will appear in the Studio, clearly indicating the recommended action to take. This aids in maintaining a clean and up-to-date content structure.

    Bonus: Deprecation messages now appear in the GraphQL schema, providing clarity during transitions. Deprecated document types and fields should be appropriately treated in documentation and tooling.

    Reactions to Comments

    This release also introduces a new layer of interactivity in the Studio with the ability for users to react to comments! ๐ŸŽ‰

    Far be it from us to speak ill of verbose and precise communication using full sentences, but sometimes you just want to express a sentiment quickly with a ๐Ÿš€ or a ๐Ÿ‘ and Sanity Studio now has you covered for those occasions. Streamline feedback processes and consensus building, and make your Studio a more vibrant collaborative space in one fell swoop with comment reactions. ๐ŸŽฉ

    ๐Ÿ› Notable bugfixes

    • Enhances user experience in the Studio by adding localized browser document titles and correcting unlocalized strings, accommodating users who prefer languages other than English.
    • Fixes an issue where number-like string flags passed to CLI commands were parsed as numbers by the option parser, leading to truncation of large integer-only document IDs and similar.
    • Resolves a restoration issue with the token login method ensuring the active session is retained post webpage reloads when cookieless auth is in effect.
    • Enhances UI components consistency in tooltips and delay groups for better UX.
    • Fixes a performance issue by re-applying useMemo on DocumentPaneContext values, reducing unnecessary re-renders and improving document pane performances.
    • Ensures that errors in the useFeatureEnabled hook result in an empty features list rather than disruptive error toasts; this minimizes user interruption when feature availability checks fail.
    • Fixes multiple bugs in the sanity documents validate CLI command relating to visibility, unnecessary validation reports, reference checks batch processing, and unknown field validation for images and file types.
    • Improves spacing between the published date and the last updated date in the document status bar for better readability.

2024-02-20

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Improvements to Comments in Presentation

    With the recent introduction of both Presentation tool and comments, we realised that context can be crucial in understanding comments relating to visual aspects of an application.

    Comments created from within the Presentation tool will now display a link allowing content editors to navigate from any tool directly to the context in which that comment was made in their application.

    Other features

    • Improves error handling for a migration script that attempts to iterate over the passed document function without calling it
    • Adds new Studio API, ActiveToolLayout, which allows plugin authors to have more flexibility by wrapping the active tool
    • The selected viewport in Presentation is now persisted in the URL

    ๐Ÿ› Notable bugfixes

    • Improves focus handling with the Presentation tool and Portable Text Inputs
    • Fixes regression preventing import {debugSecrets} from '@sanity/preview-url-secret/sanity-plugin-debug-secrets' listing secrets
    • Fixes a bug preventing the CLI being used inside Studio project subdirectories

2021-11-30

    • Introduces a larger initial min-width for the DocumentPane.
    • Huge GROQ queries will now use the API-CDN when useCdn: true. Previously these would go to the regular API endpoint.
    • Fixes typo in deferred-visibility for mutations
    • Added schema option to configure spell-checking for Portable Text via options.spellCheck on the block type.

2023-05-03

  • Installation and upgrading

    Initiate a new Sanity Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade Sanity Studio, update its dependency:

    npm install sanity@latest

    โœจ Highlights

    Visual Editing (Enterprise Only)

    Note

    Visual Editing is available for select Sanity enterprise customers. If you would like to use Visual Editing with Vercel, you will also need to contact Vercel to enable this feature for your Vercel team. You may contact our sales team for more information.


    This release includes support for Visual Editing and Content Source Maps. This feature enables you to make deep edit links from components in a front end that takes you to respective fields in the Studio. This enables a new workflow that substantially reduces the time it takes to make changes by bringing you directly to the relevant field where you can make edits reliably in its appropriate context. For more information on Visual Editing, check out the documentation here.

    Visual Editing is available for mutual Sanity and Vercel Enterprise customers. Existing Sanity enterprise customers can contact their dedicated customer success manager to enable this feature. Customers interested in upgrading to an enterprise plan can contact our sales team for more information. You will also need to contact Vercel sales to enable this feature for your Vercel team.

    Sanity enterprise customers can also use the Content Source Maps with GROQ to build custom Visual Editing capabilities. For more information, check out the Content Source Maps documentation here.

    Quickly add Sanity Studio to Next.js

    The sanity initย command now recognizes if you are in a Next.js project, and will ask:

    • What Sanity project you want to use (use existing or create new)
    • Whether you want to place an embedded Studio using pages or app routes
    • Whether you want to use TypeScript for your Studio
    • What template you want to use (clean or blog)
    • Whether you want to append the project ID and dataset to your .env file (you can also specify a custom env file with the --env flag)

    If you have a Next.js project and want to quickly deploy an embedded Sanity Studio, you can run npx sanity init within your application's directory to get started.

    Minimum version when using pnpm required: 8.x

    Additional notable features

    • Enables fully unattended studio init with CLI when projectId, dataset and --y flags are set
    • sanity init will now determine default package manager choice based on currently running package manager

    ๐Ÿ› Notable bugfixes

    • Updates the Shopify Studio template with various fixes
    • Fixes an issue that caused field group buttons to steal focus when deep linking into a Studio value
    • Fixes an issue causing focus to be set on wrong element when deep linking to a field inside an array
    • Fixes an issue so deep linking to a field/input expands the right fieldsets/collapsed objects along the way
    • Fixes an issue where validation errors would not focus on collapsed fieldset
    • Fixes an issue where using pnpm to install dependencies would not install the latest available versions when creating a new project
    • Resolves issue where unattended mode (--yes flag) for sanity init would still show a confirmation prompt about running a v2-like CLI command
    • Fixes a bug with reference fields not receiving focus when clicking a validation error or following a link to the field
    • Fixes intent links to focus on the correct location
    • Fixes issue with pasting a file from clipboard into a file field that already has a value
    • Fixes support for deep linking in image and file fields
    • Fixes a bug that broke pasting a file into a file field when a value is already present

2022-01-19

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Maintainance update to the Portable Text Editor

    This update brings fixes for several bugs and improvements to the Portable Text Editor's performance and reliability. It also includes:

    • Better keyboard accessibility when editing embedded objects
    • Better tracking of validation errors within the editor
    • Better Android and IME support

    Default .eslintrc file when creating new projects with the CLI

    New projects bootstrapped with the CLI will now contain a default .eslintrc that extends our new shared ESLint config @sanity/eslint-config-studio.

    ๐Ÿ› Notable bugfixes

    • Fixed an issue where sanity upgrade would fail if @sanity/code-input was installed. (Thanks Tommy for the PR!)
    • Fixed an issue where sanity upgrade, sanity versions and sanity debug would fail if running without any dependencies installed.
    • Removed third party dependency causing security warnings with npm audit (immer.js)

2022-04-29

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the studio might crash when publishing due to a change in a third party dependency
    • Fixes an issue where user avatar from Google would sometimes not appear
    • Fixes a typo in the studio update dialog
    • Fixes a bug where initializing new projects with a dash in its name would not include it in the suggested output path

2023-01-12

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes a regression in groq@3.2.0 that is missing a default export affecting Node.js ESM runtimes
  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes issue in the Node.js runtime wrapper causing the groq tagged template literal to sometimes be undefined
  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the Node.js ESM specific export for groq were missing from the package published to npm
    • Fixes a potential race condition with duplicate keys when an editor deletes all the content of a portable text editor while other editors are editing the same document

2022-03-16

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an issue with the v2.29.0 release that prevented the @sanity/default-layout module from being installed

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    New changelog dialog

    The Studio now has a new changelog dialog that features more in-depth information about the latest features and bugfixes.

    ๐Ÿ› Notable bugfixes

    • Fixes an issue in array inputs where the input was disabled when dragging items within a Portable Text Editor

2023-12-19

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    ๐ŸŒ Publish! Verรถffentlichen! Publicar! ๅ…ฌ้–‹!: Sanity Studio UI Localization! ๐ŸŒ

    The Translate the studio UI #1603 issue has been one of our most popular feature requests on GitHub. Now we can finally close it, because we have launched Studio UI localization.

    What's New?

    • Multilingual support: You can now configure the Sanity Studio user interface to use languages other than English. We're starting with many languages, including Spanish, French, Norwegian, German, Portuguese, Korean, Turkish, Icelandic, Thai, Vietnamese, Swedish, Finnish, Czech, Italian, Japanese, Chinese, and Polish. Donโ€™t see your preferred language? It's easy to request additional language plugins!
    • AI-Translated language plugins: These initial translations are generated by AI โ€” we're inviting the community (thatโ€™s you!) to help us improve and maintain these translations for accuracy and cultural relevance. Interested? Read more about how to contribute over on GitHub.

    First steps to a localized Studio

    This is our first step towards a fully global studio. The support for localization will grow, starting with our official plugins. We appreciate your patience and contributions as we expand these capabilities!

    Getting started:

    • Choose your language: Visit github.com/sanity-io/locales to find the plugin for your desired language. If it's not listed, weโ€™d love you to request it - we can do a first auto-translated pass, and you can help us review and improve the automated translations.
    • Plugin setup:
      • Ensure you are using Sanity version 3.22.0 or newer
      • Install the plugin for your desired language (npm install @sanity/locale-nb-no)
      • Import it (import {nbNOLocale} from @sanity/locale-nb-no
      • Add it to your studio's plugins array (plugins: [nbNOLocale()])
      • Youโ€™ll find full instructions on the locale pluginโ€™s README!
    • Documentation:

    We're eager to hear from you and welcome any feedback. This is just the beginning, and your insights are invaluable in making Sanity Studio even better.

    Introducing telemetry ๐Ÿ“ก

    As a product company, we have to prioritize what to work on. Ideally, those decisions are based on a healthy amount of vision (how we think things could be better) and insight (how people use the product). We have had a good amount of the former but less of the latter.

    With this release, weโ€™re introducing telemetry data collection in the CLI and Studio. Participation is optional, and you can easily opt-out by running npx sanity telemetry disable, setting the DO_NOT_TRACK=1 environment variable, or visiting Account Settings in Manage. For more details on what data is collected, how itโ€™s being used, and how consent is handled, go to sanity.io/telemetry.

    Other features

    • Adds experimental support for using Bun as package manager when creating new Sanity projects (bun create sanity)
    • Adds the ability to customize the suffix added to auto-generated GraphQL filter types (Filter by default), by configuring filterSuffix in the GraphQL configuration of sanity.cli.ts

    ๐Ÿ› Notable bugfixes

    • Fixes issue where annotation popover would open in the wrong location when selecting annotation text in the Portable Text editor
    • Fixes removal of marks in the Portable Text editor, not always cleaning up unused mark definitions
    • Fixes issue where Portable Text editor would crash when attempting to use annotations on text over multiple blocks
    • Fixes issue in which new empty text blocks were added when adding a non-text block in the Portable Text editor
    • Fixes an issue where selecting a custom API version in the Vision tool would sometimes crash
    • Fixes a minor bug related to event logs introduced in v3.22.0
  • ๐Ÿ› Notable bugfixes

    • Fixes relative time formatting in certain languages
    • Fixes some peer dependency warnings
  • This update significantly upgrades the Sanity Studio user interface (UI) and Sanity UI. The goal here is to align it with what you expect for modern tooling and reduce elements where possible to make it easier and smoother. We also wanted to bring more consistency in styling and interactivity.

    The updated Sanity Studio UI

    At a high level, we have:

    • Updated the navigation bar with fewer visual elements
    • Reduced visual noise in document lists and made it easier to discern between documents and folders
    • Made typography, line heights, and styling more consistent
    • Updated color themes to add more vibrancy where interactive elements need to stand out
    • Cleaned up the document form and added a large title to make it easier for editors to discern where they are
    • Made dates human readable (exact date time accessible on hover)
    • Added simple animations to improve how it feels to use the Studio
    • Removed the components.studio.logo API to more clearly signpost what workspace you are in (you can still add custom logos with workspace icons)
    • Done the groundwork to simplify branding and theming the Studio
    • Updated Sanity UI with new studio-specific UI components and better support for the new localization features

    Upgrading to the new UI

    To install this upgrade (v3.23.0) run:

    npm install sanity@latest

    If you have used Sanity UI (@sanity/ui) for Studio customization, you should install the beta of the new major release, too.

    npm install @sanity/ui@beta

    Test it out

    We have worked hard to identify edge cases, but this update might break with customizations, and plugins that use and haven't updated their Sanity UI dependency might look a bit out of place. We recommend you test out the upgrade on a branch and preview deployment.

    If this upgrade for some reason doesn't work with your current Studio, you can downgrade to v3.22.0 (and minor patch releases for it). Edit package.json and run npm install:

    {
      //...rest of package.json
      "dependencies": {
        "sanity": "^3.22.x"
      }
    }

    If you have to do this, tell us what doesn't work for you in an issue on GitHub.

    Tell your team!

    This upgrade changes how the Studio feels and looks; in some cases, it moves affordances that your content team might have used to. We think this upgrade improves the editorial experience, but it is still good to inform your team that this change is coming. And use that opportunity to teach them about keyboard shortcuts like cmd + K / ctrl + K to open the search bar.

    Plugin maintainers

    If you are a plugin maintainer and want to support this upgrade, then you can add ^2.0.0-beta to the peer-dependency range of @sanity/ui:

    {
      //...rest of package.json
      "peerDependencies": {
        "@sanity/ui": "^1.0 || ^2.0.0-beta"
      }
    }

    This will make it stay compatible with future stable/non-beta releases of @sanity/ui@2.x.

    Migration and deprecations

    This release deprecates some parts of the Studio Customization Framework.

    Custom Studio logo component

    The studio.components.logo are no longer rendered. For custom logos, use the icon property in the workspace configuration instead:

    // sanity.config.ts
    import {defineConfig} from 'sanity'
    import {RobotIcon, RocketIcon} from '@sanity/icons'
    import {deskTool} from 'sanity/desk'
    import {schemaTypes} from './schemas'
    
    export default defineConfig({
      projectId: '<projectId>',
      dataset: 'production',
      name: 'Production',
      title: 'Default Workspace',
    
    icon: RobotIcon,
    plugins: [deskTool()], schema: { types: schemaTypes, }, })

    Tool icon

    Tool icons are no longer rendered; only the tool name is used in the navigation bar. There is no workaround for this.

    Menu item group title

    The Structure Builder API has allowed for a menu group title to be set. This is no longer displayed.

2023-03-31

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes a recent regression where Portable Text annotations within nested content could not be properly edited

2024-03-19

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue that would cause duplicate entries in the list of recent searches.
    • Updates the type of value within ObjectFieldProps to accept a type parameter, allowing for dynamically setting the expected type. (thanks @shixish)

2023-10-10

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    • Responsive improvements to the Vision plugin to accommodate narrower screens
    • Updated icon for copy buttons
    • Bump engines.node to >= 18

    ๐Ÿ› Notable bugfixes

    Fixes type for canHandleIntent to allow passing undefined

    Fixes placement of "Add itemโ€ฆ" popover in array inputs

    Fixes a bug where edit intent was not called when added to a menuItem (thanks @israelroldan ๐Ÿ™)

2022-01-11

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Field groups

    Added Field Groups to schemas and document view. Read more about the feature here: https://www.sanity.io/docs/field-groups.

    New array item menus

    Arrays now support adding new items before/after existing array items, and also duplicating existing items.

    New and improved document status indicator

    Updated document status indicator with saving state and animation.

    Other features

    • Added SANITY_STUDIO_PROJECT_NAME environment config variable

    ๐Ÿ› Notable bugfixes

    • Fixed an issue that could in some cases cause matching documents to be excluded from the search results
    • Made the default title of referenced document types more user friendly
    • Fixes an issue that could occasionally cause a query error during publish of a new document created directly from the reference input
    • Fixes an issue that caused singleton documents to never load if no schemaType was provided.
    • Fixes UI issue in Portable Text toolbar

2023-05-25

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes a recent regression from v3.11.2 where text annotations nested inside Portable Text inputs could not be edited properly

2021-11-18

  • Fixes a bug in Safari where editing annotations (like links) in the portable text editor would make the popover dialog jump around.


2023-08-29

  • Installation and upgrading

    Fresh install

    To install and initiate a new Sanity Studio without installing the Sanity CLI globally, run the following command in the terminal:

    npm create sanity@latest

    Upgrade

    To upgrade an existing instance to Sanity Studio v3, run the following commands in the terminal:

    # Go to the root folder of the installed Sanity Studio instance
    cd /sanity-studio/root-folder
    
    # Upgrade Studio to v3
    npm install sanity@latest

    โœจ Highlights

    This release: 3.16.0

    In a nutshell:

    • Enhanced Portable Text editing experience.
    • Faster syncing.
    • Full support for Portable Text on Android devices.
    • Offline detection.

    Improved Unicode support

    Sanity Studio uses the diff-match-patch algorithm to match and patch document changes. In previous versions of the Sanity Studio, the underlying library wouldn't work correctly when parsing some Unicode characters. We addressed those issues in this release.

    If you experienced issues when using characters such as emojis, Kanji, or other non-Latin characters, this release resolves these issues.

    Enhanced Portable Text editing

    Besides improved Unicode support, the Portable Text Input and the underlying text editor feature several improvements to provide a smoother editing experience.

    Faster synchronization

    Previously, prolonged fast typing in the editor would trigger debouncing: the Portable Text Input would temporarily suspend committing edits until you decreased your typing speed below a specified threshold.
    This behavior could produce bigger discrepancies between your local value and the corresponding actual value stored on the server side.

    Now your changes are committed in a throttled way: the editor commits the changes as you type, without compromising performance.

    Improved undo and redo

    Undo and redo features have been improved considerably, especially when working with many editors on the same document.

    Better Android support

    The Portable Text Input is now fully supported on Android. Previously, typing in the editor using an Android on-screen keyboard would cause some issues.

    Offline detection

    The Portable Text Editor automatically enters read-only mode if it detects that the network is offline.
    This behavior helps keep your local document in sync with the corresponding copy on the server when there is no online access, and it prevents losing changes due to not committing them.

    Other features

    • The sanity module is now marked as free of side effects, which can produce smaller bundle sizes (thanks @mckelveygreg! ๐Ÿ™)
    • Improved UX when deleting a document.

    ๐Ÿ› Notable bugfixes

    • Fixed a bug where changing text styles in the Portable Text Editor would cause the editor to lose focus.
    • Fixed a problem that would occur when repeatedly applying and removing text decorators while typing in the Portable Text Input.
    • Fixed the odd placement of the โ€œEmptyโ€ placeholder in the Portable Text Editor on WebKit browsers.
    • Fixed a media visibility issue in Safari occurring in list previews with custom SVG elements.
    • Fixed the alignment of action items in pane headers on mobile devices.
    • Fixed a padding inconsistency in reference fields.
    • Fixed a visibility issue affecting tooltips in the navigation bar, and causing them to be displayed behind open menus.
    • Fixed an issue impacting cross-dataset reference fields displayed as nested fields, inconsistent with regular reference fields.
    • Fixed a bug that caused specifying apiVersion on documentList() and documentTypeList() to not work in the desk structure.
    • Fixed the initial flashes of validation errors for valid content on document load.

2022-09-07

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    Accessibility improvements

    • Screen readers will now identify that the main language in the Studio is English
    • Various accessibility improvements

2022-03-23

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where client configured with a token via part:@sanity/base/configure-client would be reset.

2023-03-29

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes a regression from v3.8.0 where annotations could not be edited in Safari
    • Fixes an issue with duplicate keys when pasting empty lines into an empty Portable Text input


2022-02-08

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    More Presence

    Presence avatars in document lists

    Presence, the ability to see where your collaborators are, is now visible in document lists, search results, and reference previews.

    Other features

    • You can now configure the default API version for Vision (#3127)

    ๐Ÿ› Notable bugfixes

    • Removes a false positive validation error with some nested image and file fields (#3119)
    • Fixes a bug where adding marks to a Portable Text block would remove some existing marks (#3124)
    • Fixes a bug where list items in Portable Text without a level would cause an error (#3129)
    • Fixes a bug where read-only arrays showed an empty actions menu (#3130)
    • Improves empty read-only state for arrays (#3131)
    • Adds validation warnings on incorrectly implemented asset sources (#3135)

2022-01-27

  • Upgrade the Command Line Interface (CLI) with:

    Comment

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes a bug in the Portable Text Editor where opening inline objects of type reference would not open the editing interface if the reference was set already
    • Fixes issue where document preview images werenโ€™t updating when changed
    • Fixes issue where array items with initial value were overriding set values when duplicating

2022-10-14

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

2023-06-20

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes potential typing issues caused by mismatched versions of @types/react-is
    • Fixes issue where validation tooltips were clipped inside of the Portable Text editor
    • Improves accessibility of list panes when using screen readers


2023-11-28

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Improves the Portable Text Editors backspace handling on text blocks that follows a non-text block
    • Fixes an issue where the Portable Text Editor would crash if a block with its children property set to undefined was inserted
    • Ensures that StudioLayout utilizes the components API when used in isolation
    • Fixes some performance issues related to entering text into all compatible Studio inputs. Typing in Studio inputs should now be noticably faster, in particular for schema types with a lot of deeply nested fields.
    • Adds node.module to package.json which improves compatibility with Webpack, Astro, Svelte and Vue

2021-10-15

    • Fixes a bug where the withDocument higher-order component would sometimes return null initially
    • Fixes a bug where collapsed panes might not show their content when expanded
    • Fixes a bug where tools would not get passed the tool property, resulting in incorrect context

2021-08-31

  • Removing warning for new fields in GraphQL schemas

    If you add schema fields and run sanity graphql deploy you will no longer be warned about โ€œdangerous changes.โ€ Previously, our GraphQL validation followed the behavior of graphql.js, which treats added fields as โ€œdangerous.โ€ We have had a lot of feedback, that in practice, it has been more bothersome than useful.

    ๐Ÿ› Notable bugfixes

    • Since v2.16.0, (inline) references in Portable Text would not be saved properly and left an arbitrary attribute. This version fixes that.

2023-05-09

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes issue where the Create new document dialog didn't work on smaller screens
    • Fixes issue where out of range integers in number fields could crash the studio

2020-02-27

  • Deploying generation 1

    In order to use the old beta version of the GraphQL API, you can specify it when running the GraphQL command from the CLI. We call these older versions generations. The beta generation is named gen1, and the current generation is named gen2.

    To deploy the old generation (beta), you can use the --generation flag in the CLI like this:

    sanity graphql deploy --generation gen1

    Breaking changes between gen1 and gen2

    The second generation of the GraphQL API has more features, and does not pluralize the top-level collection types:

    • Generation 1: post, allPosts
    • Generation 2: post, allPost

    The CLI will warn you if there are breaking changes to the schema you deploy and show you where they are. The breaking changes prompt can be disabled by running the deploy command with the --force flag.

2021-12-17

    • Fixes a bug that caused focus loss on an array item after closing the edit dialog
    • Fixes a bug that caused popovers from closing when clicking outside of the current pane content
    • Fixes an issue that could cause a max request size exceeded error for documents that had many references.
    • Fixes a bug that could sometimes cause document preview for object fields with name "title" to crash on reload
    • Added more details in docs for the client.delete() API

2024-01-16

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade Sanity Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Beta: Check the validation status of all documents with the CLI

    The new sanity documents validate command is now available! It runs all documents in a dataset against your project's schema in the terminal. It uses a mocked browser environment to validate all documents locally, perfect for ensuring data integrity.

    Note: This feature is currently in beta, so it might not run correctly for all projects. We encourage users to report any issues encountered to help us improve it.

    Improved copy-paste experience from Google Docs and Notion

    The Studio now preserves formatting more reliably when content is pasted from Google Docs in Safari, and no longer incorrectly applies underline decorators to pasted links. Additionally, the Studio now preserves formatting more reliably when content is copied from a single block in Notion.

    User interface and experience updates

    • Root page link: The workspace icon now consistently serves as a direct link to the 'root' page (the first configured tool), streamlining navigation.
    • Improved Workspace Switcher: A new tooltip feature has been added to the workspace switcher for better clarity.
    • Simplified Tool Menu: The tool menu will now be hidden when only one tool is installed, reducing clutter.
    • Layout stability: We've resolved an issue with long workspace titles disrupting the navbar layout. Titles now truncate with ellipses to maintain a clean appearance.
    • Localized tooltip text: The 'open menu' button tooltip text has been localized and is now more accessible on smaller screens.
    • Intuitive icons: The help and resources button now features the correct icon, making it more intuitive and consistent with previous versions.
    • PTE improvements: Ensures that clicking to edit in presentation mode correctly focuses the relevant block, improving the editing workflow.

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where logging out didn't invalidate the cookieless auth token.
    • Fixes an issue in the Portable Text Editor where the 'Empty' placeholder placement was off.
    • Fixes an issue where array item focus rings were cropped, ensuring they're now displayed in full.
    • Fixes a bug where the workspace switcher tooltip wasn't displaying correctly.
  • Installation and upgrading

    To install or upgrade Sanity UI:

    npm install @sanity/ui@latest

    โœจ Highlights

    This 2.0 release of Sanity UI is a major visual update that introduces:

    • Updated component styles and defaults
    • New color palette changes (via @sanity/color)
    • Optional animation support for Popover, Tooltip and MenuButton components
    • Updated font stack (defaulting to Inter, if available) and font metrics
    • Various under-the-hood improvements

    For plugin authors: you can continue to use Sanity UI 1.x without issue, though we strongly recommend upgrading to 2.x to ensure visual consistency if you're targeting Sanity Studio 3.24.x and higher.

    Changes

    Features

    • add buildTheme function (b09226e)
    • add animate support to popovers, add custom origin middleware and animate from reference origin (#1194) (9ee54ba)
    • add inter to default (non-code) font stack (23baaa6)
    • add radius='full' support and supporting stories (#1150) (e9adb5b)
    • allow tooltip arrows to be hidden (22c6f73)
    • animations: add animations to dialog and tooltips. (#1187) (6cb872f)
    • avatar: implement avatar sizes (8deb370)
    • button: change focus ring width (#1158) (b4b14cc)
    • buttons: add support for width=fill prop (#1175) (a2006cd)
    • button: update defaults (e213d90)
    • button: update styles to match facelift designs (#1142) (836a506), closes #1143
    • cssvars: replace color theming through styled-components for css vars. (#1152) (bbb78e3)
    • default-theme: add support for component-level focus ring configuration (#1140) (eee10a1), closes #1141
    • default-theme: update color palette (#1137) (e01d0ad)
    • dialog: update styles and add corresponding stories (#1155) (5741633), closes #1156 #1161
    • figma: initialize figma plugin (c82b4ca)
    • force semibold on dialog headers (6303677)
    • introduce '@sanity/ui/theme' export (b38f35a)
    • kbd: update primitive style, minor storybook cleanup (#1157) (b0a4082)
    • menu: update menu and menu items styles (#1166) (c2e5ebc)
    • reduce autocomplete radii (db3484a)
    • reduce default button focus width (2ff2b63)
    • release 2.0 (0ac1c8f)
    • remove dialog header + footer borders (dd826ad)
    • tab: update styles and add corresponding stories (#1159) (2988785)
    • theme: add avatar size (9129e6f)
    • theme: add label font size (abb9bb2)
    • theme: parse parse compile color mix (2d049be)
    • tooltip: update styles and corresponding stories (#1160) (34bf88d)
    • tweak default avatar image sizes, fix avatar arrow stacking context (1c5348d)
    • update avatar styles (#1183) (f7d4b94)
    • update badge background colors (70b669c)
    • update default avatar sizes (a288f75)
    • update KBD styles and default props (7c837a0)
    • update select component icon (7366ef0)
    • update toast styles (0f89cc6)
    • update various input styles (#1147) (fe53370), closes #1144 #1145 #1146

    Bug Fixes

    • add stretch fallbacks on card + selectable button styles, add mozilla fallback (981194d)
    • adjust colors (0e4cabe)
    • avatar: use label font (27e655d)
    • badge: set color using variable (ddeb0d8)
    • badge: use regular font weight (b72b338)
    • build: update keywords (74cfd4d)
    • build: update node version (ce69f9d)
    • build: update node version (e54707c)
    • button: button with right icon is pushed to the end (#1195) (ad87933)
    • button: default mode (e7e3d32)
    • button: render styles (35e0a91)
    • button: set vertical alignment to fix unwanted margin (4d7851f)
    • card: add color backdrop variable (dbcdccd)
    • card: only set focus ring variable when :focus-visible (757a0d0)
    • checkbox: adjust colors (7f2e7d3)
    • core: add font-weight for strong font in heading (#1204) (6c430b3)
    • core: improve defaults (8d4d5d9)
    • correctly prefix unstable props (4e30a56)
    • darken backdrop color in light mode (a12a0df)
    • deps: add react-is peer dependency (a9549a8)
    • deps: update @sanity/color (a357c77)
    • deps: update @sanity/color (2207abf)
    • deps: update @sanity/color (185d5a7)
    • deps: update @sanity/color (deeaed1)
    • deps: upgrade @sanity/color (780ee0b)
    • dialog: adjust padding (c4f7858)
    • dialog: fix padding (5ca95c5)
    • dialog: update dialog design (#1169) (477f495)
    • do not scale icon strokes (0740c6b)
    • ensure button primitives use the correct default mode (ccdb59e)
    • facelift: add unstableDisableFocusRing prop to text inputs (#1184) (6ded803)
    • figma: export muted bg (0a3a9e2)
    • figma: update plugin (5229ace)
    • improve scale transitions for non-retina screens (#1200) (3e52721)
    • kbd: vertical alignment (cc8bc61)
    • menu-button: close menus containing selected items when re-clicking the menu button (#1193) (7b60c32)
    • peer-deps: remove react-is from peer deps (49a832c)
    • popover: disable arrow by default (9c1548e)
    • remove unknown prop "animate" console warning (aaa353c)
    • remove crossfade pollution on fade in transitions (#1201) (591cea3)
    • remove unused focusRing from legacy ThemeColor interface (#1207) (2a4d9b6)
    • revert changes for css variables (#1172) (7cea0a3)
    • revert dialog padding, include margins, add hidden close button story (d0af39d)
    • revert rounded border style in tabs (a668b11)
    • select: default to radius=2 (8ac48c2)
    • simplify dialog header padding (2c5fee1)
    • switch: adjust handle shadow (604ac42)
    • switch: improve checked read-only state (6320d59)
    • text-input: improve styles (eacee35)
    • theme: add resolved key to v2 theme (#1203) (c81bc6d)
    • theme: adjust syntax colors (a264240)
    • theme: adjust vertical trimming (a00a989)
    • theme: improve backwards compatibility (01da5eb)
    • theme: improve backwards compatibility (54c80ba)
    • theme: improve color tokens (27bea7d)
    • theme: improve colors (6eed99d)
    • theme: increase switch padding (e99251d)
    • theme: re-introduce base focusRing value and mark as deprecated (#1162) (1fc3106)
    • theme: restore selectable in v0 theme (#1206) (98447fe)
    • theme: support 0 opacity (ce9929e)
    • theme: tweak colors (6bbfa8a)
    • theme: update avatar and badge ts descriptions, mark them as internal (ec329df)
    • theme: update container width size (#1198) (9ba891e)
    • tooltip: disable arrow by default (fabcbde)
    • tooltips: fixes for TooltipDelayGroup, onClose and nested (#1186) (345e887)
    • tooltips: update default fallback placements (#1185) (117fe85)
    • tree: default font size and padding (8c279b4)
    • tweak default tooltip motion values (608f66a)
    • update default values for <Badge> (aaa5708)
    • update default values for <MenuItem>, <TextArea> and <TextInput> (82dc8d2)
    • update legacy focusRing values (cc1c7be)
    • update types [skip ci] (4725af4)
    • vars: minimum implementation for colors legacy support (#1167) (aca0675)

2024-03-26

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a Sanity Studio, run this command in its folder:

    npm install sanity@latest

    Sanity TypeGen (beta): Generate types for your schema and GROQ queries

    This release comes with Sanity TypeGen, the new tooling in the Sanity CLI that enables extracting the schema into a static representation (schema.json) and to generate TypeScript type definition for it, as well as for GROQ query results.

    You can learn more about Sanity TypeGen:

    If you try out Sanity TypeGen, do let us know how it went in the #typescript channel in the Sanity community or to your customer success team.

    Tasks (beta): Delegate work within Sanity Studio

    This update also includes the beta of Tasks for Sanity Studio. It's a way to assign tasks related to documents, delegate them to team members, and track their status across the project.

    Find the new Tasks in the upper right corner of the Studio

    If you wish to disable tasks, you can do so by adding the following to sanity.config.ts:

    export default defineConfig({
      โ€ฆrestOfConfig,
      unstable_tasks: {
        enabled: false,
      },
    })

    Documentation for Tasks is in the works and will be announced when ready.

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where all fields got marked as non-optional when extracting schema with --enforce-required-fields.
    • Fixes a bug where Vision would insert a new line on cmd-return.

    Problems with styled-components@5?

    If you encounter an error such as TypeError: Cannot read properties of undefined (reading 'div'), please make sure your Studio doesn't depend on styled-components@5. Updating any such dependencies to styled-components@6 should resolve the error:

    npm install styled-components@latest

2024-05-07

  • 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.

    โœจ Highlights

    • The Portable Text Editor (PTE) now supports drag-n-dropping + pasting of images and files into Image and File blocks.

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where importing a variable inside an imported file would fail in Typegen.
    • Fixes issues in the PTE where tools would show as being active for a selection when only part of the selection used the tool. Now tools will show as active only when all highlighted selections use the tool.
    • Fixes an Attempted import error related to using swr in embedded studios.
    • Fixes an issue in which listeners would sometimes not close if they were unsubscribed from shortly after opening.
    • Fixes an issue in which users were incorrectly seeing the scheduled publishing upsell UI.
    • When child within the PTE is created without a _key, we now automatically create one for it, avoiding unnecessary warning.
    • Fixes an issue in tasks in which the UI showed that they were created but the transaction didn't end.

2024-04-09

  • โš ๏ธ This upgrade requires styled-components@6.1 and @sanity/ui@2

    This release comes with version requirements for the following packages:

    • styled-components@6.1 (required for all Studio projects)
    • @sanity/ui@2 (optional)

    If you're maintaining a plugin for Sanity Studio, we recommend upgrading its dependencies too.

    styled-components (required)

    We have seen incompatibility issues when styled-components@5 is used outside of the Vite configuration that ships with sanity, for example, when the Studio is embedded in a Next.js or Remix project.

    Styled Components is a required dependency for Sanity Studio projects. By upgrading it, you can also delete the @types/styled-components and react-is dependencies that were required with styled-components@5:

    # npm
    npm install sanity@latest styled-components@^6.1
    npm rm @types/styled-components react-is
    
    # pnpm
    
    pnpm install sanity@latest styled-components@^6.1
    pnpm rm @types/styled-components react-is
    
    # yarn
    
    yarn add sanity@latest styled-components@^6.1
    yarn rm @types/styled-components react-is

    Note: if you have local customizations in your Sanity Studio that are using styled-components you may need to make some minor adjustments to the customization code. For more details, please consult the styled-components migration guide.

    @sanity/ui

    Studio projects that use @sanity/ui for customizations and have it as a dependency in package.json need to upgrade to @sanity/ui@2:

    # npm
    npm install "@sanity/ui@^2"
    
    # pnpm
    pnpm install "@sanity/ui@^2"
    
    # yarn
    yarn add "@sanity/ui@^2"

    โœจ Highlights

    Tasks (Beta)

    Sanity Studio now ships with Tasks. You can now:

    • Target tasks for specific documents
    • Assigned tasks to Studio members
    • Comment on tasks, and use @-mentions
    • Resolve tasks

    Tasks ships enabled by default. If you want to disable tasks in your Studio, you can do so with this configuration:

    export default defineConfig({
      // ... rest of config
    	unstable_tasks: { enabled: false },
    })

    Learn more about Tasks in the documentation:

    Other features

    • Resolves "Masquerading as CJS and ESM" type errors
    • Adds ESM with .mjs exports for full support of Node.js' native ESM mode while still offering support for .esm.js exports for legacy bundlers
    • Adds missing sideEffects: false conditions to package.json files, improving tree-shaking and reducing bundle sizes for embedded Sanity Studio projects
    • Simplifies the Shopify schema starter template

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where wrongly formatted configuration would be inserted into tsconfig.json when sanity init was run inside of a Next.js project
    • Fixes an issue where importing .scss or .sass files from the studio configuration or a descendant file would cause certain CLI commands to crash
    • Improves error message when extracted schema (from sanity schema extract) could not be found when running sanity typegen generate
    • Fixes an issue where the CLI might suggest deprecated Sanity v2 commands if you mistype a command name
    • Makes the current field on slugs required when used with the --enforce-required-fields flag in sanity typegen contexts
    • Fixes a bug where running npx sanity init in a Next.js project would break the tsconfig.json configuration
  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    We recommend that you check out the instructions for the Sanity Studio v3.37.0 release before upgrading. If you have already updated your dependencies as described in that document (I.e., you are updating from v3.37.0), you can proceed with updating your studio as normal:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes a regression in v3.37.0 that affected embedded studios in certain environments and test runners
    • Fixes an issue where newly created studios used an outdated version of styled-components

2023-11-21

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Improved support for non-Latin1 characters in URLs

    Sanity Studio now handles characters outside of the Latin1 range in intent or structure tool pane payloads without crashing. This fix ensures better support for multilingual content and enhances worldwide usability.

    Comments feature improvements

    Continued improvements for the comments feature include a resolution to the layering issue that caused popovers to render behind the document pane.

    The comments feature also received a quality-of-life enhancement by ensuring that the comment discard dialog appears above the document pane footer and headers, making it fully visible and accessible.

    Lastly, we fixed a focus behavior where the reply comment input would unintentionally gain focus when clicking outside of it. Sanity Studio now maintains focus appropriately, only triggering when the comment input field is deliberately selected.

    ๐Ÿ› Notable bugfixes

    • Fixes the PTE toolbar menu behavior, ensuring only one menu can be open at a time.
    • Resolves the odd focusing issue around comment reply inputs.
    • Corrects the visual layering of the comment discard dialog to avoid it being hidden by other elements.

2021-11-09

  • This release includes a new implementation of our pane and intent resolver that resolves intents deeper in your structure and provides more consistency with getDefaultDocumentNode. The Studio will now do a better job at opening a document within a structure instead of opening it on the root level outside of its usual context.

    • Fixes an issue where creating a new document would open in the fallback editor instead of as a child to the current pane.
    • Fixes an issue where opening a search item from the top search would result in the fallback editor instead of user-defined structure.
    • Fixes inconsistencies with getDefaultDocumentNode where configured views would not appear in the fallback editor.

    Other fixes

    • Fixes an issue with GraphQL deploy causing "Error: Cannot find module '@sanity/core/_internal'
    • Support for GROQ query params in patch and delete methods in the client (#1826). Thanks, @KarlGe!


2021-03-17T11:51:00.000Z

  • Breaking changes in v7.x

    Starting at v7.0.0, this plugin requires Gatsby v3 and no longer supports Gatsby v2 or earlier. See the migration guide for instructions on how to upgrade to v7 of this plugin. If you're not yet ready to upgrade to Gatsby v3 we recommend staying at v6.x of this plugin.

2023-05-24

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes issue where image and file upload fields were not uploading data
    • Fixes issue that would cause the dropdown list of autocomplete suggestions for reference fields to not overflow correctly inside the Portable Text editor
    • Fixes issue where the current value of reference fields would not be displayed in the Portable Text editor
    • Improves performance for arrays and portable text inputs

2022-09-27

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Performance improvements

    This release includes several performance fixes that should now make the Studio more responsive while editing documents. (See more details in individual PRs #3668, #3662, #3660)

    Improved search

    Search for documents containing an exact phrase by wrapping text inside double quotes.

    Other features

    • Upgrade @sanity/ui to v.0.37.22

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the scroll position in global search wasnโ€™t being correctly retained in some instances.
    • Fixes an issue in global search that would cause the studio to crash if Local Storage is unavailable.

2021-10-19

  • Fixes a bug where if a space was configured as the default but not the first in the spaces array, the initial studio load would redirect to the correct URL but not configure the client to use the correct dataset.

    • Fixes an edge case for user-defined components. All user-defined components are re-rendered on navigation regardless if the structure child is a function or not.
    • Fixes an issue where user-defined components would not be hidden when pane was collapsed.
    • Fixes sluggish UI in the image select dialog when the list contained large GIFs.
    • Fixes image select dialog scrolling to top when loading a new page.
    • Fixes an issue where deploying a GraphQL API might crash if schema-imported component tries to access localStorage.
    • Fixes an issue where switching betweeen two "singletons" (document list items) without a defined schema type might result in the incorrect schema type being used.
    • Fixes a styling issue in the @sanity/vision autocomplete styling.
    • Fixes an earlier regression that caused the withDocument higher-order component to pass on the edited document before it was fully loaded.
    • Fixes a bug where removing an annotation in the beginning of a Portable Text block would accidentally mutate trailing annotations inside that same block.

2022-05-10

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    • CLI copy dataset command now always prints a job id to make it easier to resume watching running jobs
    • It is now possible to navigate to a referring document from the 'delete document' dialog

    ๐Ÿ› Notable bugfixes

    • Fixed an issue where sanity deploy would return "Hostname already taken" for all errors
    • Added explanation in sanity exec --help on how to add arbitrary arguments to the script
    • Fixed date formatting issue in validation tooltip
    • Added scroll to the types dropdown menu when creating a new reference

2023-08-01

  • v2023-08-01 is the first update to the Sanity GraphQL API to include breaking changes, and is released as an opt-in upgrade. Your existing projects that query the previous version โ€“ v1 โ€“ will continue to work as before, and you donโ€™t need to take any action until you are ready to upgrade.

    To start using the newest version, please ensure that you have read the section titled Breaking Changes below. Once you are ready, change your query endpoints as follows:

    // Old endpoints
    https://<yourProjectId>.api.sanity.io/v1/graphql/<dataset>/<tag>
    https://<yourProjectId>.apicdn.sanity.io/v1/graphql/<dataset>/<tag>
    
    // New endpoints 
    https://<yourProjectId>.api.sanity.io/v2023-08-01/graphql/<dataset>/<tag>
    https://<yourProjectId>.apicdn.sanity.io/v2023-08-01/graphql/<dataset>/<tag>

    New features

    This update adds GraphQL support for several recently added Content Lake features:

    Perspectives

    Content Source Maps

    Visual Editing

    Read the updated GraphQL docs to learn how to get started with these features!

    Breaking changes

    This update also introduces several adjustments to how queries are executed, which could potentially impact your query results. Before updating any of your existing v1 queries, make sure you have reviewed the following list of changes:

    Change 1: Empty Match Operator

    Previously, empty match patterns would evaluate as true and return all instances of the relevant type. Going forth, they will evaluate to false, resulting in no output.

    v1 Behavior

    Given the following query, v1 would return all posts:

    query {
      allPost(where: {
        title: {
          matches: ""
        }
      }) {
        title
      }
    }

    v2023-08-01 Behavior:

    In v2023-08-01, the same query now returns no results.

    Replicate v1 Behavior:

    To replicate the behavior of v1, remove the empty match filter.

    Change 2: Processing of Match Patterns

    The method for processing match patterns has changed. Match patterns are now tokenized into terms, and all terms must be present for a match.

    v1 Behavior:

    In v1, this query would return posts where any of the words โ€œquickโ€, โ€œbrownโ€, or โ€œdogโ€ were found in the title:

    query {
      allPost(where: {
        title: {
          matches: "quick brown dog"
        }
      }) {
        title
      }
    }

    v2023-08-01 Behavior:

    In v2023-08-01, the same query will only return posts where the title contains all three words: โ€œquickโ€, โ€œbrownโ€, and โ€œdogโ€.

    Replicate v1 Behavior:

    The v1 behavior of matching individual words in a string cannot be replicated in v2023-08-01.

    Change 3: Negative Limits

    The handling of negative limits has been improved to better align with user expectations.

    v1 Behavior:

    In v1, negative values for the 'limit' parameter did not have the perhaps intuitive effect of reversing the direction of the limit. For example, one might expect that a 'limit' of -1 would exclude the last item from the result set. However, this was not the case, and the following query would return all results:

    query {
      allPost(limit: -1, offset: 0, sort: { _createdAt: DESC }) {
        title
      }
    }

    v2023-08-01 Behavior:

    In v2023-08-01, this query now operates as one might intuitively expect: a 'limit' of -1 effectively excludes the last item from the result set.

    Change 4: Null Ordering

    The handling of null values when sorting has changed.

    v1 Behavior:

    In v1, when sorting documents by a field, if that field contained a null value, the document would not be returned in the query result. For example, consider this query sorting by _createdAt:

    query {
      allPost(limit: 3, sort: { _createdAt: DESC }) {
        title
      }
    }

    If _createdAt is null, the document will not be returned.

    v2023-08-01 Behavior:

    In v2023-08-01, matching documents that have _createdAt set to null are placed first in the returned results.

    Replicate v1 Behavior:

    With this release we have also added a new filter called is_defined you can use this to remove null values from responses.

    query {
      allPost(
        where: { _createdAt: { is_defined: true } }
        limit: 3
        sort: { _createdAt: DESC }
      ) {
        title
      }
    }

    Custom Role Impact

    Custom roles that use custom content resources defined as a GROQ filter will be impacted by the move to the new GraphQL API version.

    With the new GraphQL API version it now uses GROQ version v2021-03-25 to apply the custom content resource GROQ filter as opposed to v1. As such you must inspect the breaking changes to understand if your GROQ filter will continue to work as expected and update it if needed.

    For example, one example is this custom content resource GROQ filter:

    foo[].bar == 'something'

    In v1 this would have returned documents where any foo.bar equals โ€œsomething"

    This behaves differently in v2021-03-21. Using an equality operator with an array traversal is not supported and will return empty results. Instead, these should be rewritten to use the in operator:

    'something' in foo[].bar

    A negation of an array traversal expression, e.g., !(foo[].bar == 'something'), is also impacted in version v2021-03-25. In this version, an equality operation on an array traversal will result in false, so the negation will evaluate to true. Therefore, in v2021-03-21, negating the original expression will return all documents.

2022-03-09

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Temporarily bring back the internal ConfirmDelete component from @sanity/desk-tool which was depended on by certain plugins

    โœจ Highlights

    • Allow using a writable stream as the output destination in the @sanity/export module (thanks @tsolbjor!)

2022-03-01

  • Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the defined `apiVersion` would not be used for document lists in the desk tool structure (thanks @barbogast!) (#3174)

    Other changes

    • Upgrades refractor dependency to ensure a prismjs security upgrade is included (thanks @miketheman!) (#3170)

2023-04-26

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a Sanity Studio:

    npm install sanity@latest

    Improvements

    • Adds support for custom favicons - see https://www.sanity.io/docs/favicons for more information
    • Improves document history performance
    • Enables passing skipVisibilityCheck prop to preview components to avoid flickering when already in the viewport

    ๐Ÿ› Notable bugfixes

    • Fixes virtualized list (arrays) not rendering properly when inside a modal
    • Fixes bug where validation messages on Portable Text annotations were shown twice
    • Improves wording on message shown after successfully deleting a document
    • Fixes issue where unused references are cleared on clicking outside
    • Resolves issue where validation errors are not focused when clicking on an error in the panel
    • Fixes issue where annotation popovers were not scrollable in the Portable Text Editor
    • Fixes a bug in the Portable Text Editor, which could lead to duplicating single sentence content with mixed marks in the editor when overwritten by another text
    • Fixes an issue where creating a portable text annotation and inserting a value inside it would make a listening text editor crash
    • Fixes an issue where documents would sometimes automatically scroll without user actually performing a scroll

2022-12-22

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixed a regression with release 3.1.0 where a custom style in the portable text input would not fallback to be rendered as the normal style when a rendering-component for that style was not defined.

2022-02-01

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Updated File and Image Input

    File component

    • Empty state takes up much less vertical space
    • Field with file selected also takes up less vertical space
    • Display original file name and size
    • Options to download the file or copy the url

    Image component

    • Empty state takes up much less vertical space
    • Image is vertically responsive to the height of the window, taking up less vertical space
    • Images are no longer enlarged to fit the size of the field
    • Options to copy image url and download the image
    File Input
    Image Input

    Improved change indicator highlighting in Portable Text Editor

    PTE review changes

    Updated login status popover to display information about the current user

    • Shows full name, email and login provider of the logged in user
    • Link to project management interface
    Login popover improvements

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where the empty editor placeholder text would sometimes cause focus problems in Webkit.
    • Fixes an issue where multiple types in array input would prevent it from being scrollable

2024-04-30

  • 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.

    โœจ Highlights

    Presence cursors in the Portable Text Editor

    Sanity Studio has always supported real-time collaboration, but you have yet to be able to see where others are working within the Portable Text Editor. By upgrading, you'll get a similar experience to Google Docs when editing block content.

    This release also includes bug fixes for the Portable Text Editor:

    • The Portable Text Editor will now remove the invisible Stega-encoded characters if you copy-paste from a preview using Visual Editing
    • The cursor will not move out of viewpoint when deleting a character in PTE.
    • Creating an annotation at the bottom of a PTE will no longer scroll you to the top.
    • Fixes an issue where changing positions of items of an array within PTE would launch a cryptic error

    Comments and Tasks are now out of beta

    Comments and Tasks are now officially out of beta; hence, we have updated the configuration APIs. Both comments and tasks are enabled by default and for all document types.

    Comments configuration migration

    Configuration during beta:

    // ./sanity.config.ts|js
    
    export default defineConfig({
      // ... rest of config
      document: {
        unstable_comments: {
          enabled: false,
        },
      },
    });
    

    New configuration (remove unstable_):

    // ./sanity.config.ts|js
    
    export default defineConfig({
      // ... rest of config
      document: {
    -   unstable_comments: {
    +   comments: {
          enabled: false,
        },
      },
    });
    

    Tasks configuration migration

    Configuration during beta:

    // ./sanity.config.ts|js
    
    export default defineConfig({
      // ... rest of config
      unstable_tasks: { enabled: false },
    })
    

    New configuration (remove unstable_):

    // ./sanity.config.ts|js
    
    export default defineConfig({
      // ... rest of config
    - unstable_tasks: { enabled: false },
    + tasks: { enabled: false },
    })
    

    Sanity TypeGen improvements

    Thanks for all the feedback about Sanity TypeGen so far! This release ships several improvements and bug fixes:

    • Sanity Typegen now supports count in GROQ projections
    • TypeGen code (sanity.types.ts) is now formatted when a project has a Prettier configuration
    • The TypeGen search path now includes src, app, and sanity folders by default
    • Various bug fixes for type generation
    • Fixes an issue where typegen command would fail on relative imports
    • Fixes a bug where we could not extract or validate schema when the sanity-plugin-mux-input plugin was installed.

    Do continue to give us feedback in #typescript in the community!

    ๐Ÿ› Notable bugfixes

    • Fixes ambiguous aria-labels on some Status buttons
    • Fixes issue with inline text comments that would include an inline object.
    • Fixes toast message for document duplicate action
  • 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.

    โœจ Highlights

    Presence cursors in the Portable Text Editor

    Sanity Studio has always supported real-time collaboration, but you have yet to be able to see where others are working within the Portable Text Editor. By upgrading, you'll get a similar experience to Google Docs when editing block content.

    This release also includes bug fixes for the Portable Text Editor:

    • The Portable Text Editor will now remove the invisible Stega-encoded characters if you copy-paste from a preview using Visual Editing
    • The cursor will not move out of viewpoint when deleting a character in PTE.
    • Creating an annotation at the bottom of a PTE will no longer scroll you to the top.
    • Fixes an issue where changing positions of items of an array within PTE would launch a cryptic error

    Comments and Tasks are now out of beta

    Comments and Tasks are now officially out of beta; hence, we have updated the configuration APIs. Both comments and tasks are enabled by default and for all document types.

    Comments configuration migration

    export default defineConfig({
      // ... rest of config
      document: {
        unstable_comments: {
          enabled: false,
        },
      },
    });

    New configuration (remove unstable_):

    export default defineConfig({
      // ... rest of config
      document: {
    -   unstable_comments: {
    +   comments: {
          enabled: false,
        },
      },
    });

    Tasks configuration migration

    export default defineConfig({
      // ... rest of config
      unstable_tasks: { enabled: false },
    })

    New configuration (remove unstable_):

    export default defineConfig({
      // ... rest of config
    - unstable_tasks: { enabled: false },
    + tasks: { enabled: false },
    })

    Sanity TypeGen improvements

    Thanks for all the feedback about Sanity TypeGen so far! This release ships several improvements and bug fixes:

    • Sanity Typegen now supports count in GROQ projections
    • TypeGen code (sanity.types.ts) is now formatted when a project has a Prettier configuration
    • The TypeGen search path now includes src, app, and sanity folders by default
    • Various bug fixes for type generation
    • Fixes an issue where typegen command would fail on relative imports
    • Fixes a bug where we could not extract or validate schema when the sanity-plugin-mux-input plugin was installed.

    Do continue to give us feedback in #typescript in the community!

    ๐Ÿ› Notable bugfixes

    • Fixes ambiguous aria-labels on some Status buttons
    • Fixes issue with inline text comments that would include an inline object.
    • Fixes toast message for document duplicate action

2021-10-26

    • Fixes a bug where removing an annotation from text would interfere with other annotations within that same block
    • Fixes a bug where the correct version of a document did not appear when selected in the select revision menu
    • CLI now supports an increased maximum dataset name length of up to 64 characters

2023-06-29

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Support for Perspectives in Vision

    Coinciding with today's studio release, we're bringing support for trying out Perspectives in the vision plugin.

    With Perspectives, you can add a single parameter to fetch a either the latest draft (previewDrafts) or latest published (published) version of a document.

    To learn more about Perspectives, read our announcement post or our documentation.

    New Help & Resources menu

    We've consolidated some helpful resources to customize the Studio experience, learn more about our latest updates, and connect with our team. You can also compare your current Studio version to the latest version available.

2023-08-08

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    • Adds new token login method for rare cases when the more secure cookie approach is not viable/wanted
    • Enables specifying authentication options using an object instead of createAuthStore()
    • Adds new is_defined filter to GraphQL APIs, mirroring the defined() function in GROQ. GraphQL APIs will have to be re-deployed to enable the new filter.

    ๐Ÿ› Notable bugfixes

    • Improves performance when fetching projects list as part of the sanity init CLI command
    • Fixes an issue that would give intermittent validation errors for valid string values when using a regex with global flag
    • Fixes an issue where references to undeclared document types would never load
    • Improves error UIs for reference values
    • Improves the changes pane to show path line and change indicator correctly for the following field types:
      • Array of strings (array of type string)
      • Array of tags (array of type string with layout: 'tags')
      • Array of strings (array of type string with options.list)
      • Array of emails (array of type email)

2023-03-15

  • โš ๏ธย THIS IS A MAINTENANCE RELEASE OF A PREVIOUS MAJOR VERSION OF SANITY

    We recommend updating to Sanity Studio v3 which provides exceptional flexibility and an unparalleled developer experience. The core packages for Sanity Studio v2 will only receive critical bug fixes until Dec 7th, 2023

    Please head over to the documentation for Sanity Studio v3 to learn more.

    You can find migration guides from Studio v2 here.

    Installation and upgrading

    Upgrade the v2 version of the Command Line Interface (CLI) with:

    npm install --global @sanity/cli@v2

    Upgrade Sanity Studio with:

    sanity upgrade

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    • Adds getClient() method to reference filter context

    ๐Ÿ› Notable bugfixes

    • Invalid references can now be removed from array inputs
    • Validation error will now appear when missing a _ref in array of items
    • Removes convert to reference button when converting array of references to singular reference
    • patch.execute() now reflects that the second argument is optional

2021-08-11

  • Features


    • Adds a notice for insufficient permissions to references
    • Adds strict dependency checking to all packages
    • Adds better feedback about accepted files when dragging over file and image inputs

    Bugfixes

    • Enforces that DateInput value is constrained to timeStep
    • Fixes issue where importing JSON files would crash the studio build process
    • Fixes an issue where the form was visible above the PTE toolbar in fullscreen mode
    • Adds safeguard against missing .focus() method on components used with the withDocument() higher order component.
    • Adds a visible indicator on the focused day when using arrow keys to navigate through the calendar days in the date input
    • Fixes an issue that in some rare cases could make the preview selection result in an invalid query

2024-03-06

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade your Sanity Studio, run this command in its project folder:

    npm install sanity@latest

    โœจ Highlights

    Inline commenting in Blocks

    Enhance editorial collaboration with the ability to attach comments directly to specific text selections. This feature includes highlight capabilities and ensures a seamless experience with updates and scrolling interactions.

    Comments is available on the Growth plan (30-day free trial on new projects). You can learn more about comments in the documentation.

    ๐Ÿ› Notable bugfixes

    Fixes sluggish document list due to lingering listeners

    We've implemented a cleanup mechanism for edit state listeners to resolve issues that caused the document lists to become sluggish. Prior to this fix, open connections weren't being closed properly, leading to slow performance and potential crashes. If you've been experiencing delays or stability problems in your document lists, this update addresses those concerns.

2023-11-16

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade Sanity Studio, run this command in your project folder:

    npm install sanity@latest

    โœจ Highlights

    Introducing Presentation

    Separating content from presentation shouldnโ€™t create friction. With Presentation, you can work visually โ€“ with a clear view of structured content reuse. Presentation and visual editing is available on all plans.

    Learn more about Presentation in the launch blog post

    Introducing Comments (beta)

    Streamline your content review process. From in-document communication to organized feedback, Comments enhances teamwork across all stages of content creation. The new Comments feature is available for projects on the new Growth plan, and up.

    Learn more about the Comments beta launch

    Desk is now Structure

    With the launch of the new Presentation tool, we have renamed the Desk tool to Structure. There are no changes in APIs at this time and no required code changes. In the near future we will rename the export and add a deprecation warning to the existing deskTool.

    For those that are depending on the old tool name desk in Studio customizations, this identifier changes to structure in this release and you should update your code accordingly.

    Learn more about this change

2021-10-04

  • A complete revamp of the webhooks API, which allows for sophisticated webhook configuration using GROQ. Read more in the docs, or read the announcement blog post.

    Migrating the legacy webhook behavior to GROQ-powered Webhooks

    If you need to recreate the previous webhook behavior โ€“ triggering on all changes, and on a dataset level rather than document-level โ€“ you can do so by following these steps:

    1. Create a webhook set to trigger on create, update and delete
    2. Leave the Filter field empty
    3. Add the following to the Projection field
    // webhook projection
    {
      "transactionId": "Not supported",
      "projectId": sanity::projectId(),
      "dataset": sanity::dataset(),
      "ids": {
        "created": [
        	select(before() == null && after() != null => _id)
        ],
        "deleted": [
          select(before() != null && after() == null => _id)
        ],
        "updated": [
          select(before() != null && after() != null => _id)
        ],
        "all": [
          _id
        ]
      }
    }

    You can also click this link to get a template with the settings described above.

    Other improvements


    In addition to the filter and projection functionality, weโ€™ve made a bunch of other improvements as well:

    • Thereโ€™s a new UI for webhooks in the management interface and a full RESTful API
    • Webhooks can now be edited after you have created them
    • You can enable and disable webhooks
    • Webhook entries contain more metadata, including name, description, and more
    • You can add custom headers, and specify its HTTP method
    • Thereโ€™s a new attempts log that makes troubleshooting and testing easier
    • Webhooks support a secret that will be hashed in the request which you can use to authenticate that the request originates from your project
    • We include idempotency keys in the headers, which you can use when syncing data to verify you havenโ€™t received it before
    • Webhook configurations can be shared via URL
    • Webhooks are now guaranteed to include the content changes that caused them
    • Webhooks will now be retried (and are also rate-limited to 60 per second)
    • We also added a `sanity` namespace to GROQ that can be used in projections

2021-04-28

  • Initial values for any type

    This upgrade extends support for initial values to any field, not just the document type. You can now set initial values on a field that's shared between schema types. It also allows for initial values for fields inside of arrays and the Portable Text editor, which has been a frequent request. Initial values still supports promises if you need to set values from external data sources.

    Initial values for any type

    ๐Ÿ› Notable bugfixes

    • Fixes a few performance regressions in the array input
    • Fixes an issue where the "revert changes"-dialog confirmation would sometimes be hidden behind the form dialog

2023-06-30

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes issue with small hit area for collapsible fieldsets.
    • Fixes an issue where using sanity init on a Next.js project with embedded Studio would result in an error if an outdated version of next-sanity was being used.

2024-03-12

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    To upgrade a Sanity Studio, run this command in its folder:

    npm create sanity@latest
    
    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Resolves an issue where users were not redirected to their original destination after re-authenticating, ensuring seamless access to linked content within the Studio.
    • _projectId and _strengthenOnPublish are now valid values for Initial Value Templates, allowing for Cross Dataset Reference values in templates.
    • Fixes a type bug where the type for defineType and defineField was not being captured correctly.

    Other Features

    • __experimental_search is deprecated in favor of field-level search options for strings and Portable Text arrays. You should now be able to define search weights in your schema, like:
    defineField({
      name: 'title',
      type: 'string',
      options: {
        search: {
          weight: 10,
        },
      },
    })
    • Document Actions can now specify a group, which will allow users to specify whether a specific document action should appear in the footer or in the document's context menu.
    • Adds ability to open the hotspot and crop dialog by double-clicking image preview.

2024-03-05

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Portable Text Editor improvements

    • Inline references and objects will now render with increased default sizes in the Portable Text Editor for easier interaction.
    • Original content keys are now preserved during undo/redo operations in the Portable Text Editor. This change makes for more robust content integrity.

    ๐Ÿ› Notable bugfixes

    • Fixes an issue that allowed files to be dropped behind the open modal, leading to potentially adding files to the wrong input.
    • Fixes a problem where temporary network disruptions could cause the form editor to reload and lose unsaved edits. Now, the form becomes read-only during reconnection, preserving state and changes.
    • Fixes an issue where initial value templates would not accept a target dataset for cross-dataset references.
    • Fixes an issue where the "disabled" state was shown indefinitely for cross-dataset references.
    • Resolves a UI problem where the "cannot upload" message was incorrectly shown for extension-restricted file types during hover.
    • Fixes a bug where certain selections within the Portable Text Editor were being mishandled.
    • Fixes an issue where Comments would show a loading state while the form was reconnecting, preserving user comments during network issues.

2022-03-10

  • Upgrade Sanity Studio with:

    sanity upgrade

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where sanity exec would use an unauthenticated user session for the client

2022-12-21

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    Improved customization and TypeScript support for the Portable Text Input and schemas

    Improved support for custom rendering of the content in the Portable Text input via .components.block, component.inlineBlock and .components.annotation render callbacks for object-like schema types, references and type aliases.

    While this has been possible previously by modifying the block schema locally, these customizations can now also be put directly on the various content types themselves, to be shared between different Portable Text inputs using them. For example you can now customize how an author reference would appear in various Portable Text contexts on the author schema itself.

    Also text specific schema properties like decorators, styles and lists for the block type itself have slighly changed their configuration in order to better align with the rest of the studio. More info: Changes in block schema customization properties.

    If you previously did customization of the editor using your own render callbacks or icons through the .blockEditor property in the block schema, you will get a deprecation warning, but they will still continue to work until further notice.

    Please refer to the documentation for how to customize the block type and the Portable Text editor for v3 of the studio.

    Besides this, the Portable Text input related code and schema types have been given a TypeScript update for better type safety and developer experience.

    Studio appearance

    The user menu now has options to select the appearance (color scheme) of the Studio. The selected appearance is stored in local storage and is reused on the next visit.

    Logo component updates

    The button in the navbar that wraps the custom logo component has no padding anymore. This update is made in order to give the custom logo component full control over how big the button in the navbar should be. Therefore, the custom logo component may need to be updated in order to achieve the previous look. Below is an example of how to recreate the same result as before:

    import {defineConfig} from 'sanity'
    import {Box} from '@sanity/ui'
    
    function MyLogo() {
      return (
        <Box padding={3}> // <-- Wrap your custom logo with a `Box` with `padding={3}`
          <CustomLogo />
        </Box>
      )
    }
    
    export default defineConfig({
      // ... rest of config
    
      studio: {
        components: {
          logo: MyLogo,
        },
      },
    })

    ๐Ÿ› Notable bugfixes

    • This update fixes so that the component in the root config (ie in defineConfig) is the component that receives the result of the props passed on with renderDefault in previous custom components.
    • Fixed an issue with custom sort orders
  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where createAuthStore would incorrectly require a client factory to be passed
    • Fixes an issue where lodash was not optimized in all released Sanity packages
    • Fixes an issue where disabling direct uploads when using multiple asset sources would not work

2021-11-01

  • Fixes an issue causing GraphQL deploys to fail after installing to babel ^7.16.0 see (#2899).

2021-10-07

    • Fixes issue with experimental spaces not loading correctly (#2835)
    • Fixes an issue with nested document lists. (#2834)
    • Fixes an issue that would disallow deleting an unpublished document for users with access to update the draft
    • Fixes an issue that would disable discarding drafts even for users that had access to it

2023-10-18

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    Notable changes

    • Fixes a typo in a validation error message (thanks @largis21!)
    • Fixes an issue where schema error messages would be shown with overlapping text on long titles/field names
    • Improves typescript documentation for portable text/block content related types
    • Adds some metadata to cross-dataset references when deploying GraphQL APIs in order to allow programatically resolving reference

2022-03-08

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    • Adds a check for superfluous image metadata properties being specified
    • The studio now supports authentication for browsers that block third-party cookies

    ๐Ÿ› Notable bugfixes

    • Fixes a bug where document lists would not always show items in the correct order until scrolling down and back up again
    • Fixes a bug where the studio could crash if a user had insufficient permissions to fetch user profiles while collaborating with others
    • Fixes a number of issues with the sanity upgrade command when using --tag or --range
    • Upgraded @sanity/base to use react-refractor version 2.1.6 (thanks @JamesSingleton!)
    • Upgraded @sanity/base to use refractor version 3.6.0 (thanks @miketheman!)

2022-09-08

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli 

    Upgrade Sanity Studio with:

    sanity upgrade 

    โœจ Highlights

    Performance improvements

    This release brings a number of performance improvements, mostly related to excessive re-rendering of components that do not change. Notable improvements are:

    • Better performance for presence indicators when many users are logged in at the same time
    • The Portable Text Editor should be faster and re-render less often

    ๐Ÿ› Notable bugfixes

    • Mitigated an issue that could cause a draft document to be overwritten by an earlier version after publish
    • The Presence list in the toolbar will now only show users who are working in the same dataset

2023-01-17

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    Date range support in global search

    Itโ€™s now possible to easily search for documents between two dates in the global search.

    The global search now accepts filtering on date ranges

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where a configured studio-wide basePath would not be respected in build output, and workspaces would have to manually include the prefix in each workspace base path
    • Enables access to studio-prefixed environment variables through process.env
    • Fixes an issue where replacing the image asset in an image field would sometimes fail silently
    • Fixes an issue where using React components in field titles or descriptions could crash global search

2021-12-06

    • Fixes an issue where desk structures with observables would be stuck loading.
    • Fixes an issue where the new-document dialog would not use the selected template

2023-01-31

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue that in some cases would prevent validation status from appearing for a document
    • Fixes an issue that ignored the readOnly state for fields inside fieldsets

2023-04-18

  • 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.

2024-03-14

  • โœจPersisted user settings

    User settings (like desk list sort orders, view modes, and global search history) are now stored securely server-side by Sanity. This means that these settings do not need to be re-selected across devices or browsers, and will be persisted wherever a user logs into their Studio.

    ๐Ÿ› Notable bugfixes

    • Fixes a bug in the Portable Text Editor where merging two text blocks could result in data loss in the topmost block when several editors are inside the document.
    • The schema migration CLI tooling now always places its output in the project root, and provides better messaging about this.

2024-05-08

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest
    

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest
    

    ๐Ÿ› Notable bugfixes

    • Fixes a regression in Presentation Tool introduced in v3.41.0 that causes it to crash in embedded studios.

2023-07-18

  • Notable changes

    • Added scrolling to list of workspace (when many workspaces are configured)
    • Improved contrast of text in certain tooltips

2023-04-04

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Improves performance when entering text in large documents
    • Fixes the issue where the document pane title, as defined in the desk structure, was not being utilized properly
    • Fixes a problem where intent route would not open the correct desk structure

2023-12-05

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Removes a console warning about using an experimental API version
    • Adds type declarations for the assetRequired rule to validation for image and file schema types
    • Fixes an issue in the Next.js template where the urlForImage function would return a class instead of a url
    • Fixes an issue where the image crop tool would not work on touchscreen devices with connected pointer devices
    • Fixes a bug in the Portable Text Editors drag-and-drop functionality that would make any block which opens in a modal, that was dragged and placed directly above an array block wrongly affect the array, leading to a โ€œCanโ€™t upload this file hereโ€ error
    • Fixes an issue where the --skip-cross-dataset-references flag was not working with sanity dataset import

2024-02-27

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    • Added reference documentation for the sanity/migrate APIs.

    Other features

    • Adds ARIA labels to navbar icons for better accessibility.
    • Fixes an issue in which the free trial popover was shown twice for new users.

    ๐Ÿ› Notable bugfixes

    • Updates placeholder color for Portable Text Editor.

2022-09-21

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    New CLI flags!

    We've added a few new flags to make automation easier!

    The --force flag was added to a few already existing commands and will skip the confirmation prompt and proceed with the command:

    sanity dataset alias unlink <alias-name> --force

    sanity dataset alias delete <alias-name> --force

    sanity dataset delete <dataset-name> --force

    sanity graphql undeploy --dataset <dataset-name> --force

    When added, the --no-open flag prevents the login page from automatically opening in the browser.

    sanity login --provider <provider-name> --no-open

2021-08-17

  • Highlights

    • Migrates `color-input` to `@sanity/ui`
    • Migrates `google-maps-input` to `@sanity/ui`
    • Migrates the document status bar and document actions to `@sanity/ui`
    • Migrates the default preview to `@sanity/ui`

    Bugfixes

    • Adds a visible indicator on the focused day when using arrow keys to navigate through the calendar days in the date input
    • Fixes an issue that in some rare cases could make the preview selection result in an invalid query
    • Fixes an active state issue with `PaneItem` in `DocumentsListPane`

2023-10-03

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a v3 Studio, run this command in its folder:

    npm install sanity@latest

    โœจ Highlights

    Perspectives in listenQuery

    Added support for perspectives in the listenQuery() method

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where reverting all changes to an array of primitives would not clear the list as expected
    • Fixes syntax errors in schema files when initializing a blog template without Typescript in a Next.js app
    • Fixes an issues with array items not showing all items inside a field group under specific conditions
    • Fixes rendering issues with certain popovers being caused by wrong placement
    • Improves accessibility for document lists
    • Fixes an issue that could sometimes make reference validation errors disappear when switching between documents

2022-10-20

  • โœจ Highlights

    Shared Content

    This release introduces support for shared content through cross-dataset references. Read more in the announcement: https://www.sanity.io/blog/shared-content-introduction

    Shared Content: Eliminate Content Debt

    Improved search

    Order search results by relevance, created and last updated date.

    Improved search with option to order by relevance, creation date, update date

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where split panes might not persist after reloading the studio
    • Fixes a bug causing revision history selector to always display the current version instead of the selected revision

2024-04-23

  • 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.

    โœจ Highlights

    Scheduled Publishing is now part of the core Sanity Studio package

    The Scheduled Publishing feature, which up until this release has been available as a plugin for Sanity Studio, has been moved into the core sanity package and enabled by default. Scheduled Publishing is available on all paid plans and trials.

    If you wish to opt out of Scheduled Publishing, you can do so in your Studio configuration

    // sanity.config.ts 
    export default defineConfig({ 
       // ....
       scheduledPublishing: {
           enabled: false, 
         }
      )

    Go to docs and feature announcement blog post to learn more.

    Migrating from the Scheduled Publishing plugin to the new built-in configuration:

    If you are already using Scheduled Publishing plugin, the first step is to get rid of it and update your studio to the latest release. If you already updated your studio you might have gotten an alert about this.

    Run the following command in your project root to uninstall the plugin:

    npm uninstall @sanity/scheduled-publishing

    If you are already using Scheduled Publishing plugin, the first step is to get rid of it and update your studio to the latest release. If you already updated your studio you might have gotten an alert about this.

    Run the following command in your project root to uninstall the plugin:

    npm uninstall @sanity/scheduled-publishing

    Next, remove the plugin from your studio configuration. Typically you'll find this in ./sanity.config.ts|js. Find the scheduledPublishing plugin and do the following changes in your configuration file:

    Before:

    import {scheduledPublishing} from '@sanity/scheduled-publishing'
    
    export default defineConfig({
        //....
        plugins: [
          scheduledPublishing({
            // e.g. 12/25/2024 6:30 AM
            inputDateTimeFormat: 'MM/dd/yyyy h:mm a',
          })
        ]
    })

    After:

    -  import {scheduledPublishing} from '@sanity/scheduled-publishing'
    
    
    export default defineConfig({ 
        // ...
        plugins: [
    -     scheduledPublishing({
    -       inputDateTimeFormat: 'MM/dd/yyyy h:mm a',
    -     })
        ],
    +   scheduledPublishing: {
    +       enabled: true,
    +       inputDateTimeFormat: 'MM/dd/yyyy h:mm a',
    +   }
    })

    If you used any of the plugin's exports, you can now import them directly from the Sanity package. For example:

    -  import { ScheduleAction, resolveDocumentActions } from "@sanity/scheduled-publishing"
    +  import { defineConfig, ScheduleAction, resolveDocumentActions } from "sanity"

    ๐Ÿ› Notable bugfixes

    • Fixes a bug that caused negations to be transformed to wildcard search prefixes if they appeared at the end of a search query.
    • Improves error handling when attempting to run a migration against invalid project configurations.
    • Fixes an issue where a document's validation panel would show a system error message when a field with a validation error was deleted.
    • Fixes a bug that caused _type to be incorrectly parsed from statements in the filter parameter of document lists.
    • Fixes an issue that sometimes caused the Studio to load indefinitely when visited from a task notification email.

2023-01-24

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    Improve readability for document history dates

    The document history timeline now displays full dates in tooltips on hover

2023-01-03

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue that could give false validation errors for complex documents
    • Hides restore action when revision is latest version
    • Improves responsiveness of file and image inputs for narrow widths
    • Restores transition effect when reordering primitive array values
    • Fixes an issue with the vision tool causing the query param errors tooltip disappear behind the above panel

2021-03-26

  • This release upgrades the picosanity dependency that brings support for configuring the client's API version:

    import {
      createClient
    } from 'next-sanity'
    
    const config = {
      dataset: process.env.NEXT_PUBLIC_SANITY_DATASET || 'production',
      projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
      useCdn: process.env.NODE_ENV === 'production',
    
    apiVersion: '2021-03-25'
    } export const sanityClient = createClient(config)

2021-04-26

  • Improved image fields

    The image fields has seen a number of bugfixes and now properly display presence and change indicators, including for hotspot/crop fields and other image fields that opens in dialogs.

    Sanity UI powered reference input

    The default reference input in Sanity Studio has been refactored to use the Autocomplete component from Sanity UI which improves overall accessibility and fixes keyboard navigation bugs.

    Other features

    • The language filter can now be configured with an array of document types to control which schemas the filter will appear on (thanks @spacedawwg!).

    ๐Ÿ› Notable bugfixes

    • Fixes false positive with image fields in dialogs, indicating that thereโ€™s a change when there is none
    • The code input now wraps text inside the input so that all the code is visible without having to scroll horizontally (thanks @katherinepeterson!)

2023-05-15

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    โœจ Highlights

    Document list search

    It's now possible to search within document lists. We've also improved keyboard accessibility, making it much easier to navigate between lists and the document form editor itself.

    ๐Ÿ› Notable bugfixes

    • Fixes issue where Edit intent links that opens the on-screen keyboard in iOS/android while also opening dialogs would break the layout
    • Improves linking to single spans of text in the Portable Text Input
    • Fixes a bug that made fields without a group appear in all groups
    • Fixes a bug with the Portable Text Editor where single span texts could become out of sync with the server value
    • Fixes an issue where an object fieldโ€™s value is not unset when all object field values are empty

2023-05-31

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes and improvements

    • Fixes an issue where change indicators were no longer showing up on boolean fields
    • Adds document action custom dialog component
    • Improves presence rendering performance
    • Improves how focus and selection is handled and tracked in Portable Text fields
    • Adds support for <sup>, <sub>, <ins> and <mark> in @sanity/block-tools
    • Improves how image blocks in Portable Text fields are rendered for custom named image types

2024-04-02

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npm create sanity@latest

    To upgrade a Sanity Studio, run this command in its folder:

    npm install sanity@latest

    Notable changes

    • Increases the default height of the Portable Text editor

    Notable bugfixes

    • Fixes the --enforce-required-fields flag for the sanity typegen generate command not correctly respecting validation rules
    • Fixes a few focus issues where the Portable Text editor would sometimes jump to the start of a block or scroll to a previously opened block on focus inside of the Presentation tool
    • Fixes an issue in which when the tasks panel is open, searching for content in the Cmd + K search changes target document rather than searches the studio

2022-01-17

  • Features:

    • Allow loading more syntaxes for the @sanity/code-input programmatically, see the code input README for more details
    • You can now specify coupon codes when creating a new project using the CLI, by using the --coupon flag, eg sanity init --coupon <code>

    Notable bugfixes:

    • Fixes bug where initial values would no longer work when inserting in arrays
    • Fixes a bug that caused some false warnings with duplicate and update permissions

2021-11-10

  • Fixes an issue causing sanity exec to crash

2023-02-15

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    Notable changes

    • The studio has been upgraded to use @sanity/client v5, which boasts full Node.js ESM runtime support, a smaller footprint and much more

    ๐Ÿ› Notable bugfixes

    • Fixed a bug that could lead to duplication of a single block in the Portable Text Editor

2022-06-20

  • Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

    Upgrade Sanity Studio with:

    sanity upgrade

    โœจ Highlights

    Add command to list information about dataset jobs

    This new command will help users find out the status of jobs without needing the job id.

    `sanity dataset jobs list`

2023-02-01

  • โœจ Highlights

    Enterprise SSO

    This release introduces support for granting project access and roles to users through declarative rules when using SSO. Read more in the announcement blog post.

2023-03-21

  • Installation and upgrading

    To initiate a new Studio without installing the CLI globally:

    npx create-sanity@latest

    To upgrade a v3 Studio:

    npm install sanity@latest

    ๐Ÿ› Notable bugfixes

    • Fixes an issue where an array fieldโ€™s value is not set to undefined when the last item is removed
    • Fixes hydration mismatch issues
    • Fixes an issue where preview panes are not preserved on smaller screens
    • Fixes an issue where the studio may crash when accessing history changes with reduced permissions

2021-09-28

  • Fixes a bug when trying to filter on a Date type