Skip to content

Commit c2b6e37

Browse files
committed
use overrides to patch react to preact
1 parent 6003a42 commit c2b6e37

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

src/js/bun.lockb

-615 Bytes
Binary file not shown.

src/js/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@
1919
"event-to-object": "^0.1.2",
2020
"morphdom": "^2.7.4",
2121
"preact": "^10.26.9"
22+
},
23+
"overrides": {
24+
"react": "npm:@preact/compat",
25+
"react-dom": "npm:@preact/compat"
2226
}
2327
}

src/js/tsconfig.json

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
{
22
"compilerOptions": {
3-
"esModuleInterop": true,
4-
"jsx": "react-jsx",
5-
"jsxImportSource": "preact",
6-
"target": "esnext",
7-
"module": "esnext",
8-
"moduleResolution": "node",
9-
"composite": true,
103
"allowJs": false,
114
"allowSyntheticDefaultImports": true,
125
"declaration": true,
136
"declarationMap": true,
7+
"esModuleInterop": true,
148
"forceConsistentCasingInFileNames": true,
159
"isolatedModules": true,
10+
"jsx": "react-jsx",
11+
"jsxImportSource": "preact",
1612
"lib": ["DOM", "DOM.Iterable", "esnext"],
13+
"module": "esnext",
14+
"moduleResolution": "node",
1715
"noEmitOnError": true,
1816
"noUnusedLocals": true,
17+
"paths": {
18+
"react": ["./node_modules/preact/compat/"],
19+
"react-dom": ["./node_modules/preact/compat/"]
20+
},
1921
"resolveJsonModule": true,
2022
"skipLibCheck": true,
2123
"sourceMap": true,
2224
"strict": true,
23-
"typeRoots": ["./node_modules/@types"],
24-
"paths": {
25-
"react": ["./node_modules/preact/compat/"],
26-
"react-dom": ["./node_modules/preact/compat/"]
27-
}
28-
},
29-
"resolve": {
30-
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json", ".svg", ".css"]
31-
},
32-
"include": ["src"]
25+
"target": "esnext"
26+
}
3327
}

tests/test_app/tests/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ def start_playwright_client(cls):
117117
cls.browser = cls.playwright.chromium.launch(headless=bool(headless))
118118
cls.page = cls.browser.new_page()
119119
cls.page.set_default_timeout(10000)
120-
cls.page.on("console", lambda msg: print(f"{msg.type.upper()}: {msg.text}"))
121-
cls.page.on("pageerror", lambda err: print(f"ERROR: {err.name}: {err.message}"))
120+
cls.page.on("console", lambda msg: print(f"CLIENT {msg.type.upper()}: {msg.text}"))
121+
cls.page.on("pageerror", lambda err: print(f"CLIENT EXCEPTION: {err.name}: {err.message}"))
122122

123123
@classmethod
124124
def shutdown_playwright_client(cls):

0 commit comments

Comments
 (0)