Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ commands = [
'bun run --cwd "src/js/packages/@reactpy/client" build',
'bun install --cwd "src/js/packages/@reactpy/app"',
'bun run --cwd "src/js/packages/@reactpy/app" build',
'python "src/build_scripts/copy_dir.py" "src/js/packages/@reactpy/app/node_modules/@pyscript/core/dist" "src/reactpy/static/pyscript"',
'python "src/build_scripts/copy_dir.py" "src/js/packages/@reactpy/app/node_modules/morphdom/dist" "src/reactpy/static/morphdom"',
'python "src/build_scripts/copy_dir.py" "src/js/node_modules/@pyscript/core/dist" "src/reactpy/static/pyscript"',
'python "src/build_scripts/copy_dir.py" "src/js/node_modules/morphdom/dist" "src/reactpy/static/morphdom"',
]
artifacts = []

Expand Down
Binary file modified src/js/bun.lockb
Binary file not shown.
26 changes: 20 additions & 6 deletions src/js/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
{
"workspaces": [
"packages/*",
"packages/@reactpy/*"
],
"catalog": {
"preact": "^10.27.2",
"@pyscript/core": "^0.7.11",
"morphdom": "^2.7.7",
"typescript": "^5.9.3",
"json-pointer": "^0.6.2",
"@types/json-pointer": "^1.0.34",
"@reactpy/client": "file:./packages/@reactpy/client",
"event-to-object": "file:./packages/event-to-object"
},
"devDependencies": {
"@eslint/js": "^9.29.0",
"bun-types": "^1.2.16",
"eslint": "^9.18.0",
"globals": "^15.14.0",
"prettier": "^3.4.2",
"typescript-eslint": "^8.34.0"
"@eslint/js": "^9.39.1",
"bun-types": "^1.3.3",
"eslint": "^9.39.1",
"globals": "^16.5.0",
"prettier": "^3.6.2",
"typescript-eslint": "^8.47.0"
},
"license": "MIT",
"scripts": {
Expand Down
Binary file modified src/js/packages/@reactpy/app/bun.lockb
Binary file not shown.
12 changes: 6 additions & 6 deletions src/js/packages/@reactpy/app/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"dependencies": {
"@reactpy/client": "file:../client",
"event-to-object": "file:../../event-to-object",
"preact": "^10.25.4"
"@reactpy/client": "catalog:",
"event-to-object": "catalog:",
"preact": "catalog:"
},
"description": "ReactPy's client-side entry point. This is strictly for internal use and is not designed to be distributed.",
"devDependencies": {
"@pyscript/core": "^0.6",
"morphdom": "^2",
"typescript": "^5.8.3"
"@pyscript/core": "catalog:",
"morphdom": "catalog:",
"typescript": "catalog:"
},
"license": "MIT",
"name": "@reactpy/app",
Expand Down
Binary file modified src/js/packages/@reactpy/client/bun.lockb
Binary file not shown.
12 changes: 5 additions & 7 deletions src/js/packages/@reactpy/client/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"author": "Ryan Morshead",
"dependencies": {
"json-pointer": "^0.6.2",
"preact": "^10.26.9"
"json-pointer": "catalog:",
"preact": "catalog:",
"event-to-object": "catalog:"
},
"description": "A client for ReactPy implemented in React",
"devDependencies": {
"@types/json-pointer": "^1.0.34",
"typescript": "^5.8.3"
"@types/json-pointer": "catalog:",
"typescript": "catalog:"
},
"keywords": [
"react",
Expand All @@ -18,9 +19,6 @@
"license": "MIT",
"main": "dist/index.js",
"name": "@reactpy/client",
"peerDependencies": {
"event-to-object": "<1.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/reactive-python/reactpy"
Expand Down
Binary file modified src/js/packages/event-to-object/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion src/js/packages/event-to-object/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Ryan Morshead",
"dependencies": {
"json-pointer": "^0.6.2"
"json-pointer": "catalog:"
},
"description": "Converts a JavaScript events to JSON serializable objects.",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/reactpy/pyscript/component_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ruff: noqa: TC004, N802, N816, RUF006
# ruff: noqa: N816, RUF006
# type: ignore
from typing import TYPE_CHECKING

Expand Down
2 changes: 1 addition & 1 deletion src/reactpy/testing/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def __aenter__(self) -> BackendFixture:
self.log_records = self._exit_stack.enter_context(capture_reactpy_logs())

# Wait for the server to start
self.webserver.config.setup_event_loop()
self.webserver.config.get_loop_factory()
self.webserver_task = asyncio.create_task(self.webserver.serve())
await asyncio.sleep(1)

Expand Down
8 changes: 3 additions & 5 deletions src/reactpy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,17 @@ def string_to_reactpy(
try:
root_node: etree._Element = fromstring(
html.strip(),
parser=etree.HTMLParser(
parser=etree.HTMLParser( # type: ignore
remove_comments=True,
remove_pis=True,
remove_blank_text=True,
recover=not strict,
),
)
except etree.XMLSyntaxError as e:
if not strict:
raise e # nocov
except Exception as e:
msg = (
"An error has occurred while parsing the HTML.\n\n"
"This HTML may be malformatted, or may not perfectly adhere to HTML5.\n"
"This HTML may be malformatted, or may not adhere to the HTML5 spec.\n"
"If you believe the exception above was due to something intentional, you "
"can disable the strict parameter on string_to_reactpy().\n"
"Otherwise, repair your broken HTML and try again."
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def pytest_addoption(parser: Parser) -> None:
@pytest.fixture(autouse=True, scope="session")
def install_playwright():
subprocess.run(["playwright", "install", "chromium"], check=True) # noqa: S607, S603
subprocess.run(["playwright", "install-deps"], check=True) # noqa: S607, S603


@pytest.fixture(autouse=True, scope="session")
Expand Down
4 changes: 3 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ def make_links_blue(node):


def test_non_html_tag_behavior():
source = "<my-tag data-x=something><my-other-tag key=a-key /></my-tag>"
source = (
"<my-tag data-x=something> </broken-tag> <my-other-tag key=a-key /> </my-tag>"
)

expected = {
"tagName": "my-tag",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ def SomeComponent():
input_1 = await display.page.wait_for_selector("#i_1")
input_2 = await display.page.wait_for_selector("#i_2")

await input_1.type("1")
await input_1.type("1", delay=DEFAULT_TYPE_DELAY)

poll_value = poll(lambda: value.current)

await poll_value.until_equals(1)

await input_2.focus()
await input_2.type("2")
await input_2.type("2", delay=DEFAULT_TYPE_DELAY)

await poll_value.until_equals(12)

Expand All @@ -125,7 +125,7 @@ def SomeComponent():
input_1 = await display.page.wait_for_selector("#i_1")
input_2 = await display.page.wait_for_selector("#i_2")

await input_1.type("1")
await input_1.type("1", delay=DEFAULT_TYPE_DELAY)

poll_value = poll(lambda: value.current)

Expand All @@ -136,6 +136,6 @@ def SomeComponent():

await poll_value.until_equals("1")

await input_2.type("2")
await input_2.type("2", delay=DEFAULT_TYPE_DELAY)

await poll_value.until_equals("2")
Loading