Skip to content

Commit 1455f70

Browse files
committed
Rewrite event-to-object package (#1306)
1 parent 765b2e6 commit 1455f70

File tree

21 files changed

+773
-483
lines changed

21 files changed

+773
-483
lines changed

.github/workflows/.hatch-run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
python-version: ${{ matrix.python-version }}
4545
- name: Install Python Dependencies
46-
run: pip install --upgrade hatch uv
46+
run: pip install hatch
4747
- name: Run Scripts
4848
env:
4949
NPM_CONFIG_TOKEN: ${{ secrets.node-auth-token }}

.github/workflows/check.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ jobs:
3838
run-cmd: "hatch run docs:check"
3939
python-version: '["3.11"]'
4040
test-javascript:
41-
# Temporarily disabled while we rewrite the "event_to_object" package
42-
# https://github.com/reactive-python/reactpy/issues/1196
43-
if: 0
4441
uses: ./.github/workflows/.hatch-run.yml
4542
with:
4643
job-name: "{1}"

docs/source/about/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Unreleased
4949
- :pull:`1281` - ``reactpy.core.vdom._CustomVdomDictConstructor`` has been moved to ``reactpy.types.CustomVdomConstructor``.
5050
- :pull:`1281` - ``reactpy.core.vdom._EllipsisRepr`` has been moved to ``reactpy.types.EllipsisRepr``.
5151
- :pull:`1281` - ``reactpy.types.VdomDictConstructor`` has been renamed to ``reactpy.types.VdomConstructor``.
52+
- :pull:`1196` - Rewrite the ``event-to-object`` package to be more robust at handling properties on events.
5253

5354
**Removed**
5455

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ artifacts = []
8686

8787
[tool.hatch.envs.hatch-test]
8888
extra-dependencies = [
89-
"reactpy[all]",
9089
"pytest-sugar",
9190
"pytest-asyncio",
9291
"responses",
9392
"exceptiongroup",
9493
"jsonpointer",
9594
"starlette",
9695
]
96+
features = ["all"]
9797

9898
[[tool.hatch.envs.hatch-test.matrix]]
9999
python = ["3.10", "3.11", "3.12", "3.13"]
@@ -182,10 +182,7 @@ check = [
182182
'bun run --cwd "src/js/packages/@reactpy/app" checkTypes',
183183
]
184184
fix = ['bun install --cwd "src/js"', 'bun run --cwd "src/js" format']
185-
test = [
186-
'hatch run javascript:build_event_to_object',
187-
'bun run --cwd "src/js/packages/event-to-object" test',
188-
]
185+
test = ['hatch run javascript:build_event_to_object', 'bun test']
189186
build = [
190187
'hatch run "src/build_scripts/clean_js_dir.py"',
191188
'bun install --cwd "src/js"',
@@ -308,6 +305,8 @@ lint.ignore = [
308305
"PLR0912",
309306
"PLR0913",
310307
"PLR0915",
308+
# Allow imports anywhere
309+
"PLC0415",
311310
]
312311
lint.unfixable = [
313312
# Don't touch unused imports

src/js/bun.lockb

19 KB
Binary file not shown.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"author": "Ryan Morshead",
2+
"author": "Mark Bakhit",
3+
"contributors": [
4+
"Ryan Morshead"
5+
],
36
"dependencies": {
47
"json-pointer": "catalog:",
58
"preact": "catalog:",

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2-
"author": "Ryan Morshead",
2+
"author": "Mark Bakhit",
3+
"contributors": [
4+
"Ryan Morshead"
5+
],
36
"dependencies": {
47
"json-pointer": "catalog:"
58
},
69
"description": "Converts a JavaScript events to JSON serializable objects.",
710
"devDependencies": {
8-
"happy-dom": "^8.9.0",
11+
"happy-dom": "^15.0.0",
912
"lodash": "^4.17.21",
10-
"tsm": "^2.3.0",
1113
"typescript": "^5.8.3",
12-
"uvu": "^0.5.6"
14+
"vitest": "^2.1.8"
1315
},
1416
"keywords": [
1517
"event",
@@ -26,9 +28,8 @@
2628
},
2729
"scripts": {
2830
"build": "tsc -b",
29-
"checkTypes": "tsc --noEmit",
30-
"test": "uvu -r tsm tests"
31+
"checkTypes": "tsc --noEmit"
3132
},
3233
"type": "module",
33-
"version": "0.1.2"
34+
"version": "1.0.0"
3435
}

0 commit comments

Comments
 (0)