-
-
-
- -
- Get started by editing{' '}
-
- src/app/page.tsx
-
- .
-
- - Save and see your changes instantly.
-
+const DEMO_QUERY = defineQuery(
+ `*[_type == "demo" && slug.current == $slug][0]{title,"fetchedAt": dateTime(now())}`,
+)
+const slug = 'next-15'
+
+export async function generateMetadata(): Promise {
+ const {data} = await sanityFetch({query: DEMO_QUERY, params: {slug}})
+ return {
+ title: data?.title || 'Next 15',
+ }
+}
-
-
-
+export default async function Home() {
+ const {data} = await sanityFetch({query: DEMO_QUERY, params: {slug}})
+
+ return (
+
+
+ {data?.title || 'Next 15'}
+
+ {data?.fetchedAt && (
+
+
+
+ )}
)
}
diff --git a/next-15/src/sanity/client.ts b/next-15/src/sanity/client.ts
new file mode 100644
index 0000000..193a296
--- /dev/null
+++ b/next-15/src/sanity/client.ts
@@ -0,0 +1,8 @@
+import {createClient} from '@sanity/client'
+
+export const client = createClient({
+ projectId: 'hiomol4a',
+ dataset: 'lcapi',
+ apiVersion: '2024-09-21',
+ useCdn: false,
+})
diff --git a/next-15/src/sanity/fetch.ts b/next-15/src/sanity/fetch.ts
new file mode 100644
index 0000000..8651009
--- /dev/null
+++ b/next-15/src/sanity/fetch.ts
@@ -0,0 +1,18 @@
+import {type QueryParams} from '@sanity/client'
+import {client} from './client'
+
+export async function sanityFetch
({
+ query,
+ params = {},
+}: {
+ query: QueryString
+ params?: QueryParams
+}) {
+ // Uncached query that fetches cache tags (on Next 15 uncached doesn't mean on every browser request, but on every ISR build)
+ const {syncTags: tags} = await client.fetch(query, params, {
+ filterResponse: false,
+ tag: 'fetch-sync-tags', // The request tag makes the fetch unique, avoids deduping with the cached query that has tags
+ })
+ const data = await client.fetch(query, params, {next: {revalidate: false, tags}})
+ return {data, tags}
+}
diff --git a/next-15/tailwind.config.ts b/next-15/tailwind.config.ts
index 1c54c9b..f3b29eb 100644
--- a/next-15/tailwind.config.ts
+++ b/next-15/tailwind.config.ts
@@ -8,9 +8,19 @@ export default {
],
theme: {
extend: {
- colors: {
- background: 'var(--background)',
- foreground: 'var(--foreground)',
+ backgroundColor: {
+ 'theme': 'var(--theme-background,#fff)',
+ 'theme-button': 'var(--theme-text,#fff)',
+ },
+ textColor: {
+ 'theme': 'var(--theme-text,#000)',
+ 'theme-button': 'var(--theme-background,#fff)',
+ },
+ ringColor: {
+ theme: 'var(--theme-text,#000)',
+ },
+ ringOffsetColor: {
+ theme: 'var(--theme-background,#fff)',
},
},
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ede7f62..8710bfc 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -84,7 +84,7 @@ importers:
version: 3.64.2
next:
specifier: 13.5.7
- version: 13.5.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ version: 13.5.7(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react:
specifier: ^18
version: 18.3.1
@@ -130,13 +130,16 @@ importers:
version: 3.64.2
next:
specifier: 14.2.18
- version: 14.2.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ version: 14.2.18(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react:
specifier: ^18
version: 18.3.1
react-dom:
specifier: ^18
version: 18.3.1(react@18.3.1)
+ use-effect-event:
+ specifier: ^1.0.2
+ version: 1.0.2(react@18.3.1)
devDependencies:
'@types/node':
specifier: ^20
@@ -173,13 +176,16 @@ importers:
version: 3.64.2
next:
specifier: 15.0.3
- version: 15.0.3(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
+ version: 15.0.3(@babel/core@7.26.0)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
react:
specifier: rc
version: 19.0.0-rc.1
react-dom:
specifier: rc
version: 19.0.0-rc.1(react@19.0.0-rc.1)
+ use-effect-event:
+ specifier: ^1.0.2
+ version: 1.0.2(react@19.0.0-rc.1)
devDependencies:
'@types/node':
specifier: ^20
@@ -216,7 +222,7 @@ importers:
version: 3.64.2
next:
specifier: canary
- version: 15.0.4-canary.22(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
+ version: 15.0.4-canary.22(@babel/core@7.26.0)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
react:
specifier: rc
version: 19.0.0-rc.1
@@ -262,7 +268,7 @@ importers:
version: 3.64.2
next:
specifier: 15.0.3
- version: 15.0.3(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
+ version: 15.0.3(@babel/core@7.26.0)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
react:
specifier: rc
version: 19.0.0-rc.1
@@ -10319,9 +10325,9 @@ snapshots:
react-dom: 19.0.0-rc.1(react@19.0.0-rc.1)
tslib: 2.8.1
- '@dnd-kit/modifiers@6.0.1(@dnd-kit/core@6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)':
+ '@dnd-kit/modifiers@6.0.1(@dnd-kit/core@6.1.0(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(react@18.3.1)':
dependencies:
- '@dnd-kit/core': 6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ '@dnd-kit/core': 6.1.0(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
'@dnd-kit/utilities': 3.2.2(react@18.3.1)
react: 18.3.1
tslib: 2.8.1
@@ -10333,9 +10339,9 @@ snapshots:
react: 19.0.0-rc.1
tslib: 2.8.1
- '@dnd-kit/sortable@7.0.2(@dnd-kit/core@6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)':
+ '@dnd-kit/sortable@7.0.2(@dnd-kit/core@6.1.0(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(react@18.3.1)':
dependencies:
- '@dnd-kit/core': 6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ '@dnd-kit/core': 6.1.0(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)
'@dnd-kit/utilities': 3.2.2(react@18.3.1)
react: 18.3.1
tslib: 2.8.1
@@ -16991,7 +16997,7 @@ snapshots:
neotraverse@0.6.18: {}
- next@13.5.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
+ next@13.5.7(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
'@next/env': 13.5.7
'@swc/helpers': 0.5.2
@@ -17000,7 +17006,7 @@ snapshots:
postcss: 8.4.31
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
- styled-jsx: 5.1.1(react@18.3.1)
+ styled-jsx: 5.1.1(@babel/core@7.26.0)(react@18.3.1)
watchpack: 2.4.0
optionalDependencies:
'@next/swc-darwin-arm64': 13.5.7
@@ -17016,7 +17022,7 @@ snapshots:
- '@babel/core'
- babel-plugin-macros
- next@14.2.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
+ next@14.2.18(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
'@next/env': 14.2.18
'@swc/helpers': 0.5.5
@@ -17026,7 +17032,7 @@ snapshots:
postcss: 8.4.31
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
- styled-jsx: 5.1.1(react@18.3.1)
+ styled-jsx: 5.1.1(@babel/core@7.26.0)(react@18.3.1)
optionalDependencies:
'@next/swc-darwin-arm64': 14.2.18
'@next/swc-darwin-x64': 14.2.18
@@ -17041,7 +17047,7 @@ snapshots:
- '@babel/core'
- babel-plugin-macros
- next@15.0.3(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1):
+ next@15.0.3(@babel/core@7.26.0)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1):
dependencies:
'@next/env': 15.0.3
'@swc/counter': 0.1.3
@@ -17051,7 +17057,7 @@ snapshots:
postcss: 8.4.31
react: 19.0.0-rc.1
react-dom: 19.0.0-rc.1(react@19.0.0-rc.1)
- styled-jsx: 5.1.6(react@19.0.0-rc.1)
+ styled-jsx: 5.1.6(@babel/core@7.26.0)(react@19.0.0-rc.1)
optionalDependencies:
'@next/swc-darwin-arm64': 15.0.3
'@next/swc-darwin-x64': 15.0.3
@@ -17066,7 +17072,7 @@ snapshots:
- '@babel/core'
- babel-plugin-macros
- next@15.0.4-canary.22(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1):
+ next@15.0.4-canary.22(@babel/core@7.26.0)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1):
dependencies:
'@next/env': 15.0.4-canary.22
'@swc/counter': 0.1.3
@@ -17076,7 +17082,7 @@ snapshots:
postcss: 8.4.31
react: 19.0.0-rc.1
react-dom: 19.0.0-rc.1(react@19.0.0-rc.1)
- styled-jsx: 5.1.6(react@19.0.0-rc.1)
+ styled-jsx: 5.1.6(@babel/core@7.26.0)(react@19.0.0-rc.1)
optionalDependencies:
'@next/swc-darwin-arm64': 15.0.4-canary.22
'@next/swc-darwin-x64': 15.0.4-canary.22
@@ -18527,8 +18533,8 @@ snapshots:
sanity@3.64.2(@types/node@20.17.6)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(terser@5.36.0)(types-react@19.0.0-rc.1):
dependencies:
'@dnd-kit/core': 6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- '@dnd-kit/modifiers': 6.0.1(@dnd-kit/core@6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
- '@dnd-kit/sortable': 7.0.2(@dnd-kit/core@6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
+ '@dnd-kit/modifiers': 6.0.1(@dnd-kit/core@6.1.0(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(react@18.3.1)
+ '@dnd-kit/sortable': 7.0.2(@dnd-kit/core@6.1.0(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(react@18.3.1)
'@dnd-kit/utilities': 3.2.2(react@18.3.1)
'@juggle/resize-observer': 3.4.0
'@portabletext/editor': 1.10.2(@sanity/block-tools@3.64.2(debug@4.3.7))(@sanity/schema@3.64.2(debug@4.3.7))(@sanity/types@3.64.2(debug@4.3.7))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(types-react@19.0.0-rc.1)
@@ -19237,15 +19243,19 @@ snapshots:
stylis: 4.3.2
tslib: 2.6.2
- styled-jsx@5.1.1(react@18.3.1):
+ styled-jsx@5.1.1(@babel/core@7.26.0)(react@18.3.1):
dependencies:
client-only: 0.0.1
react: 18.3.1
+ optionalDependencies:
+ '@babel/core': 7.26.0
- styled-jsx@5.1.6(react@19.0.0-rc.1):
+ styled-jsx@5.1.6(@babel/core@7.26.0)(react@19.0.0-rc.1):
dependencies:
client-only: 0.0.1
react: 19.0.0-rc.1
+ optionalDependencies:
+ '@babel/core': 7.26.0
stylehacks@7.0.4(postcss@8.4.49):
dependencies: