Skip to content

Commit c703447

Browse files
Merge pull request transitive-bullshit#748 from transitive-bullshit/feature/update-feb-2026
feat: update deps and next.js
2 parents 02bbeef + 11d3686 commit c703447

13 files changed

Lines changed: 1195 additions & 1083 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ jobs:
1313
node-version:
1414
- 20
1515
- 22
16+
- 24
1617

1718
steps:
1819
- uses: actions/checkout@v4
1920
- uses: pnpm/action-setup@v4
2021
- uses: actions/setup-node@v4
2122
with:
2223
node-version: ${{ matrix.node-version }}
23-
cache: 'pnpm'
24+
cache: "pnpm"
2425

2526
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
2627
- run: pnpm test

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
node_modules/
55
.next/
66
.vercel/
7+
next-env.d.ts

components/NotionPage.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import Image from 'next/legacy/image'
44
import Link from 'next/link'
55
import { useRouter } from 'next/router'
66
import { type PageBlock } from 'notion-types'
7-
import { formatDate, getBlockTitle, getPageProperty } from 'notion-utils'
7+
import {
8+
formatDate,
9+
getBlockTitle,
10+
getBlockValue,
11+
getPageProperty
12+
} from 'notion-utils'
813
import * as React from 'react'
914
import BodyClassName from 'react-body-classname'
1015
import {
@@ -224,7 +229,7 @@ export function NotionPage({
224229
}, [site, recordMap, lite])
225230

226231
const keys = Object.keys(recordMap?.block || {})
227-
const block = recordMap?.block?.[keys[0]!]?.value
232+
const block = getBlockValue(recordMap?.block?.[keys[0]!])
228233

229234
// const isRootPage =
230235
// parsePageId(block?.id) === parsePageId(site?.rootNotionPageId)
@@ -251,7 +256,7 @@ export function NotionPage({
251256
return <Loading />
252257
}
253258

254-
if (error || !site || !block) {
259+
if (error || !site || !block || !recordMap) {
255260
return <Page404 site={site} pageId={pageId} error={error} />
256261
}
257262

lib/acl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { getBlockValue } from 'notion-utils'
2+
13
import { type PageProps } from './types'
24

35
export async function pageAcl({
@@ -35,7 +37,7 @@ export async function pageAcl({
3537
}
3638
}
3739

38-
const rootValue = recordMap.block[rootKey]?.value
40+
const rootValue = getBlockValue(recordMap.block[rootKey])
3941
const rootSpaceId = rootValue?.space_id
4042

4143
if (

lib/get-site-map.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { getAllPagesInSpace, getPageProperty, uuidToId } from 'notion-utils'
1+
import {
2+
getAllPagesInSpace,
3+
getBlockValue,
4+
getPageProperty,
5+
uuidToId
6+
} from 'notion-utils'
27
import pMemoize from 'p-memoize'
38

49
import type * as types from './types'
@@ -60,7 +65,7 @@ async function getAllPagesImpl(
6065
throw new Error(`Error loading page "${pageId}"`)
6166
}
6267

63-
const block = recordMap.block[pageId]?.value
68+
const block = getBlockValue(recordMap.block[pageId])
6469
if (
6570
!(getPageProperty<boolean | null>('Public', block!, recordMap) ?? true)
6671
) {

lib/oembed.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getPageTitle, parsePageId } from 'notion-utils'
1+
import { getBlockValue, getPageTitle, parsePageId } from 'notion-utils'
22

33
import * as config from './config'
44
import { getPage } from './notion'
@@ -26,8 +26,10 @@ export const oembed = async ({
2626
const pageTitle = getPageTitle(page)
2727
if (pageTitle) title = pageTitle
2828

29-
const user = page.notion_user[Object.keys(page.notion_user)[0]!]!.value
30-
const name = [user.given_name, user.family_name]
29+
const user = getBlockValue(
30+
page.notion_user[Object.keys(page.notion_user)[0]!]
31+
)
32+
const name = [user?.given_name, user?.family_name]
3133
.filter(Boolean)
3234
.join(' ')
3335
.trim()

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

next.config.js

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
import path from 'node:path'
2-
import { fileURLToPath } from 'node:url'
1+
// import path from 'node:path'
2+
// import { fileURLToPath } from 'node:url'
33

4-
import bundleAnalyzer from '@next/bundle-analyzer'
5-
6-
const withBundleAnalyzer = bundleAnalyzer({
7-
// eslint-disable-next-line no-process-env
8-
enabled: process.env.ANALYZE === 'true'
9-
})
10-
11-
export default withBundleAnalyzer({
4+
export default {
125
staticPageGenerationTimeout: 300,
136
images: {
147
remotePatterns: [
@@ -24,19 +17,19 @@ export default withBundleAnalyzer({
2417
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;"
2518
},
2619

27-
webpack: (config) => {
28-
// Workaround for ensuring that `react` and `react-dom` resolve correctly
29-
// when using a locally-linked version of `react-notion-x`.
30-
// @see https://github.com/vercel/next.js/issues/50391
31-
const dirname = path.dirname(fileURLToPath(import.meta.url))
32-
config.resolve.alias.react = path.resolve(dirname, 'node_modules/react')
33-
config.resolve.alias['react-dom'] = path.resolve(
34-
dirname,
35-
'node_modules/react-dom'
36-
)
37-
return config
38-
},
20+
// webpack: (config) => {
21+
// // Workaround for ensuring that `react` and `react-dom` resolve correctly
22+
// // when using a locally-linked version of `react-notion-x`.
23+
// // @see https://github.com/vercel/next.js/issues/50391
24+
// const dirname = path.dirname(fileURLToPath(import.meta.url))
25+
// config.resolve.alias.react = path.resolve(dirname, 'node_modules/react')
26+
// config.resolve.alias['react-dom'] = path.resolve(
27+
// dirname,
28+
// 'node_modules/react-dom'
29+
// )
30+
// return config
31+
// },
3932

4033
// See https://react-tweet.vercel.app/next#troubleshooting
4134
transpilePackages: ['react-tweet']
42-
})
35+
}

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,37 @@
3838
"classnames": "^2.5.1",
3939
"expiry-map": "^2.0.0",
4040
"fathom-client": "^3.4.1",
41-
"ky": "^1.8.1",
41+
"katex": "^0.16.28",
42+
"ky": "^1.14.3",
4243
"lqip-modern": "^2.2.1",
43-
"next": "^15.5.3",
44-
"notion-client": "^7.7.0",
45-
"notion-types": "^7.7.0",
46-
"notion-utils": "^7.7.0",
47-
"p-map": "^7.0.3",
48-
"p-memoize": "^7.1.1",
44+
"next": "^16.1.6",
45+
"notion-client": "^7.8.1",
46+
"notion-types": "^7.8.1",
47+
"notion-utils": "^7.8.1",
48+
"p-map": "^7.0.4",
49+
"p-memoize": "^8.0.0",
4950
"posthog-js": "^1.249.4",
5051
"prismjs": "^1.30.0",
51-
"react": "^19.1.1",
52+
"react": "^19.2.4",
5253
"react-body-classname": "^1.3.1",
53-
"react-dom": "^19.1.1",
54-
"react-notion-x": "^7.7.0",
55-
"react-tweet": "^3.2.2",
54+
"react-dom": "^19.2.4",
55+
"react-notion-x": "^7.8.1",
56+
"react-tweet": "^3.3.0",
5657
"react-use": "^17.6.0",
5758
"rss": "^1.2.2"
5859
},
5960
"devDependencies": {
60-
"@fisch0920/config": "^1.2.1",
61-
"@next/bundle-analyzer": "^15.3.3",
62-
"@types/node": "^24.5.2",
61+
"@fisch0920/config": "^1.4.0",
62+
"@types/node": "^25.2.3",
6363
"@types/prismjs": "^1.26.5",
64-
"@types/react": "^19.1.13",
64+
"@types/react": "^19.2.14",
6565
"@types/react-body-classname": "^1.1.10",
6666
"@types/rss": "^0.0.32",
67-
"cross-env": "^10.0.0",
68-
"eslint": "^9.35.0",
67+
"cross-env": "^10.1.0",
68+
"eslint": "^9.39.2",
6969
"npm-run-all2": "^8.0.4",
70-
"prettier": "^3.6.2",
71-
"typescript": "^5.9.2"
70+
"prettier": "^3.8.1",
71+
"typescript": "^5.9.3"
7272
},
7373
"overrides": {
7474
"cacheable-request": {

0 commit comments

Comments
 (0)