Skip to content

v3.49.0

Latest
Compare
Choose a tag to compare
@ricokahler ricokahler released this 02 Jul 21:26
· 6 commits to next since this release

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

New TypeGen Features

Better GROQ Function Coverage

We have added the following improvements to type generation for GROQ query results:

Improved Union Handling in TypeGen

TypeGen now correctly expands all unions inside an object, addressing this reported issue on GitHub. Previously, only a part of a union might be returned. TypeGen now ensures that all object types in a union are expanded and included in the generated types.

// Example query
export const HomePageQuery = groq`*[_type == "page" && slug.current == "homepage"]{
  title,
  components[] {
    _type == "hero" => { title, "image": image.asset->url },
    _type == "cta" => { title, link }
  }
}`;

TyeGen will now generate the following type for the query above:

export type HomePageQueryResult = Array<{
  title: string;
  components: Array<
    | { _type: 'hero'; title: string; image: string }
    | { _type: 'cta'; title: string; link: string }
  >;
}>;

New import path for the Portable Text Editor

We’ve started work on a standalone Portable Text Editor package, and thus transitioned to using the @portabletext/editor package instead of the now deprecated @sanity/portable-text-editor package. This change includes several internal improvements and fixes. You can follow this work in this repository on GitHub — more documentation to come.

Advanced users who have used the @sanity/portable-text-editor dependecy should update to @portabletext/editor to ensure continued support and improvements.

🐛 Notable bugfixes

  • Fixes an issue where FormInput would not render fields inside a fieldset.
  • Various TypeGen bug fixes.

📓 Full changelog

Author Message Commit
Cody Olsen chore(deps): upgrade turbo to v2 (#6985) 2fb8f9b
Nina Andal Aarvik fix(core): change padding to fix tab box (#7000) 7ed682e
Herman Wikner fix(core): handle fieldset members in FormInput (#7045) b932de6
ecospark[bot] chore(deps): dedupe pnpm-lock.yaml (#7034) 8820979
Herman Wikner fix(core): open PTE dialogs in tree editing dialog with openPath (#7046) d0b9ab0
renovate[bot] fix(deps): update dependency groq-js to ^1.10.0 (#7053) 628cb76
Rico Kahler refactor: use @portabletext/editor instead of @sanity/portable-text-editor (#7035) 9864985
renovate[bot] fix(deps): update dependency get-it to ^8.6.2 (#7052) b73b68c
renovate[bot] fix(deps): update dependency @sanity/export to ^3.40.0 (#7056) c44c405