Skip to content

Commit a7ad773

Browse files
Rebased PR based on latest master - (Feature) Lazy-Images-Full with local dependencies. (Fix) Replace KY with OFetch. (Fix) Cleaned up unnceccesary and erroneous changes
1 parent d4159d5 commit a7ad773

File tree

22 files changed

+1532
-1130
lines changed

22 files changed

+1532
-1130
lines changed

examples/full/components/NotionPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import dynamic from 'next/dynamic'
22
import Head from 'next/head'
3-
//import Image from 'next/image'
3+
// import Image from 'next/image'
44
import Link from 'next/link'
55
import { useRouter } from 'next/router'
66
import { type ExtendedRecordMap } from 'notion-types'
@@ -182,7 +182,7 @@ export function NotionPage({
182182
previewImages={previewImagesEnabled}
183183
components={{
184184
// NOTE (transitive-bullshit 3/12/2023): I'm disabling next/image for this repo for now because the amount of traffic started costing me hundreds of dollars a month in Vercel image optimization costs. I'll probably re-enable it in the future if I can find a better solution.
185-
//nextImage: Image,
185+
// nextLegacyImage: Image,
186186
nextLink: Link,
187187
Code,
188188
Collection,

examples/full/lib/notion.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export async function getPage(pageId: string): Promise<ExtendedRecordMap> {
3030

3131
return recordMap
3232
}
33+
3334
export async function search(params: SearchParams): Promise<SearchResults> {
3435
if ('search' in notion) {
3536
return notion.search(params)

examples/full/next.config.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
3-
eslint: {
4-
ignoreDuringBuilds: true
5-
},
6-
typescript: {
7-
ignoreBuildErrors: true
8-
},
1+
export default {
2+
staticPageGenerationTimeout: 300,
93
images: {
10-
remotePatterns: [
11-
{ protocol: 'https', hostname: 'www.notion.so' },
12-
{ protocol: 'https', hostname: 'notion.so' },
13-
{ protocol: 'https', hostname: 'images.unsplash.com' },
14-
{ protocol: 'https', hostname: 'abs.twimg.com' },
15-
{ protocol: 'https', hostname: 'pbs.twimg.com' },
16-
{ protocol: 'https', hostname: 's3.us-west-2.amazonaws.com' }
4+
domains: [
5+
'www.notion.so',
6+
'notion.so',
7+
'images.unsplash.com',
8+
'abs.twimg.com',
9+
'pbs.twimg.com',
10+
's3.us-west-2.amazonaws.com'
1711
],
1812
formats: ['image/avif', 'image/webp']
1913
}
2014
}
21-
22-
export default nextConfig

examples/minimal/next.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const nextConfig = {
1+
export default {
22
staticPageGenerationTimeout: 300,
33
images: {
44
domains: [
@@ -10,5 +10,3 @@ const nextConfig = {
1010
formats: ['image/avif', 'image/webp']
1111
}
1212
}
13-
14-
export default nextConfig

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dev": "turbo dev --concurrency 50 --continue --filter='./packages/*'",
1717
"clean": "turbo clean",
1818
"test": "turbo test",
19-
"test:format": "prettier --check \"**/*.{js,ts,tsx}\" --write",
19+
"test:format": "prettier --check \"**/*.{js,ts,tsx}\"",
2020
"test:lint": "turbo test:lint",
2121
"test:typecheck": "turbo test:typecheck",
2222
"test:unit": "turbo test:unit",
@@ -53,4 +53,4 @@
5353
"eslint --fix"
5454
]
5555
}
56-
}
56+
}

packages/notion-client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
"watch": "tsup --watch --silent --onSuccess 'echo build successful'",
2323
"clean": "del build",
2424
"test": "run-s test:*",
25-
"test:lint": "eslint . --fix",
25+
"test:lint": "eslint .",
2626
"test:typecheck": "tsc --noEmit",
2727
"test:unit": "vitest run"
2828
},
2929
"dependencies": {
30-
"got": "catalog:",
30+
"ofetch": "catalog:",
3131
"notion-types": "workspace:*",
3232
"notion-utils": "workspace:*",
3333
"p-map": "catalog:"

0 commit comments

Comments
 (0)