Skip to content

Commit aa307e1

Browse files
authored
2.0.0b8 (#1329)
1 parent 64d2f37 commit aa307e1

File tree

18 files changed

+62
-49
lines changed

18 files changed

+62
-49
lines changed

.github/workflows/.hatch-run.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ jobs:
4141
with:
4242
path: C:\Users\runneradmin\AppData\Local\ms-playwright\
4343
key: ${{ runner.os }}-playwright
44+
# FIXME: Temporarily added setup-node to fix lack of "Trusted Publishing" in Bun
45+
# Ref: https://github.com/oven-sh/bun/issues/15601
46+
- uses: actions/setup-node@v6
47+
with:
48+
node-version: 24
49+
registry-url: https://registry.npmjs.org/
4450
- uses: oven-sh/setup-bun@v2
4551
with:
4652
bun-version: latest

docs/docs_app/examples.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from __future__ import annotations
22

3-
from collections.abc import Iterator
3+
from collections.abc import Callable, Iterator
44
from io import StringIO
55
from pathlib import Path
66
from traceback import format_exc
7-
from typing import Callable
87

98
import reactpy
109
from reactpy.types import ComponentType
@@ -154,7 +153,7 @@ def getvalue(self) -> str:
154153

155154
def write(self, text: str) -> None:
156155
if len(self._lines) == self._max_lines:
157-
self._lines = self._lines[1:] + (text,)
156+
self._lines = (*self._lines[1:], text)
158157
else:
159158
self._lines += (text,)
160159
if self._callback is not None:

docs/docs_app/prod.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def main() -> None:
99
app.run(
1010
host="0.0.0.0", # noqa: S104
11-
port=int(os.environ.get("PORT", 5000)),
12-
workers=int(os.environ.get("WEB_CONCURRENCY", 1)),
11+
port=int(os.environ.get("PORT", "5000")),
12+
workers=int(os.environ.get("WEB_CONCURRENCY", "1")),
1313
debug=bool(int(os.environ.get("DEBUG", "0"))),
1414
)

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def CounterList():
88
def make_increment_click_handler(index):
99
def handle_click(event):
1010
new_value = counters[index] + 1
11-
set_counters(counters[:index] + [new_value] + counters[index + 1 :])
11+
set_counters([*counters[:index], new_value, *counters[index + 1 :]])
1212

1313
return handle_click
1414

docs/source/reference/_examples/matplotlib_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def ExpandableNumberInputs(values, set_values):
2626

2727
def set_value_at_index(event, index=i):
2828
new_value = float(event["target"]["value"] or 0)
29-
set_values(values[:index] + [new_value] + values[index + 1 :])
29+
set_values([*values[:index], new_value, *values[index + 1 :]])
3030

3131
inputs.append(poly_coef_input(i + 1, set_value_at_index))
3232

docs/source/reference/_examples/simple_dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async def animate():
5757
"x": last_data_point["x"] + 1,
5858
"y": last_data_point["y"] + random.gauss(mu.current, sigma.current),
5959
}
60-
set_data(data[1:] + [next_data_point])
60+
set_data([*data[1:], next_data_point])
6161

6262
return VictoryLine(
6363
{

docs/source/reference/_examples/snake_game.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def on_direction_change(event):
6868
if hasattr(Direction, event["key"]):
6969
maybe_new_direction = Direction[event["key"]].value
7070
direction_vector_sum = tuple(
71-
map(sum, zip(last_direction, maybe_new_direction))
71+
map(sum, zip(last_direction, maybe_new_direction, strict=False))
7272
)
7373
if direction_vector_sum != (0, 0):
7474
direction.current = maybe_new_direction
@@ -109,7 +109,7 @@ async def animate():
109109
set_food()
110110
new_snake = [*snake, new_snake_head]
111111
else:
112-
new_snake = snake[1:] + [new_snake_head]
112+
new_snake = [*snake[1:], new_snake_head]
113113

114114
set_snake(new_snake)
115115

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,15 @@ build_client = ['hatch run "src/build_scripts/build_js_client.py" {args}']
210210
build_app = ['hatch run "src/build_scripts/build_js_app.py" {args}']
211211
publish_event_to_object = [
212212
'hatch run javascript:build_event_to_object',
213-
'cd "src/js/packages/event-to-object" && bunx npm publish --provenance --access public',
213+
# FIXME: using npm publish to fix lack of "Trusted Publishing" in Bun
214+
# Ref: https://github.com/oven-sh/bun/issues/15601
215+
'cd "src/js/packages/event-to-object" && bunx npm@11.8.0 publish --provenance --access public',
214216
]
215217
publish_client = [
216218
'hatch run javascript:build_client',
217-
'cd "src/js/packages/@reactpy/client" && bunx npm publish --provenance --access public',
219+
# FIXME: using npm publish to fix lack of "Trusted Publishing" in Bun
220+
# Ref: https://github.com/oven-sh/bun/issues/15601
221+
'cd "src/js/packages/@reactpy/client" && bunx npm@11.8.0 publish --provenance --access public',
218222
]
219223

220224
#########################

src/reactpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from reactpy.utils import Ref, reactpy_to_string, string_to_reactpy
2424

2525
__author__ = "The Reactive Python Team"
26-
__version__ = "2.0.0b7"
26+
__version__ = "2.0.0b8"
2727

2828
__all__ = [
2929
"Ref",

src/reactpy/reactjs/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def component_from_npm(
110110
resolve_imports: bool = ...,
111111
resolve_imports_depth: int = ...,
112112
version: str = "latest",
113-
cdn: str = "https://esm.sh",
113+
cdn: str = "https://esm.sh/v135",
114114
fallback: Any | None = ...,
115115
unmount_before_update: bool = ...,
116116
allow_children: bool = ...,
@@ -124,7 +124,7 @@ def component_from_npm(
124124
resolve_imports: bool = ...,
125125
resolve_imports_depth: int = ...,
126126
version: str = "latest",
127-
cdn: str = "https://esm.sh",
127+
cdn: str = "https://esm.sh/v135",
128128
fallback: Any | None = ...,
129129
unmount_before_update: bool = ...,
130130
allow_children: bool = ...,
@@ -137,7 +137,7 @@ def component_from_npm(
137137
resolve_imports: bool = False,
138138
resolve_imports_depth: int = 5,
139139
version: str = "latest",
140-
cdn: str = "https://esm.sh",
140+
cdn: str = "https://esm.sh/v135",
141141
fallback: Any | None = None,
142142
unmount_before_update: bool = False,
143143
allow_children: bool = True,

0 commit comments

Comments
 (0)