Releases: nuxt-modules/sanity
v1.2.2
v1.2.1
v1.2.0
v1.1.2
v1.1.1
v1.1.0
1.1.0 (2022-02-20)
⚠ BREAKING CHANGES
- If you were relying on the auto-disabling part of this module
Bug Fixes
v1.0.0
1.0.0 (2022-02-17)
Features
👉 Migration
v1 of @nuxtjs/sanity
requires either Nuxt Bridge or Nuxt 3. (If you are using Nuxt 2 without Bridge, you should continue to use v0.10.)
-
The main change between Nuxt 2 -> Nuxt 3 is that there is no longer a globally available
$sanity
helper. If you want to keep the current behaviour, just enable theglobalHelper
option:import { defineNuxtConfig } from 'nuxt3' export default defineNuxtConfig({ modules: ['@nuxtjs/sanity'] sanity: { + globalHelper: true } })
-
Instead of adding
@nuxtjs/sanity/module
you will add@nuxtjs/sanity
in yournuxt.config
import { defineNuxtConfig } from 'nuxt3' export default defineNuxtConfig({ - modules: ['@nuxtjs/sanity/module'] + modules: ['@nuxtjs/sanity'] })
-
You should no longer import helpers like
groq
directly from@nuxtjs/sanity
. These will be available automatically throughout your app using the Nuxt auto-imports feature. If you do need to import them directly you can do so by importing from#imports
.import { groq, useSanity, useSanityQuery } from '#imports'
-
If you are using
<SanityContent>
this now no longer renders a wrapper container. If you need the wrapper, you can add it yourself.<template> - <SanityContent :blocks="blocks" /> + <div> + <SanityContent :blocks="blocks" /> + </div> </template>