Skip to content

Commit 8f3806b

Browse files
committed
Merge remote-tracking branch 'origin/main' into add-context-for-lock-expiry
2 parents ca93158 + 1d71117 commit 8f3806b

File tree

13 files changed

+292
-224
lines changed

13 files changed

+292
-224
lines changed

README.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,50 @@ See our [architecture page](https://reflex.dev/blog/2024-03-21-reflex-architectu
3939

4040
## ⚙️ Installation
4141

42-
Open a terminal and run (Requires Python 3.10+):
43-
44-
```bash
45-
pip install reflex
46-
```
42+
**Important:** We strongly recommend using a virtual environment to ensure the `reflex` command is available in your PATH.
4743

4844
## 🥳 Create your first app
4945

50-
Installing `reflex` also installs the `reflex` command line tool.
46+
### 1. Create the project directory
5147

52-
Test that the install was successful by creating a new project. (Replace `my_app_name` with your project name):
48+
Replace `my_app_name` with your project name:
5349

5450
```bash
5551
mkdir my_app_name
5652
cd my_app_name
53+
```
54+
55+
### 2. Set up a virtual environment
56+
57+
Create and activate virtual environment
58+
59+
```bash
60+
# On Windows:
61+
python -m venv .venv
62+
.venv\Scripts\activate
63+
64+
# On macOS/Linux:
65+
python3 -m venv .venv
66+
source .venv/bin/activate
67+
```
68+
69+
### 3. Install Reflex
70+
71+
Reflex is available as a pip package (Requires Python 3.10+):
72+
73+
```bash
74+
pip install reflex
75+
```
76+
77+
### 4. Initialize the project
78+
79+
This command initializes a template app in your new directory:
80+
81+
```bash
5782
reflex init
5883
```
5984

60-
This command initializes a template app in your new directory.
85+
### 5. Run the app
6186

6287
You can run this app in development mode:
6388

@@ -69,6 +94,10 @@ You should see your app running at http://localhost:3000.
6994

7095
Now you can modify the source code in `my_app_name/my_app_name.py`. Reflex has fast refreshes so you can see your changes instantly when you save your code.
7196

97+
### Troubleshooting
98+
99+
If you installed Reflex without a virtual environment and the `reflex` command is not found, you can run commands using: `python3 -m reflex init` and `python3 -m reflex run`
100+
72101
## 🫧 Example App
73102

74103
Let's go over an example: creating an image generation UI around [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). For simplicity, we just call the [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), but you could replace this with an ML model run locally.

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"reflex/components/el/elements/tables.pyi": "686eb70ea7d8c4dafb0cc5c284e76184",
4040
"reflex/components/el/elements/typography.pyi": "684e83dde887dba12badd0fb75c87c04",
4141
"reflex/components/gridjs/datatable.pyi": "98a7e1b3f3b60cafcdfcd8879750ee42",
42-
"reflex/components/lucide/icon.pyi": "ecaa40d72315ff4b8577f22c1537c0f3",
42+
"reflex/components/lucide/icon.pyi": "cc0bbb10e53b339b8c8f10c00996768c",
4343
"reflex/components/markdown/markdown.pyi": "2f84254a548e908020949564fc289339",
4444
"reflex/components/moment/moment.pyi": "e1952f1c2c82cef85d91e970d1be64ab",
4545
"reflex/components/plotly/plotly.pyi": "4311a0aae2abcc9226abb6a273f96372",

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "reflex"
3-
version = "0.8.16dev1"
3+
version = "0.8.17dev1"
44
description = "Web apps in pure Python."
55
license.text = "Apache-2.0"
66
authors = [
@@ -31,12 +31,12 @@ dependencies = [
3131
"python-multipart >=0.0.20,<1.0",
3232
"python-socketio >=5.12.0,<6.0",
3333
"redis >=5.2.1,<7.0",
34-
"reflex-hosting-cli >=0.1.55",
34+
"reflex-hosting-cli >=0.1.57",
3535
"rich >=13,<15",
3636
"sqlmodel >=0.0.27,<0.1",
3737
"starlette >=0.47.0",
3838
"typing_extensions >=4.13.0",
39-
"wrapt >=1.17.0,<2.0",
39+
"wrapt >=1.17.0,<3.0",
4040
]
4141

4242
classifiers = [
@@ -243,7 +243,7 @@ fail_fast = true
243243

244244
[[tool.pre-commit.repos]]
245245
repo = "https://github.com/astral-sh/ruff-pre-commit"
246-
rev = "v0.14.0"
246+
rev = "v0.14.1"
247247
hooks = [
248248
{ id = "ruff-format", args = [
249249
"reflex",

reflex/components/lucide/icon.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from reflex.vars.base import LiteralVar, Var
77
from reflex.vars.sequence import LiteralStringVar, StringVar
88

9-
LUCIDE_LIBRARY = "lucide-react@0.545.0"
9+
LUCIDE_LIBRARY = "lucide-react@0.546.0"
1010

1111

1212
class LucideIconComponent(Component):
@@ -1115,6 +1115,7 @@ def _get_imports(self):
11151115
"minimize",
11161116
"minus",
11171117
"monitor_check",
1118+
"monitor_cloud",
11181119
"monitor_cog",
11191120
"monitor_dot",
11201121
"monitor_down",

reflex/components/plotly/plotly.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Plotly(NoSSRComponent):
7272

7373
library = "react-plotly.js@2.6.0"
7474

75-
lib_dependencies: list[str] = ["plotly.js@3.1.1"]
75+
lib_dependencies: list[str] = ["plotly.js@3.1.2"]
7676

7777
tag = "Plot"
7878

@@ -303,7 +303,7 @@ class PlotlyBasic(Plotly):
303303

304304
library = "react-plotly.js@2.6.0"
305305

306-
lib_dependencies: list[str] = ["plotly.js-basic-dist-min@3.1.1"]
306+
lib_dependencies: list[str] = ["plotly.js-basic-dist-min@3.1.2"]
307307

308308
def add_imports(self) -> ImportDict | list[ImportDict]:
309309
"""Add imports for the plotly basic component.
@@ -329,7 +329,7 @@ class PlotlyCartesian(Plotly):
329329

330330
library = "react-plotly.js@2.6.0"
331331

332-
lib_dependencies: list[str] = ["plotly.js-cartesian-dist-min@3.1.1"]
332+
lib_dependencies: list[str] = ["plotly.js-cartesian-dist-min@3.1.2"]
333333

334334
def add_imports(self) -> ImportDict | list[ImportDict]:
335335
"""Add imports for the plotly cartesian component.
@@ -355,7 +355,7 @@ class PlotlyGeo(Plotly):
355355

356356
library = "react-plotly.js@2.6.0"
357357

358-
lib_dependencies: list[str] = ["plotly.js-geo-dist-min@3.1.1"]
358+
lib_dependencies: list[str] = ["plotly.js-geo-dist-min@3.1.2"]
359359

360360
def add_imports(self) -> ImportDict | list[ImportDict]:
361361
"""Add imports for the plotly geo component.
@@ -381,7 +381,7 @@ class PlotlyGl3d(Plotly):
381381

382382
library = "react-plotly.js@2.6.0"
383383

384-
lib_dependencies: list[str] = ["plotly.js-gl3d-dist-min@3.1.1"]
384+
lib_dependencies: list[str] = ["plotly.js-gl3d-dist-min@3.1.2"]
385385

386386
def add_imports(self) -> ImportDict | list[ImportDict]:
387387
"""Add imports for the plotly 3d component.
@@ -407,7 +407,7 @@ class PlotlyGl2d(Plotly):
407407

408408
library = "react-plotly.js@2.6.0"
409409

410-
lib_dependencies: list[str] = ["plotly.js-gl2d-dist-min@3.1.1"]
410+
lib_dependencies: list[str] = ["plotly.js-gl2d-dist-min@3.1.2"]
411411

412412
def add_imports(self) -> ImportDict | list[ImportDict]:
413413
"""Add imports for the plotly 2d component.
@@ -433,7 +433,7 @@ class PlotlyMapbox(Plotly):
433433

434434
library = "react-plotly.js@2.6.0"
435435

436-
lib_dependencies: list[str] = ["plotly.js-mapbox-dist-min@3.1.1"]
436+
lib_dependencies: list[str] = ["plotly.js-mapbox-dist-min@3.1.2"]
437437

438438
def add_imports(self) -> ImportDict | list[ImportDict]:
439439
"""Add imports for the plotly mapbox component.
@@ -459,7 +459,7 @@ class PlotlyFinance(Plotly):
459459

460460
library = "react-plotly.js@2.6.0"
461461

462-
lib_dependencies: list[str] = ["plotly.js-finance-dist-min@3.1.1"]
462+
lib_dependencies: list[str] = ["plotly.js-finance-dist-min@3.1.2"]
463463

464464
def add_imports(self) -> ImportDict | list[ImportDict]:
465465
"""Add imports for the plotly finance component.
@@ -485,7 +485,7 @@ class PlotlyStrict(Plotly):
485485

486486
library = "react-plotly.js@2.6.0"
487487

488-
lib_dependencies: list[str] = ["plotly.js-strict-dist-min@3.1.1"]
488+
lib_dependencies: list[str] = ["plotly.js-strict-dist-min@3.1.2"]
489489

490490
def add_imports(self) -> ImportDict | list[ImportDict]:
491491
"""Add imports for the plotly strict component.

reflex/components/recharts/recharts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Recharts(Component):
99
"""A component that wraps a recharts lib."""
1010

11-
library = "recharts@3.2.1"
11+
library = "recharts@3.3.0"
1212

1313
def _get_style(self) -> dict:
1414
return {"wrapperStyle": self.style}
@@ -17,7 +17,7 @@ def _get_style(self) -> dict:
1717
class RechartsCharts(NoSSRComponent, MemoizationLeaf):
1818
"""A component that wraps a recharts lib."""
1919

20-
library = "recharts@3.2.1"
20+
library = "recharts@3.3.0"
2121

2222

2323
LiteralAnimationEasing = Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]

reflex/constants/installer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ def DEPENDENCIES(cls) -> dict[str, str]:
143143
"postcss-import": "16.1.1",
144144
"@react-router/dev": _react_router_version,
145145
"@react-router/fs-routes": _react_router_version,
146-
"vite": "npm:rolldown-vite@7.1.17",
146+
"vite": "npm:rolldown-vite@7.1.18",
147147
}
148148
OVERRIDES = {
149149
# This should always match the `react` version in DEPENDENCIES for recharts compatibility.
150150
"react-is": _react_version,
151151
"cookie": "1.0.2",
152-
"vite": "npm:rolldown-vite@7.1.17",
152+
"vite": "npm:rolldown-vite@7.1.18",
153153
}

reflex/istate/proxy.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __getattr__(self, name: str) -> Any:
198198
)
199199
raise ImmutableStateError(msg)
200200

201-
value = super().__getattr__(name)
201+
value = super().__getattr__(name) # pyright: ignore[reportAttributeAccessIssue]
202202
if not name.startswith("_self_") and isinstance(value, MutableProxy):
203203
# ensure mutations to these containers are blocked unless proxy is _mutable
204204
return ImmutableMutableProxy(
@@ -397,7 +397,7 @@ class MutableProxy(wrapt.ObjectProxy):
397397
}
398398

399399
# Dynamically generated classes for tracking dataclass mutations.
400-
__dataclass_proxies__: dict[type, type] = {}
400+
__dataclass_proxies__: dict[str, type] = {}
401401

402402
def __new__(cls, wrapped: Any, *args, **kwargs) -> MutableProxy:
403403
"""Create a proxy instance for a mutable object that tracks changes.
@@ -427,7 +427,7 @@ def __new__(cls, wrapped: Any, *args, **kwargs) -> MutableProxy:
427427
},
428428
)
429429
cls = cls.__dataclass_proxies__[wrapper_cls_name]
430-
return super().__new__(cls)
430+
return super().__new__(cls) # pyright: ignore[reportArgumentType]
431431

432432
def __init__(self, wrapped: Any, state: BaseState, field_name: str):
433433
"""Create a proxy for a mutable object that tracks changes.
@@ -543,7 +543,7 @@ def __getattr__(self, __name: str) -> Any:
543543
Returns:
544544
The attribute value.
545545
"""
546-
value = super().__getattr__(__name)
546+
value = super().__getattr__(__name) # pyright: ignore[reportAttributeAccessIssue]
547547

548548
if callable(value):
549549
if __name in self.__mark_dirty_attrs__:
@@ -554,7 +554,7 @@ def __getattr__(self, __name: str) -> Any:
554554
# Wrap methods that may return mutable objects tied to the state.
555555
value = wrapt.FunctionWrapper(
556556
value,
557-
self._wrap_recursive_decorator,
557+
self._wrap_recursive_decorator, # pyright: ignore[reportArgumentType]
558558
)
559559

560560
if (
@@ -564,8 +564,8 @@ def __getattr__(self, __name: str) -> Any:
564564
):
565565
# Wrap methods called on Base subclasses, which might do _anything_
566566
return wrapt.FunctionWrapper(
567-
functools.partial(value.__func__, self), # pyright: ignore [reportFunctionMemberAccess]
568-
self._wrap_recursive_decorator,
567+
functools.partial(value.__func__, self), # pyright: ignore [reportFunctionMemberAccess, reportAttributeAccessIssue]
568+
self._wrap_recursive_decorator, # pyright: ignore[reportArgumentType]
569569
)
570570

571571
if is_mutable_type(type(value)) and __name not in (
@@ -587,7 +587,7 @@ def __getitem__(self, key: Any) -> Any:
587587
Returns:
588588
The item value.
589589
"""
590-
value = super().__getitem__(key)
590+
value = super().__getitem__(key) # pyright: ignore[reportAttributeAccessIssue]
591591
if isinstance(key, slice) and isinstance(value, list):
592592
return [self._wrap_recursive(item) for item in value]
593593
# Recursively wrap mutable items retrieved through this proxy.
@@ -599,7 +599,7 @@ def __iter__(self) -> Any:
599599
Yields:
600600
Each item value (possibly wrapped in MutableProxy).
601601
"""
602-
for value in super().__iter__():
602+
for value in super().__iter__(): # pyright: ignore[reportAttributeAccessIssue]
603603
# Recursively wrap mutable items retrieved through this proxy.
604604
yield self._wrap_recursive(value)
605605

@@ -617,7 +617,7 @@ def __delitem__(self, key: str):
617617
Args:
618618
key: The key of the item.
619619
"""
620-
self._mark_dirty(super().__delitem__, args=(key,))
620+
self._mark_dirty(super().__delitem__, args=(key,)) # pyright: ignore[reportAttributeAccessIssue]
621621

622622
def __setitem__(self, key: str, value: Any):
623623
"""Set the item on the proxied object and mark state dirty.
@@ -626,7 +626,7 @@ def __setitem__(self, key: str, value: Any):
626626
key: The key of the item.
627627
value: The value of the item.
628628
"""
629-
self._mark_dirty(super().__setitem__, args=(key, value))
629+
self._mark_dirty(super().__setitem__, args=(key, value)) # pyright: ignore[reportAttributeAccessIssue]
630630

631631
def __setattr__(self, name: str, value: Any):
632632
"""Set the attribute on the proxied object and mark state dirty.

reflex/plugins/tailwind_v4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Constants(SimpleNamespace):
1717
"""Tailwind constants."""
1818

1919
# The Tailwindcss version
20-
VERSION = "tailwindcss@4.1.14"
20+
VERSION = "tailwindcss@4.1.15"
2121
# The Tailwind config.
2222
CONFIG = "tailwind.config.js"
2323
# Default Tailwind content paths
@@ -156,7 +156,7 @@ def get_frontend_development_dependencies(self, **context) -> list[str]:
156156
return [
157157
*super().get_frontend_development_dependencies(**context),
158158
Constants.VERSION,
159-
"@tailwindcss/postcss@4.1.14",
159+
"@tailwindcss/postcss@4.1.15",
160160
]
161161

162162
def pre_compile(self, **context):

reflex/state.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -523,15 +523,17 @@ def __init_subclass__(cls, mixin: bool = False, **kwargs):
523523

524524
new_backend_vars = {
525525
name: value if not isinstance(value, Field) else value.default_value()
526-
for name, value in list(cls.__dict__.items())
527-
if types.is_backend_base_variable(name, cls)
526+
for mixin_cls in [*cls._mixins(), cls]
527+
for name, value in list(mixin_cls.__dict__.items())
528+
if types.is_backend_base_variable(name, mixin_cls)
528529
}
529530
# Add annotated backend vars that may not have a default value.
530531
new_backend_vars.update({
531532
name: cls._get_var_default(name, annotation_value)
532-
for name, annotation_value in cls._get_type_hints().items()
533+
for mixin_cls in [*cls._mixins(), cls]
534+
for name, annotation_value in mixin_cls._get_type_hints().items()
533535
if name not in new_backend_vars
534-
and types.is_backend_base_variable(name, cls)
536+
and types.is_backend_base_variable(name, mixin_cls)
535537
})
536538

537539
cls.backend_vars = {
@@ -579,9 +581,6 @@ def __init_subclass__(cls, mixin: bool = False, **kwargs):
579581
cls.computed_vars[name] = newcv
580582
cls.vars[name] = newcv
581583
continue
582-
if types.is_backend_base_variable(name, mixin_cls):
583-
cls.backend_vars[name] = copy.deepcopy(value)
584-
continue
585584
if events.get(name) is not None:
586585
continue
587586
if not cls._item_is_event_handler(name, value):

0 commit comments

Comments
 (0)