Skip to content

Commit 65efb86

Browse files
committed
react 19
1 parent 06e7739 commit 65efb86

Some content is hidden

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

53 files changed

+814
-1080
lines changed

site/.storybook/main.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
import turbosnap from "vite-plugin-turbosnap";
22

3-
module.exports = {
4-
stories: ["../src/**/*.stories.tsx"],
3+
export default {
4+
stories: ["../src/**/*.stories.tsx"],
55

6-
addons: [
7-
"@chromatic-com/storybook",
8-
{
9-
name: "@storybook/addon-essentials",
10-
options: {
11-
backgrounds: false,
12-
},
13-
},
14-
"@storybook/addon-links",
15-
"@storybook/addon-mdx-gfm",
16-
"@storybook/addon-themes",
17-
"@storybook/addon-actions",
18-
"@storybook/addon-interactions",
19-
"storybook-addon-remix-react-router",
20-
],
6+
addons: [
7+
"@chromatic-com/storybook",
8+
{
9+
name: "@storybook/addon-essentials",
10+
options: {
11+
backgrounds: false,
12+
},
13+
},
14+
"@storybook/addon-links",
15+
"@storybook/addon-mdx-gfm",
16+
"@storybook/addon-themes",
17+
"@storybook/addon-actions",
18+
"@storybook/addon-interactions",
19+
"storybook-addon-remix-react-router",
20+
],
2121

22-
staticDirs: ["../static"],
22+
staticDirs: ["../static"],
2323

24-
framework: {
25-
name: "@storybook/react-vite",
26-
options: {},
27-
},
24+
framework: {
25+
name: "@storybook/react-vite",
26+
options: {},
27+
},
2828

29-
async viteFinal(config, { configType }) {
30-
config.plugins = config.plugins || [];
31-
// return the customized config
32-
if (configType === "PRODUCTION") {
33-
// ignore @ts-ignore because it's not in the vite types yet
34-
config.plugins.push(
35-
turbosnap({
36-
rootDir: config.root || "",
37-
}),
38-
);
39-
}
40-
return config;
41-
},
29+
async viteFinal(config, { configType }) {
30+
config.plugins = config.plugins || [];
31+
// return the customized config
32+
if (configType === "PRODUCTION") {
33+
// ignore @ts-ignore because it's not in the vite types yet
34+
config.plugins.push(
35+
turbosnap({
36+
rootDir: config.root || "",
37+
}),
38+
);
39+
}
40+
return config;
41+
},
4242
};

site/jest.config.ts

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
1-
module.exports = {
2-
// Use a big timeout for CI.
3-
testTimeout: 20_000,
4-
maxWorkers: 8,
5-
projects: [
6-
{
7-
displayName: "test",
8-
roots: ["<rootDir>"],
9-
setupFiles: ["./jest.polyfills.js"],
10-
setupFilesAfterEnv: ["./jest.setup.ts"],
11-
extensionsToTreatAsEsm: [".ts"],
12-
transform: {
13-
"^.+\\.(t|j)sx?$": [
14-
"@swc/jest",
15-
{
16-
jsc: {
17-
transform: {
18-
react: {
19-
runtime: "automatic",
20-
importSource: "@emotion/react",
21-
},
22-
},
23-
experimental: {
24-
plugins: [["jest_workaround", {}]],
25-
},
26-
},
27-
},
28-
],
29-
},
30-
testEnvironment: "jsdom",
31-
testEnvironmentOptions: {
32-
customExportConditions: [""],
33-
},
34-
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
35-
testPathIgnorePatterns: [
36-
"/node_modules/",
37-
"/e2e/",
38-
// TODO: This test is timing out after upgrade a few Jest dependencies
39-
// and I was not able to figure out why. When running it specifically, I
40-
// can see many act warnings that may can help us to find the issue.
41-
"/usePaginatedQuery.test.ts",
42-
],
43-
transformIgnorePatterns: [
44-
"<rootDir>/node_modules/@chartjs-adapter-date-fns",
45-
],
46-
moduleDirectories: ["node_modules", "<rootDir>/src"],
47-
moduleNameMapper: {
48-
"\\.css$": "<rootDir>/src/testHelpers/styleMock.ts",
49-
"^@fontsource": "<rootDir>/src/testHelpers/styleMock.ts",
50-
},
51-
},
52-
],
53-
collectCoverageFrom: [
54-
// included files
55-
"<rootDir>/**/*.ts",
56-
"<rootDir>/**/*.tsx",
57-
// excluded files
58-
"!<rootDir>/**/*.stories.tsx",
59-
"!<rootDir>/_jest/**/*.*",
60-
"!<rootDir>/api.ts",
61-
"!<rootDir>/coverage/**/*.*",
62-
"!<rootDir>/e2e/**/*.*",
63-
"!<rootDir>/jest-runner.eslint.config.js",
64-
"!<rootDir>/jest.config.js",
65-
"!<rootDir>/out/**/*.*",
66-
"!<rootDir>/storybook-static/**/*.*",
67-
],
1+
export default {
2+
// Use a big timeout for CI.
3+
testTimeout: 20_000,
4+
maxWorkers: 8,
5+
projects: [
6+
{
7+
displayName: "test",
8+
roots: ["<rootDir>"],
9+
setupFiles: ["./jest.polyfills.js"],
10+
setupFilesAfterEnv: ["./jest.setup.ts"],
11+
extensionsToTreatAsEsm: [".ts"],
12+
transform: {
13+
"^.+\\.(t|j)sx?$": [
14+
"@swc/jest",
15+
{
16+
jsc: {
17+
transform: {
18+
react: {
19+
runtime: "automatic",
20+
importSource: "@emotion/react",
21+
},
22+
},
23+
experimental: {
24+
plugins: [["jest_workaround", {}]],
25+
},
26+
},
27+
},
28+
],
29+
},
30+
testEnvironment: "jsdom",
31+
testEnvironmentOptions: {
32+
customExportConditions: [""],
33+
},
34+
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
35+
testPathIgnorePatterns: [
36+
"/node_modules/",
37+
"/e2e/",
38+
// TODO: This test is timing out after upgrade a few Jest dependencies
39+
// and I was not able to figure out why. When running it specifically, I
40+
// can see many act warnings that may can help us to find the issue.
41+
"/usePaginatedQuery.test.ts",
42+
],
43+
transformIgnorePatterns: [
44+
"<rootDir>/node_modules/@chartjs-adapter-date-fns",
45+
],
46+
moduleDirectories: ["node_modules", "<rootDir>/src"],
47+
moduleNameMapper: {
48+
"\\.css$": "<rootDir>/src/testHelpers/styleMock.ts",
49+
"^@fontsource": "<rootDir>/src/testHelpers/styleMock.ts",
50+
},
51+
},
52+
],
53+
collectCoverageFrom: [
54+
// included files
55+
"<rootDir>/**/*.ts",
56+
"<rootDir>/**/*.tsx",
57+
// excluded files
58+
"!<rootDir>/**/*.stories.tsx",
59+
"!<rootDir>/_jest/**/*.*",
60+
"!<rootDir>/api.ts",
61+
"!<rootDir>/coverage/**/*.*",
62+
"!<rootDir>/e2e/**/*.*",
63+
"!<rootDir>/jest-runner.eslint.config.js",
64+
"!<rootDir>/jest.config.js",
65+
"!<rootDir>/out/**/*.*",
66+
"!<rootDir>/storybook-static/**/*.*",
67+
],
6868
};

site/jest.setup.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,3 @@ afterEach(() => {
6969

7070
// Clean up after the tests are finished.
7171
afterAll(() => server.close());
72-
73-
// biome-ignore lint/complexity/noUselessEmptyExport: This is needed because we are compiling under `--isolatedModules`
74-
export {};

site/package.json

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"repository": "https://github.com/coder/coder",
55
"private": true,
66
"license": "AGPL-3.0",
7+
"type": "module",
78
"scripts": {
89
"build": "NODE_ENV=production pnpm vite build",
910
"check": "biome check --error-on-warnings e2e/ src/",
@@ -36,10 +37,10 @@
3637
"@alwaysmeticulous/recorder-loader": "2.137.0",
3738
"@emoji-mart/data": "1.2.1",
3839
"@emoji-mart/react": "1.1.1",
39-
"@emotion/cache": "11.13.1",
40-
"@emotion/css": "11.13.4",
41-
"@emotion/react": "11.13.3",
42-
"@emotion/styled": "11.13.0",
40+
"@emotion/cache": "11.13.5",
41+
"@emotion/css": "11.13.5",
42+
"@emotion/react": "11.13.5",
43+
"@emotion/styled": "11.13.5",
4344
"@fastly/performance-observer-polyfill": "2.0.0",
4445
"@fontsource-variable/inter": "5.0.15",
4546
"@fontsource/ibm-plex-mono": "5.1.0",
@@ -87,12 +88,12 @@
8788
"lucide-react": "0.454.0",
8889
"monaco-editor": "0.52.0",
8990
"pretty-bytes": "6.1.1",
90-
"react": "18.3.1",
91+
"react": "19.0.0",
9192
"react-chartjs-2": "5.2.0",
9293
"react-color": "2.19.3",
9394
"react-confetti": "6.1.0",
9495
"react-date-range": "1.4.0",
95-
"react-dom": "18.3.1",
96+
"react-dom": "19.0.0",
9697
"react-helmet-async": "2.0.5",
9798
"react-markdown": "9.0.1",
9899
"react-query": "npm:@tanstack/react-query@4.35.3",
@@ -131,21 +132,21 @@
131132
"@storybook/test": "8.4.6",
132133
"@swc/core": "1.3.38",
133134
"@swc/jest": "0.2.37",
134-
"@testing-library/jest-dom": "6.4.6",
135-
"@testing-library/react": "14.3.1",
135+
"@testing-library/jest-dom": "6.6.3",
136+
"@testing-library/react": "16.1.0",
136137
"@testing-library/react-hooks": "8.0.1",
137-
"@testing-library/user-event": "14.5.1",
138+
"@testing-library/user-event": "14.5.2",
138139
"@types/chroma-js": "2.4.0",
139140
"@types/color-convert": "2.0.0",
140141
"@types/express": "4.17.17",
141142
"@types/file-saver": "2.0.7",
142143
"@types/jest": "29.5.14",
143144
"@types/lodash": "4.17.13",
144145
"@types/node": "20.17.6",
145-
"@types/react": "18.3.12",
146+
"@types/react": "19.0.0",
146147
"@types/react-color": "3.0.12",
147148
"@types/react-date-range": "1.4.4",
148-
"@types/react-dom": "18.3.1",
149+
"@types/react-dom": "19.0.0",
149150
"@types/react-syntax-highlighter": "15.5.13",
150151
"@types/react-virtualized-auto-sizer": "1.0.4",
151152
"@types/react-window": "1.8.8",
@@ -182,11 +183,7 @@
182183
"vite-plugin-checker": "0.8.0",
183184
"vite-plugin-turbosnap": "1.0.3"
184185
},
185-
"browserslist": [
186-
"chrome 110",
187-
"firefox 111",
188-
"safari 16.0"
189-
],
186+
"browserslist": ["chrome 110", "firefox 111", "safari 16.0"],
190187
"resolutions": {
191188
"optionator": "0.9.3",
192189
"semver": "7.6.2"

0 commit comments

Comments
 (0)