Skip to content

Commit 7ec3072

Browse files
committed
Update Next & React
1 parent 3a74af0 commit 7ec3072

16 files changed

Lines changed: 2281 additions & 2109 deletions

File tree

package-lock.json

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

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"description": "httptoolkit.com",
66
"main": "n/a",
77
"scripts": {
8-
"dev": "next dev",
8+
"dev": "next dev --webpack",
99
"dev-docker": "npm run build && docker build . --tag htk-website && docker run --rm -it -p 8080:80 htk-website",
10-
"build": "next build && next-image-export-optimizer",
10+
"build": "next build --webpack && next-image-export-optimizer",
1111
"analyze-bundle": "ANALYZE=true npm run build",
1212
"start": "next start -p 4000",
1313
"check-types": "tsc --noemit",
@@ -25,15 +25,15 @@
2525
},
2626
"homepage": "https://github.com/httptoolkit/httptoolkit-website",
2727
"dependencies": {
28-
"@docsearch/react": "^3.6.0",
28+
"@docsearch/react": "^3.9.0",
2929
"@httptoolkit/accounts": "^3.0.1",
3030
"@httptoolkit/util": "^0.1.5",
3131
"@linaria/core": "^7.0.0",
3232
"@linaria/react": "^7.0.1",
3333
"@phosphor-icons/react": "^2.1.10",
34-
"@radix-ui/react-accordion": "^1.1.2",
35-
"@radix-ui/react-dropdown-menu": "^2.0.6",
36-
"@radix-ui/react-tooltip": "^1.0.7",
34+
"@radix-ui/react-accordion": "^1.2.13",
35+
"@radix-ui/react-dropdown-menu": "^2.1.17",
36+
"@radix-ui/react-tooltip": "^1.2.9",
3737
"@wyw-in-js/babel-preset": "^1.0.6",
3838
"@wyw-in-js/transform": "^1.0.6",
3939
"date-fns": "^1.29.0",
@@ -42,34 +42,34 @@
4242
"lodash-es": "^4.18.1",
4343
"marked": "^12.0.0",
4444
"mobx": "^6.12.1",
45-
"mobx-react-lite": "^4.0.6",
46-
"next": "^14.2.35",
47-
"next-image-export-optimizer": "^1.12.3",
48-
"next-mdx-remote": "^4.4.1",
45+
"mobx-react-lite": "^4.1.1",
46+
"next": "^16.2.6",
47+
"next-image-export-optimizer": "^1.20.1",
48+
"next-mdx-remote": "^6.0.0",
4949
"next-sitemap": "^4.2.3",
5050
"next-themes": "^0.2.1",
5151
"next-with-linaria": "^1.3.0",
5252
"posthog-js": "^1.359.1",
5353
"prismjs": "^1.27.0",
54-
"react": "^18.2.0",
55-
"react-dom": "^18.2.0",
54+
"react": "^19.2.6",
55+
"react-dom": "^19.2.6",
5656
"react-fast-marquee": "^1.6.4",
57-
"react-intersection-observer": "^9.8.2",
58-
"react-plock": "^3.1.0",
57+
"react-intersection-observer": "^9.16.0",
58+
"react-plock": "^3.6.1",
5959
"server-only": "^0.0.1",
60-
"vaul": "^0.9.0"
60+
"vaul": "^1.1.2"
6161
},
6262
"devDependencies": {
6363
"@commitlint/cli": "^17.4.4",
6464
"@commitlint/config-conventional": "^17.6.6",
65-
"@next/bundle-analyzer": "^14.2.1",
65+
"@next/bundle-analyzer": "^16.2.6",
6666
"@svgr/webpack": "^8.1.0",
6767
"@types/lodash-es": "^4.17.12",
6868
"@types/mdx": "^2.0.11",
6969
"@types/node": "^20",
7070
"@types/prismjs": "^1.26.3",
71-
"@types/react": "^18",
72-
"@types/react-dom": "^18",
71+
"@types/react": "^19.2.14",
72+
"@types/react-dom": "^19.2.3",
7373
"html-minifier": "^4.0.0",
7474
"rss": "^1.2.2",
7575
"showdown": "^2.1.0",

src/app/(documentation)/docs/[...slug]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { optimizeExcerptToMetaDescription } from '@/lib/utils';
1010
import { buildMetadata } from '@/lib/utils/build-metadata';
1111

1212
type DocPageProps = {
13-
params: { slug: string[] };
13+
params: Promise<{ slug: string[] }>;
1414
};
1515

1616
export async function generateMetadata({ params }: DocPageProps): Promise<Metadata> {
17-
const slug = params.slug;
17+
const { slug } = await params;
1818
const realSlug = slug[slug.length - 1];
1919
const doc = await getDocBySlug(realSlug);
2020

@@ -39,7 +39,7 @@ export async function generateStaticParams() {
3939
const githubDocsUrl = 'https://github.com/httptoolkit/httptoolkit-website/blob/main/src/content/docs';
4040

4141
export default async function DocsPage({ params }: DocPageProps) {
42-
const { slug } = params;
42+
const { slug } = await params;
4343
const realSlug = slug[slug.length - 1];
4444
const { title, content: Content } = await getDocBySlug(realSlug);
4545
const [filePath] = findFile(ROOT_DOCS_DIRECTORY, realSlug, '.mdx', true);

src/app/blog/[slug]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import { NEWSLETTER_URLS } from '@/components/modules/newsletter/newsletter.valu
1616
import { EditOnGithub } from '@/components/elements/edit-on-github';
1717

1818
type BlogPostPageProps = {
19-
params: { slug: string };
19+
params: Promise<{ slug: string }>;
2020
};
2121

2222
export async function generateMetadata({ params }: BlogPostPageProps): Promise<Metadata> {
23-
const slug = params.slug;
23+
const { slug } = await params;
2424
const post = await getPostBySlug(slug);
2525

2626
const metaDescription = post.excerpt ? optimizeExcerptToMetaDescription(post.excerpt) : undefined;
@@ -58,7 +58,7 @@ export async function generateStaticParams() {
5858
const githubBlogUrl = 'https://github.com/httptoolkit/httptoolkit-website/blob/main/src/content/posts';
5959

6060
export default async function BlogPostPage({ params }: BlogPostPageProps) {
61-
const { slug } = params;
61+
const { slug } = await params;
6262
const post = await getPostBySlug(slug);
6363
const postNavigation = await getBlogTitlesBySlug(slug);
6464
const editUrl = `${githubBlogUrl}/${slug}.mdx`;

src/app/blog/[slug]/post-share/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import dynamic from 'next/dynamic';
2-
31
import { styled } from '@linaria/react';
42

3+
import WebShare from '@/components/modules/social-share/web-share';
54
import { TwitterX, RedditLogo, DevToLogo, YCombinator, ProductHuntLogo, Butterfly } from '@/components/elements/icon';
65
import { SquareIcon } from '@/components/elements/square-icon';
76
import Stack from '@/components/elements/stack';
87
import { Text } from '@/components/elements/text';
98
import { siteMetadata } from '@/lib/site-metadata';
109

11-
const WebShare = dynamic(() => import('@/components/modules/social-share/web-share'), { ssr: false });
12-
1310
interface SocialShareProps extends Pick<Post, 'socialLinks'> {
1411
postTitle?: string;
1512
postUrl?: string;

src/app/download/[slug]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import { getDownloadOptionsDictionary } from '@/content/data/download-dictionary
2424
import { buildMetadata } from '@/lib/utils/build-metadata';
2525

2626
type DownloadPageProps = {
27-
params: { slug: string };
27+
params: Promise<{ slug: string }>;
2828
};
2929

3030
export async function generateMetadata({ params }: DownloadPageProps): Promise<Metadata> {
31-
const slug = params.slug;
31+
const { slug } = await params;
3232
const downloadItems = await getDownloadOptionsDictionary();
3333
const currentDownloadData = downloadItems.find(item => item.slug === slug);
3434

@@ -47,7 +47,7 @@ export async function generateStaticParams() {
4747
}
4848

4949
export default async function DownloadPage({ params }: DownloadPageProps) {
50-
const { slug } = params;
50+
const { slug } = await params;
5151
const downloadItems = await getDownloadOptionsDictionary();
5252
const currentDownloadData = downloadItems.find(item => item.slug === slug);
5353
const hasDownloadCommand = typeof currentDownloadData?.downloadCommand === 'string';

src/app/layout.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
import '@/styles/globals.css';
2-
import dynamic from 'next/dynamic';
32
import { DM_Sans } from 'next/font/google';
43
import type { Metadata, Viewport } from 'next/types';
4+
import { Suspense } from 'react';
55

66
import { PHProvider } from './providers';
77

88
import { Button } from '@/components/elements/button';
99
import { RadixProviders } from '@/components/layout/radix-layout';
1010
import { ThemeLayout } from '@/components/layout/theme-layout';
11+
import PostHogPageView from '@/components/layout/posthog-page-view';
1112
import { siteMetadata } from '@/lib/site-metadata';
1213
import { buildMetadata } from '@/lib/utils/build-metadata';
1314

1415
import { Polyfills } from '@/components/elements/polyfills';
1516

16-
const PostHogPageView = dynamic(() => import('@/components/layout/posthog-page-view'), {
17-
ssr: false,
18-
});
19-
2017
export const viewport: Viewport = {
2118
width: 'device-width',
2219
initialScale: 1,
@@ -80,7 +77,9 @@ export default function RootLayout({
8077
<Button as="link" href="#main-content" small className="skip-button">
8178
Skip to main content
8279
</Button>
83-
<PostHogPageView />
80+
<Suspense fallback={null}>
81+
<PostHogPageView />
82+
</Suspense>
8483
{children}
8584
</RadixProviders>
8685
</ThemeLayout>

src/app/will-it-cors/[step]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function generateStaticParams() {
1616
}
1717

1818
type WillItCorsStepsPageProps = {
19-
params: { step: WillItCorsSteps };
19+
params: Promise<{ step: WillItCorsSteps }>;
2020
};
2121

2222
export const metadata: Metadata = buildMetadata({
@@ -28,8 +28,8 @@ export const metadata: Metadata = buildMetadata({
2828
},
2929
});
3030

31-
export default function WillItCorsStepsPage({ params }: WillItCorsStepsPageProps) {
32-
const { step } = params;
31+
export default async function WillItCorsStepsPage({ params }: WillItCorsStepsPageProps) {
32+
const { step } = await params;
3333

3434
return (
3535
<LandingLayout isNavigationEnabled={false}>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import type { SVGAttributes } from 'react';
1+
import type { JSX, SVGAttributes } from 'react';
22

33
export type CustomIcon = (props: SVGAttributes<SVGElement>) => JSX.Element;

src/components/modules/accordion/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ const AccordionTitle = ({ variant, children }: Component<AccordionVariantProps>)
182182

183183
export const Accordion = ({ items, variant = 'default', isBiggerIcon }: AccordionProps) => {
184184
return (
185-
<StyledAccordionWrapper type="single" defaultValue={items[0].title} collapsible data-variant={variant}>
185+
<StyledAccordionWrapper type="single" defaultValue={items?.[0]?.title} collapsible data-variant={variant}>
186186
{Array.isArray(items) &&
187187
items.length > 0 &&
188188
items.map((item, idx) => (

0 commit comments

Comments
 (0)