Skip to content

Commit 2c6dd62

Browse files
authored
meta: upgraded react 19 next 15.2 (#7531)
* meta: upgraded react 19 next 15.2 * chore: just a tiny bit of a type improvement * chore: simplify link props * chore: fix package order * chore: fix tests * chore: remove act warns
1 parent 267eb73 commit 2c6dd62

File tree

14 files changed

+2561
-2274
lines changed

14 files changed

+2561
-2274
lines changed

apps/site/.stylelintrc.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ export default {
4141
'media-feature-range-notation': 'prefix',
4242
// Adopts the import notation from `postcss-import`
4343
'import-notation': 'string',
44+
// Allow the `@apply` at rule as its part of Tailwind
45+
'at-rule-no-deprecated': [true, { ignoreAtRules: ['apply'] }],
4446
},
4547
};

apps/site/components/Common/AvatarGroup/__tests__/index.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { render, fireEvent } from '@testing-library/react';
22

3-
import { getGitHubAvatarUrl } from '@/util/gitHubUtils';
4-
53
import AvatarGroup from '../index';
64

5+
import { getGitHubAvatarUrl } from '@/util/gitHubUtils';
6+
77
const names = [
88
'ovflowd',
99
'bmuenzenmeyer',

apps/site/components/Common/CodeBox/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use client';
22

33
import {
4-
DocumentDuplicateIcon,
54
CodeBracketIcon,
5+
DocumentDuplicateIcon,
66
} from '@heroicons/react/24/outline';
77
import classNames from 'classnames';
88
import { useTranslations } from 'next-intl';
9-
import type { FC, PropsWithChildren, ReactNode } from 'react';
9+
import type { FC, PropsWithChildren, ReactElement } from 'react';
1010
import { Fragment, isValidElement, useRef } from 'react';
1111

1212
import Button from '@/components/Common/Button';
@@ -16,7 +16,10 @@ import styles from './index.module.css';
1616

1717
// Transforms a code element with plain text content into a more structured
1818
// format for rendering with line numbers
19-
const transformCode = (code: ReactNode, language: string): ReactNode => {
19+
const transformCode = <T extends ReactElement<PropsWithChildren>>(
20+
code: T,
21+
language: string
22+
): ReactElement<HTMLElement> | T => {
2023
if (!isValidElement(code)) {
2124
// Early return when the `CodeBox` child is not a valid element since the
2225
// type is a ReactNode, and can assume any value
@@ -106,7 +109,7 @@ const CodeBox: FC<PropsWithChildren<CodeBoxProps>> = ({
106109
tabIndex={0}
107110
dir="ltr"
108111
>
109-
{transformCode(children, language)}
112+
{transformCode(children as ReactElement<PropsWithChildren>, language)}
110113
</pre>
111114

112115
{language && (

apps/site/components/Common/Tabs/__tests__/index.test.mjs

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
import * as TabsPrimitive from '@radix-ui/react-tabs';
2-
import { act, render, screen } from '@testing-library/react';
2+
import { render, screen } from '@testing-library/react';
33
import userEvent from '@testing-library/user-event';
44

55
import Link from '../../../Link';
66
import Tabs from '../index';
77

8+
const Sut = ({ addons }) => {
9+
const tabs = [
10+
{ key: 'package', label: 'Package Manager' },
11+
{ key: 'prebuilt', label: 'Prebuilt Installer' },
12+
{ key: 'source', label: 'Source Code' },
13+
];
14+
15+
return (
16+
<Tabs tabs={tabs} defaultValue="package" addons={addons}>
17+
<TabsPrimitive.Content value="package">
18+
Package Manager
19+
</TabsPrimitive.Content>
20+
<TabsPrimitive.Content value="prebuilt">
21+
Prebuilt Installer
22+
</TabsPrimitive.Content>
23+
<TabsPrimitive.Content value="source">Source Code</TabsPrimitive.Content>
24+
</Tabs>
25+
);
26+
};
27+
828
describe('Tabs', () => {
9-
const Sut = ({ addons }) => {
10-
const tabs = [
11-
{ key: 'package', label: 'Package Manager' },
12-
{ key: 'prebuilt', label: 'Prebuilt Installer' },
13-
{ key: 'source', label: 'Source Code' },
14-
];
15-
16-
return (
17-
<Tabs tabs={tabs} defaultValue="package" addons={addons}>
18-
<TabsPrimitive.Content value="package">
19-
Package Manager
20-
</TabsPrimitive.Content>
21-
<TabsPrimitive.Content value="prebuilt">
22-
Prebuilt Installer
23-
</TabsPrimitive.Content>
24-
<TabsPrimitive.Content value="source">
25-
Source Code
26-
</TabsPrimitive.Content>
27-
</Tabs>
28-
);
29-
};
30-
31-
it('should render the correct number of tabs', () => {
29+
it('should render the correct number of tabs', async () => {
3230
render(<Sut />);
3331

3432
expect(screen.getAllByRole('tab')).toHaveLength(3);
@@ -39,9 +37,7 @@ describe('Tabs', () => {
3937

4038
expect(screen.getByRole('tabpanel')).toHaveTextContent('Package Manager');
4139

42-
await act(async () => {
43-
await userEvent.click(screen.getByRole('tab', { name: 'Source Code' }));
44-
});
40+
await userEvent.click(screen.getByRole('tab', { name: 'Source Code' }));
4541

4642
expect(screen.getByRole('tabpanel')).toHaveTextContent('Source Code');
4743
});

apps/site/components/Common/Tooltip/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
22
import classNames from 'classnames';
3-
import type { ComponentProps, FC, PropsWithChildren, ReactNode } from 'react';
3+
import type { FC, PropsWithChildren, ReactNode } from 'react';
44

55
import styles from './index.module.css';
66

77
type TooltipProps = {
88
asChild?: boolean;
99
content: ReactNode;
1010
kind?: 'default' | 'warning' | 'error';
11-
side?: ComponentProps<typeof TooltipPrimitive.Content>['side'];
11+
side?: TooltipPrimitive.TooltipContentProps['side'];
1212
container?: HTMLElement | null;
1313
};
1414

apps/site/components/Link.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { FC, ComponentProps } from 'react';
1+
import type { FC, HTMLProps } from 'react';
22

33
import { Link as LocalizedLink } from '@/navigation.mjs';
44

5-
type LinkProps = Omit<ComponentProps<typeof LocalizedLink>, 'href'> & {
6-
href?: string;
7-
};
8-
9-
const Link: FC<LinkProps> = ({ children, href, ...props }) => {
5+
const Link: FC<HTMLProps<HTMLAnchorElement>> = ({
6+
children,
7+
href,
8+
...props
9+
}) => {
1010
if (!href || href.toString().startsWith('http')) {
1111
return (
1212
<a href={href} {...props}>

apps/site/components/MDX/CodeTabs/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type MDXCodeTabsProps = Pick<
77
ComponentProps<typeof CodeTabs>,
88
'linkText' | 'linkUrl'
99
> & {
10-
children: Array<ReactElement>;
10+
children: Array<ReactElement<unknown>>;
1111
languages: string;
1212
displayNames?: string;
1313
defaultTab?: string;

apps/site/eslint.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ export default tseslint.config(
3737
'@next/next/no-duplicate-head': 'off',
3838
'import-x/no-duplicates': 'off',
3939
},
40-
settings: {
41-
react: {
42-
version: 'detect',
43-
},
44-
},
40+
settings: { react: { version: 'detect' } },
4541
},
4642
{
4743
files: ['**/*.{md,mdx}'],

apps/site/jest.setup.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
2+
13
import '@testing-library/jest-dom';

apps/site/package.json

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -28,90 +28,88 @@
2828
"@node-core/website-i18n": "*",
2929
"@nodevu/core": "0.3.0",
3030
"@opentelemetry/api": "1.9.0",
31-
"@orama/react-components": "^0.3.2",
31+
"@orama/react-components": "^0.5.1",
3232
"@oramacloud/client": "^2.1.4",
33-
"@radix-ui/react-accessible-icon": "^1.1.0",
34-
"@radix-ui/react-dropdown-menu": "^2.1.2",
35-
"@radix-ui/react-label": "^2.1.0",
36-
"@radix-ui/react-scroll-area": "^1.2.1",
37-
"@radix-ui/react-select": "^2.1.2",
38-
"@radix-ui/react-slot": "^1.1.0",
39-
"@radix-ui/react-tabs": "^1.1.1",
40-
"@radix-ui/react-toast": "^1.2.5",
33+
"@radix-ui/react-accessible-icon": "^1.1.2",
34+
"@radix-ui/react-dropdown-menu": "^2.1.6",
35+
"@radix-ui/react-label": "^2.1.2",
36+
"@radix-ui/react-scroll-area": "^1.2.3",
37+
"@radix-ui/react-select": "^2.1.6",
38+
"@radix-ui/react-slot": "^1.1.2",
39+
"@radix-ui/react-tabs": "^1.1.3",
40+
"@radix-ui/react-toast": "^1.2.6",
4141
"@radix-ui/react-tooltip": "^1.1.8",
4242
"@savvywombat/tailwindcss-grid-areas": "~4.0.0",
4343
"@tailwindcss/container-queries": "~0.1.1",
4444
"@vcarl/remark-headings": "~0.1.0",
45-
"@vercel/analytics": "~1.4.1",
45+
"@vercel/analytics": "~1.5.0",
4646
"@vercel/otel": "~1.10.1",
47-
"@vercel/speed-insights": "~1.1.0",
47+
"@vercel/speed-insights": "~1.2.0",
4848
"autoprefixer": "~10.4.20",
4949
"classnames": "~2.5.1",
5050
"cross-env": "7.0.3",
5151
"dedent": "1.5.3",
5252
"feed": "~4.2.2",
5353
"github-slugger": "~2.0.0",
54-
"glob": "~11.0.0",
54+
"glob": "~11.0.1",
5555
"gray-matter": "~4.0.3",
56-
"next": "15.1.6",
57-
"next-intl": "~3.26.3",
58-
"next-themes": "~0.4.3",
59-
"postcss": "~8.4.49",
60-
"postcss-calc": "~10.0.2",
56+
"next": "15.2.0",
57+
"next-intl": "~3.26.5",
58+
"next-themes": "~0.4.4",
59+
"postcss": "~8.5.3",
60+
"postcss-calc": "~10.1.1",
6161
"postcss-import": "~16.1.0",
6262
"postcss-loader": "~8.1.1",
6363
"postcss-mixins": "~11.0.3",
6464
"postcss-simple-vars": "~7.0.1",
65-
"react": "^18.3.1",
66-
"react-dom": "^18.3.1",
65+
"react": "19.0.0",
66+
"react-dom": "19.0.0",
6767
"rehype-autolink-headings": "~7.1.0",
6868
"rehype-slug": "~6.0.0",
69-
"remark-gfm": "~4.0.0",
69+
"remark-gfm": "~4.0.1",
7070
"remark-reading-time": "~2.0.1",
7171
"semver": "~7.7.1",
72-
"shiki": "~2.2.0",
73-
"sval": "^0.5.2",
74-
"tailwindcss": "~3.4.15",
72+
"shiki": "~3.1.0",
73+
"sval": "^0.6.1",
74+
"tailwindcss": "~3.4.17",
7575
"unist-util-visit": "~5.0.0",
7676
"vfile": "~6.0.3",
7777
"vfile-matter": "~5.0.0"
7878
},
7979
"devDependencies": {
80-
"@eslint/compat": "~1.2.3",
81-
"@next/eslint-plugin-next": "15.1.6",
82-
"@storybook/addon-controls": "^8.5.2",
83-
"@storybook/addon-interactions": "^8.5.2",
80+
"@eslint/compat": "~1.2.7",
81+
"@next/eslint-plugin-next": "15.2.0",
82+
"@storybook/addon-controls": "^8.6.3",
83+
"@storybook/addon-interactions": "^8.6.3",
8484
"@storybook/addon-styling-webpack": "^1.0.1",
85-
"@storybook/addon-themes": "^8.5.2",
86-
"@storybook/addon-viewport": "^8.5.2",
87-
"@storybook/addon-webpack5-compiler-swc": "^2.0.0",
88-
"@storybook/react-webpack5": "^8.5.2",
85+
"@storybook/addon-themes": "^8.6.3",
86+
"@storybook/addon-viewport": "^8.6.3",
87+
"@storybook/addon-webpack5-compiler-swc": "^2.1.0",
88+
"@storybook/react-webpack5": "^8.6.3",
8989
"@testing-library/jest-dom": "~6.6.3",
9090
"@testing-library/react": "~16.2.0",
9191
"@testing-library/user-event": "~14.6.1",
9292
"@types/jest": "29.5.14",
93-
"@types/react": "^18.3.12",
94-
"@types/react-dom": "^18.3.1",
9593
"@types/semver": "~7.5.8",
96-
"eslint-config-next": "15.1.3",
97-
"eslint-import-resolver-typescript": "~3.7.0",
94+
"eslint-config-next": "15.2.0",
95+
"eslint-import-resolver-typescript": "~3.8.3",
9896
"eslint-plugin-mdx": "~3.1.5",
99-
"eslint-plugin-react": "~7.37.2",
100-
"eslint-plugin-react-hooks": "5.1.0",
101-
"eslint-plugin-storybook": "~0.11.0",
97+
"eslint-plugin-react": "~7.37.4",
98+
"eslint-plugin-react-hooks": "5.2.0",
99+
"eslint-plugin-storybook": "~0.11.3",
102100
"handlebars": "4.7.8",
103101
"jest": "29.7.0",
104102
"jest-environment-jsdom": "29.7.0",
105103
"jest-junit": "16.0.0",
106104
"remark-frontmatter": "5.0.0",
107105
"remark-preset-lint-node": "5.1.2",
108-
"storybook": "^8.4.4",
109-
"stylelint": "16.12.0",
110-
"stylelint-config-standard": "36.0.1",
106+
"storybook": "^8.6.3",
107+
"stylelint": "16.15.0",
108+
"stylelint-config-standard": "37.0.0",
111109
"stylelint-order": "6.0.4",
112110
"stylelint-selector-bem-pattern": "4.0.1",
113111
"typescript": "~5.7.2",
114-
"typescript-eslint": "~8.19.0",
112+
"typescript-eslint": "~8.25.0",
115113
"user-agent-data-types": "0.4.2"
116114
}
117115
}

0 commit comments

Comments
 (0)