Skip to content

Commit d0165c5

Browse files
committed
feat: introduce dynamicIO
1 parent eb2e08c commit d0165c5

File tree

121 files changed

+349
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+349
-166
lines changed

next.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import type { NextConfig } from 'next';
1+
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
44
// logging: {
55
// fetches: {
66
// fullUrl: true,
77
// },
88
// },
9-
transpilePackages: ["shiki"],
109
experimental: {
10+
dynamicIO: true,
1111
taint: true,
1212
// typedRoutes: true,
1313
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@shikijs/transformers": "^1.22.2",
2020
"algoliasearch": "^4.24.0",
2121
"instantsearch.js": "^4.75.3",
22-
"next": "15.0.1",
22+
"next": "canary",
2323
"react": "^18.3.1",
2424
"react-dom": "^18.3.1",
2525
"react-instantsearch": "^7.13.6",

pnpm-lock.yaml

Lines changed: 49 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/service-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ self.addEventListener("fetch", (e) => {
1111
e.respondWith(
1212
(async () => {
1313
const res = await fetch(e.request);
14-
const createdAt = Date.now();
14+
const createdAt = performance.now();
1515

1616
// res.text() fails is when trying to read the same response stream twice.
1717
const clone = res.clone();

src/app/search/page.tsx renamed to src/app/_search/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Result } from "@/app/_components/search/result";
55
import { SearchBox } from "@/app/_components/search/searchBox";
66
import { client } from "@/app/_utils/algolia";
77
import { Suspense, useState } from "react";
8-
import { Configure } from "react-instantsearch";
9-
import { InstantSearchNext } from "react-instantsearch-nextjs";
8+
// TODO: need to upgrade below
9+
// Error: Route "/(.)search" used `headers().get('x-nonce')`. `headers()` should be awaited before using its value.
10+
// import { Configure } from "react-instantsearch";
11+
// import { InstantSearchNext } from "react-instantsearch-nextjs";
1012
import { meta } from "../examples/data";
1113

12-
export const dynamic = "force-dynamic";
13-
1414
export default function Page() {
1515
const [tag, setTag] = useState<string | null>(null);
1616

@@ -42,7 +42,7 @@ export default function Page() {
4242
))}
4343
</ul>
4444
<div className="flex-1 w-full md:w-0">
45-
<Suspense>
45+
{/* <Suspense>
4646
<InstantSearchNext indexName="examples" searchClient={client}>
4747
<Configure tagFilters={tag ?? undefined} />
4848
<div className="text-gray-200 flex flex-col gap-4">
@@ -55,7 +55,7 @@ export default function Page() {
5555
</footer>
5656
</div>
5757
</InstantSearchNext>
58-
</Suspense>
58+
</Suspense> */}
5959
</div>
6060
</div>
6161
);

src/app/api/now/route.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { NextResponse } from "next/server";
22

3-
export const revalidate = 0;
4-
53
export async function GET() {
64
return NextResponse.json({
7-
now: Date.now(),
5+
now: performance.now(),
86
});
97
}

0 commit comments

Comments
 (0)