Skip to content

Commit bb884fc

Browse files
committed
chore: react compiler
1 parent 555961b commit bb884fc

File tree

9 files changed

+18367
-14753
lines changed

9 files changed

+18367
-14753
lines changed

apps/guide/next.config.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
22
/* eslint-disable @typescript-eslint/no-require-imports */
3-
// import bundleAnalyzer from '@next/bundle-analyzer';
43
// import { withContentlayer } from 'next-contentlayer';
5-
const bundleAnalyzer = require('@next/bundle-analyzer');
64
const { withContentlayer } = require('next-contentlayer');
75

8-
const withBundleAnalyzer = bundleAnalyzer({
9-
enabled: process.env.ANALYZE === 'true',
6+
module.exports = withContentlayer({
7+
reactStrictMode: true,
8+
experimental: {
9+
typedRoutes: true,
10+
},
11+
images: {
12+
dangerouslyAllowSVG: true,
13+
contentDispositionType: 'attachment',
14+
contentSecurityPolicy: "default-src 'self'; frame-src 'none'; sandbox;",
15+
},
16+
poweredByHeader: false,
1017
});
11-
12-
module.exports = withBundleAnalyzer(
13-
withContentlayer({
14-
reactStrictMode: true,
15-
experimental: {
16-
typedRoutes: true,
17-
},
18-
images: {
19-
dangerouslyAllowSVG: true,
20-
contentDispositionType: 'attachment',
21-
contentSecurityPolicy: "default-src 'self'; frame-src 'none'; sandbox;",
22-
},
23-
poweredByHeader: false,
24-
}),
25-
);

apps/guide/package.json

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,43 +54,42 @@
5454
"ariakit": "2.0.0-next.44",
5555
"cmdk": "^1.0.0",
5656
"contentlayer": "^0.3.4",
57-
"next": "14.2.1",
57+
"next": "^14.2.3",
5858
"next-contentlayer": "^0.3.4",
5959
"next-themes": "^0.3.0",
60-
"react": "^18.2.0",
60+
"react": "^18.3.1",
6161
"react-custom-scrollbars-2": "^4.5.0",
62-
"react-dom": "^18.2.0",
62+
"react-dom": "^18.3.1",
6363
"rehype-autolink-headings": "^6.1.1",
6464
"rehype-slug": "^5.1.0",
6565
"remark-gfm": "^3.0.1",
66-
"sharp": "^0.33.3"
66+
"sharp": "^0.33.4"
6767
},
6868
"devDependencies": {
69-
"@next/bundle-analyzer": "14.2.1",
70-
"@testing-library/react": "^15.0.2",
69+
"@testing-library/react": "^15.0.7",
7170
"@testing-library/user-event": "^14.5.2",
7271
"@types/html-escaper": "^3.0.2",
7372
"@types/node": "18.18.8",
74-
"@types/react": "^18.2.79",
75-
"@types/react-dom": "^18.2.25",
76-
"@unocss/eslint-plugin": "^0.59.3",
77-
"@unocss/postcss": "^0.58.5",
78-
"@unocss/reset": "^0.59.3",
73+
"@types/react": "^18.3.2",
74+
"@types/react-dom": "^18.3.0",
75+
"@unocss/eslint-plugin": "^0.60.2",
76+
"@unocss/postcss": "^0.60.2",
77+
"@unocss/reset": "^0.60.2",
7978
"@vitejs/plugin-react": "^4.2.1",
80-
"@vitest/coverage-v8": "^1.5.0",
79+
"@vitest/coverage-v8": "^1.6.0",
8180
"cross-env": "^7.0.3",
8281
"eslint": "^8.57.0",
8382
"eslint-config-neon": "^0.1.62",
8483
"eslint-formatter-pretty": "^6.0.1",
85-
"happy-dom": "^14.7.1",
84+
"happy-dom": "^14.11.0",
8685
"hast-util-to-string": "^2.0.0",
8786
"hastscript": "^8.0.0",
8887
"html-escaper": "^3.0.3",
8988
"postcss": "^8.4.38",
9089
"prettier": "^3.2.5",
9190
"turbo": "^1.13.2",
9291
"typescript": "^5.4.5",
93-
"unocss": "^0.59.3",
92+
"unocss": "^0.60.2",
9493
"vercel": "^34.0.0",
9594
"vitest": "^1.5.0"
9695
},

apps/website/next.config.mjs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import bundleAnalyzer from '@next/bundle-analyzer';
2-
import localesPlugin from '@react-aria/optimize-locales-plugin';
3-
4-
const withBundleAnalyzer = bundleAnalyzer({
5-
enabled: process.env.ANALYZE === 'true',
6-
});
7-
8-
export default withBundleAnalyzer({
1+
/**
2+
* @type {import('next').NextConfig}
3+
*/
4+
export default {
95
reactStrictMode: true,
106
images: {
117
dangerouslyAllowSVG: true,
@@ -18,14 +14,8 @@ export default withBundleAnalyzer({
1814
},
1915
},
2016
experimental: {
21-
ppr: false,
22-
},
23-
webpack(config, { isServer }) {
24-
if (!isServer) {
25-
config.plugins.push(localesPlugin.webpack({ locales: ['en-US'] }));
26-
}
27-
28-
return config;
17+
ppr: true,
18+
reactCompiler: true,
2919
},
3020
async redirects() {
3121
return [
@@ -41,4 +31,4 @@ export default withBundleAnalyzer({
4131
},
4232
];
4333
},
44-
});
34+
};

apps/website/package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,52 +50,51 @@
5050
"@radix-ui/react-collapsible": "^1.0.3",
5151
"@react-icons/all-files": "^4.1.0",
5252
"@vercel/analytics": "^1.2.2",
53-
"@vercel/blob": "^0.22.3",
53+
"@vercel/blob": "^0.23.2",
5454
"@vercel/edge-config": "^1.1.0",
5555
"@vercel/og": "^0.6.2",
5656
"@vercel/postgres": "^0.8.0",
5757
"cmdk": "^1.0.0",
5858
"geist": "^1.3.0",
5959
"jotai": "^2.8.0",
60-
"lucide-react": "^0.368.0",
61-
"meilisearch": "^0.38.0",
62-
"next": "14.2.1",
60+
"lucide-react": "^0.378.0",
61+
"meilisearch": "^0.40.0",
62+
"next": "^14.3.0-canary.70",
6363
"next-mdx-remote": "^4.4.1",
6464
"next-themes": "^0.3.0",
65-
"overlayscrollbars": "^2.6.0",
65+
"overlayscrollbars": "^2.8.0",
6666
"overlayscrollbars-react": "^0.5.6",
67-
"react": "^18.2.0",
68-
"react-aria-components": "^1.1.1",
69-
"react-dom": "^18.2.0",
70-
"sharp": "^0.33.3",
67+
"react": "^19.0.0-rc-3f1436cca1-20240516",
68+
"react-aria-components": "^1.2.0",
69+
"react-dom": "^19.0.0-rc-3f1436cca1-20240516",
70+
"sharp": "^0.33.4",
7171
"usehooks-ts": "^3.1.0",
72-
"vaul": "^0.9.0"
72+
"vaul": "^0.9.1"
7373
},
7474
"devDependencies": {
75-
"@next/bundle-analyzer": "14.2.1",
76-
"@react-aria/optimize-locales-plugin": "^1.0.2",
77-
"@shikijs/rehype": "1.1.7",
78-
"@tailwindcss/typography": "^0.5.12",
79-
"@testing-library/react": "^15.0.2",
75+
"@shikijs/rehype": "^1.6.0",
76+
"@tailwindcss/typography": "^0.5.13",
77+
"@testing-library/react": "^15.0.7",
8078
"@testing-library/user-event": "^14.5.2",
8179
"@types/node": "18.18.8",
82-
"@types/react": "^18.2.79",
83-
"@types/react-dom": "^18.2.25",
80+
"@types/react": "^18.3.2",
81+
"@types/react-dom": "^18.3.0",
8482
"@vitejs/plugin-react": "^4.2.1",
85-
"@vitest/coverage-v8": "^1.5.0",
83+
"@vitest/coverage-v8": "^1.6.0",
8684
"autoprefixer": "^10.4.19",
85+
"babel-plugin-react-compiler": "^0.0.0-experimental-592953e-20240517",
8786
"cpy-cli": "^5.0.0",
8887
"cross-env": "^7.0.3",
8988
"eslint": "^8.57.0",
9089
"eslint-config-neon": "^0.1.62",
9190
"eslint-formatter-pretty": "^6.0.1",
92-
"happy-dom": "^14.7.1",
91+
"happy-dom": "^14.11.0",
9392
"postcss": "^8.4.38",
9493
"prettier": "^3.2.5",
9594
"prettier-plugin-tailwindcss": "^0.5.14",
9695
"remark-gfm": "^3.0.1",
9796
"remark-rehype": "^11.1.0",
98-
"shiki": "1.3.0",
97+
"shiki": "^1.6.0",
9998
"tailwindcss": "^3.4.3",
10099
"turbo": "^1.13.2",
101100
"typescript": "^5.4.5",

apps/website/src/app/docs/packages/[packageName]/[version]/layout.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Navigation } from '~/components/Navigation';
55
import { OverlayScrollbarsComponent } from '~/components/OverlayScrollbars';
66
import { Drawer } from '~/components/ui/Drawer';
77
import { Footer } from '~/components/ui/Footer';
8-
import { ENV } from '~/util/env';
98
import { fetchDependencies } from '~/util/fetchDependencies';
109

1110
// eslint-disable-next-line promise/prefer-await-to-then
@@ -33,11 +32,9 @@ export default async function Layout({
3332
return (
3433
// eslint-disable-next-line react/no-unknown-property
3534
<div vaul-drawer-wrapper="" className="mx-auto flex max-w-screen-2xl flex-col gap-12 p-6 md:flex-row">
36-
<div
37-
className={`sticky hidden flex-shrink-0 self-start md:block ${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'top-[64px]' : 'top-6'}`}
38-
>
35+
<div className="sticky top-6 hidden flex-shrink-0 self-start md:block">
3936
<OverlayScrollbarsComponent
40-
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'max-h-[calc(100dvh-48px-40px)]' : 'max-h-[calc(100dvh-48px)]'}`}
37+
className="max-h-[calc(100dvh-48px)]"
4138
defer
4239
options={{
4340
overflow: { x: 'hidden' },

apps/website/src/components/ui/CmdK.tsx

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useAtom, useSetAtom } from 'jotai';
55
import { ArrowRight } from 'lucide-react';
66
import MeiliSearch from 'meilisearch';
77
import { usePathname, useRouter } from 'next/navigation';
8-
import { useEffect, useMemo, useState } from 'react';
8+
import { useEffect, useState } from 'react';
99
import { useDebounceValue } from 'usehooks-ts';
1010
import { isCmdKOpenAtom } from '~/stores/cmdk';
1111
import { isDrawerOpenAtom } from '~/stores/drawer';
@@ -25,32 +25,29 @@ export function CmdK({ dependencies }: { readonly dependencies: string[] }) {
2525
const [search, setSearch] = useDebounceValue('', 250);
2626
const [searchResults, setSearchResults] = useState<any[]>([]);
2727

28-
const packageName = useMemo(() => pathname?.split('/').slice(3, 4)[0], [pathname]);
29-
const branchName = useMemo(() => pathname?.split('/').slice(4, 5)[0], [pathname]);
28+
const packageName = pathname?.split('/').slice(3, 4)[0];
29+
const branchName = pathname?.split('/').slice(4, 5)[0];
3030

31-
const searchResultItems = useMemo(
32-
() =>
33-
searchResults?.map((item, idx) => (
34-
<Command.Item
35-
key={`${item.id}-${idx}`}
36-
className="flex cursor-pointer place-items-center gap-2 rounded-md p-2 data-[selected]:bg-neutral-200 dark:data-[selected]:bg-neutral-800"
37-
onSelect={() => {
38-
router.push(item.path);
39-
setOpen(false);
40-
}}
41-
value={item.id}
42-
>
43-
{resolveKind(item.kind)}
44-
<div className="flex flex-grow flex-col">
45-
<span className="font-semibold">{item.name}</span>
46-
<span className="line-clamp-1 text-sm">{item.summary}</span>
47-
<span className="truncate text-xs">{item.path}</span>
48-
</div>
49-
<ArrowRight aria-hidden className="flex-shrink-0" />
50-
</Command.Item>
51-
)) ?? [],
52-
[router, searchResults, setOpen],
53-
);
31+
const searchResultItems =
32+
searchResults?.map((item, idx) => (
33+
<Command.Item
34+
key={`${item.id}-${idx}`}
35+
className="flex cursor-pointer place-items-center gap-2 rounded-md p-2 data-[selected='true']:bg-neutral-200 dark:data-[selected='true']:bg-neutral-800"
36+
onSelect={() => {
37+
router.push(item.path);
38+
setOpen(false);
39+
}}
40+
value={item.id}
41+
>
42+
{resolveKind(item.kind)}
43+
<div className="flex flex-grow flex-col">
44+
<span className="font-semibold">{item.name}</span>
45+
<span className="line-clamp-1 text-sm">{item.summary}</span>
46+
<span className="truncate text-xs">{item.path}</span>
47+
</div>
48+
<ArrowRight aria-hidden className="flex-shrink-0" />
49+
</Command.Item>
50+
)) ?? [];
5451

5552
// Toggle the menu when ⌘K is pressed
5653
useEffect(() => {

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
"private": true,
77
"scripts": {
88
"build": "turbo run build --concurrency=4",
9-
"build:affected": "turbo run build --filter='...[origin/main]' --concurrency=4",
10-
"build:apps": "turbo run build:local --filter='...{apps/*}' --concurrency=4",
11-
"build:apps:affected": "turbo run build:local --filter='...{apps/*}[origin/main]' --concurrency=4",
9+
"build:affected": "turbo run build --filter=...[origin/main] --concurrency=4",
10+
"build:apps": "turbo run build:local --filter=...{apps/*} --concurrency=4",
11+
"build:apps:affected": "turbo run build:local --filter=...{apps/*}[origin/main] --concurrency=4",
1212
"test": "turbo run test --concurrency=4",
13-
"test:affected": "turbo run test --filter='...[origin/main]' --concurrency=4",
13+
"test:affected": "turbo run test --filter=...[origin/main] --concurrency=4",
1414
"lint": "turbo run lint --concurrency=4",
15-
"lint:affected": "turbo run lint --filter='...[origin/main]' --concurrency=4",
15+
"lint:affected": "turbo run lint --filter=...[origin/main] --concurrency=4",
1616
"format": "turbo run format --concurrency=4",
17-
"format:affected": "turbo run format --filter='...[origin/main]' --concurrency=4",
17+
"format:affected": "turbo run format --filter=...[origin/main] --concurrency=4",
1818
"fmt": "turbo run format --concurrency=4",
19-
"fmt:affected": "turbo run format --filter='...[origin/main]' --concurrency=4",
19+
"fmt:affected": "turbo run format --filter=...[origin/main] --concurrency=4",
2020
"docs": "turbo run docs --concurrency=4",
21-
"docs:affected": "turbo run docs --filter='...[origin/main]' --concurrency=4",
21+
"docs:affected": "turbo run docs --filter=...[origin/main] --concurrency=4",
2222
"prepare": "is-ci || husky",
2323
"update": "pnpm --recursive update --interactive",
2424
"update:latest": "pnpm --recursive update --interactive --latest",
@@ -69,7 +69,7 @@
6969
"turbo": "^1.13.2",
7070
"typescript": "^5.4.5",
7171
"typescript-eslint": "^7.7.0",
72-
"unocss": "^0.59.3",
72+
"unocss": "^0.60.2",
7373
"vercel": "^34.0.0",
7474
"vitest": "^1.5.0"
7575
},
@@ -97,5 +97,5 @@
9797
"engines": {
9898
"node": ">=18"
9999
},
100-
"packageManager": "pnpm@8.15.7+sha256.50783dd0fa303852de2dd1557cd4b9f07cb5b018154a6e76d0f40635d6cee019"
100+
"packageManager": "pnpm@9.1.1"
101101
}

packages/ui/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
"dependencies": {
5555
"@react-icons/all-files": "^4.1.0",
5656
"ariakit": "2.0.0-next.44",
57-
"react": "^18.2.0",
58-
"react-dom": "^18.2.0"
57+
"react": "^18.3.1",
58+
"react-dom": "^18.3.1"
5959
},
6060
"devDependencies": {
6161
"@favware/cliff-jumper": "^3.0.2",
@@ -69,12 +69,12 @@
6969
"@storybook/react-vite": "^8.0.8",
7070
"@storybook/testing-library": "^0.2.2",
7171
"@types/node": "18.18.8",
72-
"@types/react": "^18.2.79",
73-
"@types/react-dom": "^18.2.25",
74-
"@unocss/eslint-plugin": "^0.59.3",
75-
"@unocss/reset": "^0.59.3",
72+
"@types/react": "^18.3.2",
73+
"@types/react-dom": "^18.3.0",
74+
"@unocss/eslint-plugin": "^0.60.2",
75+
"@unocss/reset": "^0.60.2",
7676
"@vitejs/plugin-react": "^4.2.1",
77-
"@vitest/coverage-v8": "^1.5.0",
77+
"@vitest/coverage-v8": "^1.6.0",
7878
"chromatic": "^11.3.0",
7979
"cross-env": "^7.0.3",
8080
"eslint": "^8.57.0",
@@ -85,7 +85,7 @@
8585
"storybook": "^8.0.8",
8686
"turbo": "^1.13.2",
8787
"typescript": "^5.4.5",
88-
"unocss": "^0.59.3",
88+
"unocss": "^0.60.2",
8989
"vite": "^5.2.9",
9090
"vite-plugin-dts": "^3.8.3",
9191
"vitest": "^1.5.0"

0 commit comments

Comments
 (0)