Skip to content

chore(deps): update dependency @sanity/client to v8 - #1536

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/sanity-client-8.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/sanity-client-8.x

Conversation

@renovate

@renovate renovate Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
@sanity/client (source) ^7.24.0 → ^8.0.0 age confidence

Release Notes

sanity-io/client (@​sanity/client)

v8.9.0

Compare Source

Minor Changes
  • update client.context types with the latest Context API descriptions (#​1349) (5b9a346)

v8.8.0

Compare Source

Minor Changes
  • collaboration: accept comment anchor, deprecate range (#​1346) (4ce6968)

    Create and update now take a typed anchor (type: "portable-text" with optional fieldValue on the anchor). Deprecated range + top-level fieldValue (and range: null) are still accepted and sent as anchor.

  • export getCommentTargetDocumentRef from @sanity/client/collaboration (#​1343) (71d414a)

    Builds the global document reference a collaboration comment stores in target.document._ref from a resource and a document ID, with no client involved. client.collaboration.comments.getTargetDocumentRef is unchanged and now calls it, reading the resource off the client's configuration.

    Until now the reference could only be built through a client instance, which meant code that needs it somewhere a client should not be fetched or created, such as a state selector, had to reach for one anyway. Pass the same value ClientConfig['resource'] takes, for example {type: 'dataset', id: 'abc123.production'}.

    import { getCommentTargetDocumentRef } from "@sanity/client/collaboration";
    
    getCommentTargetDocumentRef(
      { type: "dataset", id: "abc123.production" },
      "drafts.doc-1"
    );
    // 'dataset:abc123.production:doc-1'
  • collaboration: send clientVersion on comment writes (#​1347) (da15b5e)

  • update client.context types to the latest Context API (#​1348) (69ccdd4)

v8.7.0

Compare Source

Minor Changes
  • abort underlying EventSource request when response fails validation (#​1340) (ba3de6b)

  • add per-resource schema, query and projection registries (#​1334) (b43e033)

    SanitySchemasByResource, SanityQueriesByResource and SanityProjectionsByResource join the existing SanityQueries registry, following the same pattern: a global interface that the interface exported from @sanity/client inherits from, so a generated file can register either way and does not depend on module resolution.

    Each is keyed by a resource, using the same string the App SDK already uses for its runtime cache, projectId.dataset for a dataset. This is what lets two datasets whose schemas disagree register different result types for the same query text, which the flat SanityQueries registry cannot express. Projections add a document-type level, because a projection resolves against whichever document the caller's handle names.

    All three are empty by default and nothing in the client reads them yet. client.fetch and ClientReturn are unchanged, and keep resolving through the flat registry. They exist for consumers that do resource-aware lookups themselves, starting with the App SDK's hooks.

Patch Changes

v8.6.2

Patch Changes

v8.6.1

Patch Changes
  • drop the any-signal dependency and combine abort signals with get-it/any-signal, which uses native AbortSignal.any where it exists and a plain AbortController on Safari 17.0-17.3 (#​1329) (4b5c198)

v8.6.0

Minor Changes
  • conversation sharing opt-in and createdBy reach client.context types (#​1317) (2459ebe)
Patch Changes
  • use any-signal instead of AbortSignal.any so cancellable requests work on Safari 17.0-17.3 (#​1326) (f87523e)

v8.5.0

Minor Changes
  • read query result types from a global SanityQueries interface (#​1319) (18313fe)

    Query result types can now be registered on a global SanityQueries interface, which the SanityQueries interface exported from @sanity/client inherits from. client.fetch, ClientReturn and ClientReturnStega resolve registrations made either way, so the declare module '@sanity/client' augmentation that Sanity TypeGen has emitted so far keeps working unchanged. The global registry does not depend on module resolution: it is seen whether or not @sanity/client is a direct dependency of the generated file, however many copies of the client are installed, and from every entry point including @sanity/client/stega.

Patch Changes

v8.4.0

Compare Source

Minor Changes
  • add description field to dataset (#​1182) (027be06)
  • add client.context with knowledge bases, builds, triage, telemetry, and GROQ reads (#​1276) (1e991a7)
Patch Changes

v8.3.0

Compare Source

Minor Changes
  • invoke functions synchronously or asynchronously (#​1295) (d1667c7)

    client.functions.invoke() now takes an options argument and accepts sanity.function.durable
    and sanity.function.queue functions alongside sanity.function.pubsub.

    By default the invocation is queued: the call resolves with undefined as soon as the
    service accepts it, without waiting for the function to run. Pass {sync: true} to keep the
    request open until the function finishes and resolve with its return value — that adds a
    ?sync=true query parameter to the invoke request, and remains limited to
    sanity.function.pubsub.

    // Async — resolves once accepted, with no return value.
    await client.functions.invoke("my-func", {
      event: { data: { hello: "world" } },
    });
    
    // Sync — resolves with whatever the function returns.
    const result = await client.functions.invoke<Result>(
      "my-func",
      { event: { data: { hello: "world" } } },
      { sync: true }
    );

    The return type follows the option: a call with {sync: true} resolves with R, while an async
    call resolves with undefined. Callers who pass an explicit type argument without {sync: true}
    keep the previous R | undefined shape.

  • collaboration: resolve comment range from optional fieldValue (#​1299) (88073e6)

v8.2.0

Compare Source

Minor Changes
  • add collaboration comments client (@alpha) (#​1235) (5906f72)

  • add variant actions (#​1279) (dd25720)

    Adds CreateVariantAction, EditVariantAction, DeleteVariantAction, PublishVariantAction and
    UnpublishVariantAction, along with a VariantAction union, covering the
    sanity.action.document.variant.* actions. They are included in the Action union, so
    client.action() accepts them.

    Each action addresses a variant document by the publishedId, variantId and bundleId triple
    rather than by document ID, since the API derives the document ID from those three values.

    Note that Action widening is a breaking change for code that exhaustively switches on
    Action['actionType'] with a never fallthrough, which will need to handle the new cases.

v8.1.0

Compare Source

Minor Changes
  • add client.functions.invoke() for calling deployed functions on demand (#​1258) (4c2f718)

    Invoke a Sanity Pubsub Function by the name. Only sanity.function.pubsub functions can be
    invoked on demand.

    Available in two forms, client.functions.invoke() resolves with the function's return value, client.observable.functions.invoke() emits it and accepts an event.data payload,
    a per-call timeout and an AbortSignal.

    Names are only unique within a stack, so resolving one requires a stackId, either from the new
    stackId client config option or from the request. That resolution costs one extra request per
    call. A function that returns nothing resolves to undefined.

    Stacks deployed at organization scope are reached with the new organizationId client config
    option, or a per-call organizationId. It takes precedence over projectId, which becomes
    optional in that case.

  • add request handler for client integrations (#​1286) (a9db52f)

  • add variant definition actions (#​1278) (7c98361)

    Adds CreateVariantDefinitionAction, EditVariantDefinitionAction and
    DeleteVariantDefinitionAction, along with a VariantDefinitionAction union, covering the
    sanity.action.variant.definition.* actions. They are included in the Action union, so
    client.action() accepts them.

    Note that Action widening is a breaking change for code that exhaustively switches on
    Action['actionType'] with a never fallthrough, which will need to handle the new cases.

Patch Changes
  • route the live-events CORS probe through the configured transport (#​1282) (aaada67)

    The /check/cors probe that client.live.events() uses to distinguish a CORS
    rejection from other connection failures called the global fetch directly, so
    a custom resolveFetch or an explicit proxy was not applied to it. It now
    resolves the same fetch the EventSource connection uses.

  • reword the createVersion() warning about baseId (#​1282) (aaada67)

    createVersion({document}) warned that "the recommended approach is to provide a baseId and releaseId instead", which reads as a correction even when the caller had no other option: baseId creates a version of a document that already exists, so creating a genuinely new document inside a release can only be done by passing document.

    The client cannot tell those two cases apart, so the warning is now phrased as a condition rather than a correction: "If you are creating a version of a document that already exists, prefer providing baseId and releaseId instead." No behavior changed, and both forms remain supported.

  • correct the return type of delete() and mutate() when called with no options (#​1282) (aaada67)

    client.delete(id) and client.mutate(mutations) were typed to resolve to a
    document (SanityDocument<R>) when called without an options argument, but
    they actually resolve to a mutation result object
    ({transactionId, documentIds, results}, MultipleMutationResult). The
    document is genuinely mutated, but code that read ._id off the resolved
    value was reading undefined at runtime without any type error. The
    underlying method (create()) does return the document by default, so this
    was easy to assume also held for delete() and mutate() - it does not.

    Both methods now correctly type as resolving to MultipleMutationResult by
    default, matching the (unchanged) runtime behavior, on both the
    promise-based and observable clients.

    Released as a patch rather than a major even though a declared type changed. Code that read ._id off the result was reading undefined at runtime, so no working application can have depended on the old type: anything that type-checked against it was already broken when it ran. What changes is that the mistake is now visible at compile time instead of at runtime.

    If tsc starts failing on one of these calls, that failure is pointing at a real bug. To fix it:

    • To get the document back, pass {returnFirst: true, returnDocuments: true}
      explicitly: await client.delete(id, {returnFirst: true, returnDocuments: true}).
    • To keep the mutation-result shape, read documentIds (or documentId with
      returnFirst: true) off the result instead of _id.

    No runtime behavior changed - this only corrects the public types.

  • populate server-sent event IDs on Cloudflare Workers (#​1282) (aaada67)

    client.live.events() and client.listen() read lastEventId off the
    MessageEvent that eventsource constructs. workerd does not carry that member
    through the MessageEvent constructor's init dict, so on bare Cloudflare Workers
    every event arrived with an empty id. Raising the eventsource floor to
    >= 5.1.0 picks up the fix.

  • return the asset from assets.upload() against a Media Library (#​1282) (aaada67)

    client.assets.upload() resolved to undefined when the client was configured against a Media Library (resource: {type: 'media-library', id}), even though the upload succeeded server-side. Content Lake's upload endpoint responds with {document: {...}}, and upload() unwrapped that key unconditionally - but the Media Library upload endpoint responds with {asset: {...}} instead, so the unwrap produced undefined.

    upload() now unwraps .asset for a Media Library response and .document otherwise, on both the promise-based and observable clients. It resolves to the uploaded asset instead of undefined.

    The Media Library asset shape is not the same as a Content Lake asset document: it is a sanity.asset document that tracks one or more uploaded versions via currentVersion/versions, rather than a document with url, size, mimeType, and so on. That shape is now exported as MediaLibraryAssetDocument.

    The declared return type is knowingly incomplete, and this is a patch on purpose. Which shape you get back depends on how the client is configured, not on the arguments to upload(), so no overload can discriminate it. Expressing it would mean widening the return type into a union that every existing caller has to narrow - a breaking change for all users, to correct the typing of a much less common configuration. So the declared type still describes only the Content Lake shape. If you upload to a Media Library, narrow the result yourself (for example, check for currentVersion) or annotate it as SanityImageAssetDocument | MediaLibraryAssetDocument. Typing this accurately is deferred to the next major.

v8.0.0

Compare Source

Major Changes
  • require node 22.12 or higher, use fetch (#​1217) (29b9601)

    • Node 22.12+ is required. The package is ESM-only and no longer ships CommonJS runtime or declaration files.
    • HttpRequestEvent, ResponseEvent, and ProgressEvent are removed. Observable asset uploads now emit UploadEvent<T>.
    • unstable__adapter and unstable__environment exports are removed.
    • Observable asset uploads emit progress events only in browsers. Node and edge runtimes emit only the terminal response event.
    • ClientError and ServerError messages now include the HTTP status text.
    • The deprecated internal _requestHandler client config option and RequestHandler type are removed.
    • The requester client config option is removed. Use headers configuration and a custom fetch instead.
    • The per-request proxy option is removed. Configure proxy on the client or through proxy environment variables.
    • Changes to HTTP_PROXY, HTTPS_PROXY, and NO_PROXY after process startup no longer affect requests.
    • DNS ENOTFOUND errors are retried for idempotent requests. Set maxRetries: 0 to fail immediately.
    • The internal HttpRequest contract now uses get-it v9 fetch-shaped request options instead of the v8 request shape.
    • A caller-provided internal config.resolveFetch takes precedence over the environment resolver.
    • The UMD bundle is removed from the distribution. Use a bundler or a service such as esm.sh.
    • typesVersions declarations are removed. Use TypeScript moduleResolution set to node16, nodenext, or bundler.
    • The main and module package fields are removed. Consumers must resolve the package through exports.
Patch Changes
  • restore editor autocomplete for StackablePerspective and StudioBaseUrl (#​1264) (5b0e529)

    Both types applied the & {} autocomplete idiom around the whole union rather than around the
    string member, as in ('published' | 'drafts' | string) & {}. That collapses to plain string,
    so editors offered no completions for published or drafts, and the three template literal
    patterns in StudioBaseUrl had no effect. Assignability is unchanged, so this only adds
    suggestions that were always intended to be there.

  • deps: update dependency nanoid to v6 (#​1267) (c6fc253)


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "on Monday"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@netlify

netlify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nuxt-sanity-module ready!

Name Link
🔨 Latest commit a1ce3a5
🔍 Latest deploy log https://app.netlify.com/projects/nuxt-sanity-module/deploys/6abd9f563d64d10009ea3017
😎 Deploy Preview https://deploy-preview-1536--nuxt-sanity-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxtjs/sanity@1536

commit: a1ce3a5

@renovate
renovate Bot force-pushed the renovate/sanity-client-8.x branch 4 times, most recently from de94512 to 5522f4b Compare August 24, 2026 07:35
@renovate
renovate Bot force-pushed the renovate/sanity-client-8.x branch 3 times, most recently from 1040748 to 9bd0180 Compare August 28, 2026 21:18
@renovate
renovate Bot force-pushed the renovate/sanity-client-8.x branch 4 times, most recently from 9031f54 to ff3c607 Compare September 7, 2026 19:48
@renovate
renovate Bot force-pushed the renovate/sanity-client-8.x branch 2 times, most recently from 15080d6 to 696b4ef Compare September 14, 2026 08:05
@renovate
renovate Bot force-pushed the renovate/sanity-client-8.x branch from 696b4ef to 746f85f Compare September 17, 2026 00:02
@renovate
renovate Bot force-pushed the renovate/sanity-client-8.x branch 3 times, most recently from 2dcf873 to 39360b3 Compare September 29, 2026 19:43
@renovate
renovate Bot force-pushed the renovate/sanity-client-8.x branch from 39360b3 to a1ce3a5 Compare September 30, 2026 23:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants