Skip to content

Commit e24b6aa

Browse files
authored
Bump JavaScript dependencies (#1253)
Bumps most of the JavaScript dependencies to their latest versions Some dependencies, such as `@types/react-dom` and `happy-dom` are kept on older versions due to them having critical breaking changes.
1 parent 17f2286 commit e24b6aa

13 files changed

+121
-63
lines changed

pyproject.toml

+9-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,16 @@ license-files = { paths = ["LICENSE"] }
6060
installer = "uv"
6161

6262
[[tool.hatch.build.hooks.build-scripts.scripts]]
63+
# Note: `hatch` can't be called within `build-scripts` when installing packages in editable mode, so we have to write the commands long-form
6364
commands = [
64-
"hatch run javascript:build",
65-
'hatch run "src/build_scripts/copy_dir.py" "src/js/packages/@reactpy/app/dist" "src/reactpy/static/assets"',
65+
'python "src/build_scripts/clean_js_dir.py"',
66+
'bun install --cwd "src/js/packages/event-to-object"',
67+
'bun run --cwd "src/js/packages/event-to-object" build',
68+
'bun install --cwd "src/js/packages/@reactpy/client"',
69+
'bun run --cwd "src/js/packages/@reactpy/client" build',
70+
'bun install --cwd "src/js/packages/@reactpy/app"',
71+
'bun run --cwd "src/js/packages/@reactpy/app" build',
72+
'python "src/build_scripts/copy_dir.py" "src/js/packages/@reactpy/app/dist" "src/reactpy/static/assets"',
6673
]
6774
artifacts = []
6875

src/js/.eslintrc.json

-31
This file was deleted.

src/js/bun.lockb

5.06 KB
Binary file not shown.

src/js/eslint.config.mjs

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import react from "eslint-plugin-react";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import globals from "globals";
4+
import tsParser from "@typescript-eslint/parser";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
});
17+
18+
export default [
19+
...compat.extends(
20+
"eslint:recommended",
21+
"plugin:react/recommended",
22+
"plugin:@typescript-eslint/recommended",
23+
),
24+
{
25+
ignores: ["**/node_modules/", "**/dist/"],
26+
},
27+
{
28+
plugins: {
29+
react,
30+
"@typescript-eslint": typescriptEslint,
31+
},
32+
33+
languageOptions: {
34+
globals: {
35+
...globals.browser,
36+
...globals.node,
37+
},
38+
39+
parser: tsParser,
40+
ecmaVersion: "latest",
41+
sourceType: "module",
42+
},
43+
44+
settings: {
45+
react: {
46+
version: "detect",
47+
},
48+
},
49+
50+
rules: {
51+
"@typescript-eslint/ban-ts-comment": "off",
52+
"@typescript-eslint/no-explicit-any": "off",
53+
"@typescript-eslint/no-non-null-assertion": "off",
54+
"@typescript-eslint/no-empty-function": "off",
55+
"react/prop-types": "off",
56+
},
57+
},
58+
];

src/js/package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"devDependencies": {
3-
"@typescript-eslint/eslint-plugin": "^5.58.0",
4-
"@typescript-eslint/parser": "^5.58.0",
5-
"eslint": "^8.38.0",
6-
"eslint-plugin-react": "^7.32.2",
7-
"prettier": "^3.0.0-alpha.6"
3+
"@eslint/eslintrc": "^3.2.0",
4+
"@eslint/js": "^9.18.0",
5+
"@typescript-eslint/eslint-plugin": "^8.21.0",
6+
"@typescript-eslint/parser": "^8.21.0",
7+
"eslint": "^9.18.0",
8+
"eslint-plugin-react": "^7.37.4",
9+
"globals": "^15.14.0",
10+
"prettier": "^3.4.2"
811
},
912
"license": "MIT",
1013
"scripts": {

src/js/packages/@reactpy/app/.eslintrc.json

-19
This file was deleted.
-3.99 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import react from "eslint-plugin-react";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import globals from "globals";
4+
import tsParser from "@typescript-eslint/parser";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
});
17+
18+
export default [
19+
...compat.extends(
20+
"eslint:recommended",
21+
"plugin:react/recommended",
22+
"plugin:@typescript-eslint/recommended",
23+
),
24+
{
25+
plugins: {
26+
react,
27+
"@typescript-eslint": typescriptEslint,
28+
},
29+
30+
languageOptions: {
31+
globals: {
32+
...globals.browser,
33+
},
34+
35+
parser: tsParser,
36+
ecmaVersion: "latest",
37+
sourceType: "module",
38+
},
39+
40+
rules: {},
41+
},
42+
];

src/js/packages/@reactpy/app/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
"dependencies": {
66
"@reactpy/client": "file:../client",
77
"event-to-object": "file:../../event-to-object",
8-
"preact": "^10.7.0"
8+
"preact": "^10.25.4"
99
},
1010
"devDependencies": {
11-
"@types/react": "^17.0",
12-
"@types/react-dom": "^17.0",
1311
"typescript": "^5.7.3"
1412
},
1513
"scripts": {
0 Bytes
Binary file not shown.

src/js/packages/@reactpy/client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"preact": "^10.25.4"
2222
},
2323
"devDependencies": {
24-
"@types/json-pointer": "^1.0.31",
24+
"@types/json-pointer": "^1.0.34",
2525
"@types/react": "^17.0",
2626
"@types/react-dom": "^17.0",
2727
"typescript": "^5.7.3"
0 Bytes
Binary file not shown.

src/js/packages/event-to-object/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"devDependencies": {
2323
"happy-dom": "^8.9.0",
2424
"lodash": "^4.17.21",
25-
"tsm": "^2.0.0",
25+
"tsm": "^2.3.0",
2626
"typescript": "^5.7.3",
27-
"uvu": "^0.5.1"
27+
"uvu": "^0.5.6"
2828
},
2929
"scripts": {
3030
"build": "tsc -b",

0 commit comments

Comments
 (0)