Skip to content

Commit ee4eceb

Browse files
feat: update deps for feb 2026
1 parent 39aec1e commit ee4eceb

File tree

10 files changed

+1165
-935
lines changed

10 files changed

+1165
-935
lines changed

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: 10 additions & 2 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,7 +26,15 @@ 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
29+
const user = getBlockValue(
30+
page.notion_user[Object.keys(page.notion_user)[0]!]
31+
)
32+
if (!user) {
33+
return {
34+
error: 'User not found'
35+
}
36+
}
37+
3038
const name = [user.given_name, user.family_name]
3139
.filter(Boolean)
3240
.join(' ')

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/dev/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: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

44
import bundleAnalyzer from '@next/bundle-analyzer'
55

@@ -24,19 +24,20 @@ export default withBundleAnalyzer({
2424
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;"
2525
},
2626

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-
},
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+
// },
3939

4040
// See https://react-tweet.vercel.app/next#troubleshooting
41+
// TODO: is this still necessary?
4142
transpilePackages: ['react-tweet']
4243
})

package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,38 @@
3838
"classnames": "^2.5.1",
3939
"expiry-map": "^2.0.0",
4040
"fathom-client": "^3.4.1",
41+
"katex": "^0.16.27",
4142
"ky": "^1.8.1",
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",
44+
"next": "^16.1.6",
45+
"notion-client": "^7.8.1",
46+
"notion-types": "^7.8.1",
47+
"notion-utils": "^7.8.1",
4748
"p-map": "^7.0.3",
4849
"p-memoize": "^7.1.1",
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+
"@next/bundle-analyzer": "^16.1.1",
63+
"@types/node": "^25.2.3",
6364
"@types/prismjs": "^1.26.5",
64-
"@types/react": "^19.1.13",
65+
"@types/react": "^19.2.14",
6566
"@types/react-body-classname": "^1.1.10",
6667
"@types/rss": "^0.0.32",
67-
"cross-env": "^10.0.0",
68-
"eslint": "^9.35.0",
68+
"cross-env": "^10.1.0",
69+
"eslint": "^9.39.2",
6970
"npm-run-all2": "^8.0.4",
70-
"prettier": "^3.6.2",
71-
"typescript": "^5.9.2"
71+
"prettier": "^3.7.4",
72+
"typescript": "^5.9.3"
7273
},
7374
"overrides": {
7475
"cacheable-request": {

0 commit comments

Comments
 (0)