reflex 0.6.6a2__py3-none-any.whl → 0.6.6a3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

@@ -454,6 +454,10 @@ export const connect = async (
454
454
  queueEvents(update.events, socket);
455
455
  }
456
456
  });
457
+ socket.current.on("reload", async (event) => {
458
+ event_processing = false;
459
+ queueEvents([...initialEvents(), JSON5.parse(event)], socket);
460
+ })
457
461
 
458
462
  document.addEventListener("visibilitychange", checkVisibility);
459
463
  };
reflex/app.py CHANGED
@@ -73,6 +73,7 @@ from reflex.event import (
73
73
  EventSpec,
74
74
  EventType,
75
75
  IndividualEventType,
76
+ get_hydrate_event,
76
77
  window_alert,
77
78
  )
78
79
  from reflex.model import Model, get_db_status
@@ -1259,6 +1260,21 @@ async def process(
1259
1260
  )
1260
1261
  # Get the state for the session exclusively.
1261
1262
  async with app.state_manager.modify_state(event.substate_token) as state:
1263
+ # When this is a brand new instance of the state, signal the
1264
+ # frontend to reload before processing it.
1265
+ if (
1266
+ not state.router_data
1267
+ and event.name != get_hydrate_event(state)
1268
+ and app.event_namespace is not None
1269
+ ):
1270
+ await asyncio.create_task(
1271
+ app.event_namespace.emit(
1272
+ "reload",
1273
+ data=format.json_dumps(event),
1274
+ to=sid,
1275
+ )
1276
+ )
1277
+ return
1262
1278
  # re-assign only when the value is different
1263
1279
  if state.router_data != router_data:
1264
1280
  # assignment will recurse into substates and force recalculation of
@@ -3,7 +3,6 @@
3
3
  from typing import Dict, Literal
4
4
 
5
5
  from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent
6
- from reflex.utils import console
7
6
 
8
7
 
9
8
  class Recharts(Component):
@@ -11,19 +10,8 @@ class Recharts(Component):
11
10
 
12
11
  library = "recharts@2.13.0"
13
12
 
14
- def render(self) -> Dict:
15
- """Render the tag.
16
-
17
- Returns:
18
- The rendered tag.
19
- """
20
- tag = super().render()
21
- if any(p.startswith("css") for p in tag["props"]):
22
- console.warn(
23
- f"CSS props do not work for {self.__class__.__name__}. Consult docs to style it with its own prop."
24
- )
25
- tag["props"] = [p for p in tag["props"] if not p.startswith("css")]
26
- return tag
13
+ def _get_style(self) -> Dict:
14
+ return {"wrapperStyle": self.style}
27
15
 
28
16
 
29
17
  class RechartsCharts(NoSSRComponent, MemoizationLeaf):
@@ -11,7 +11,6 @@ from reflex.style import Style
11
11
  from reflex.vars.base import Var
12
12
 
13
13
  class Recharts(Component):
14
- def render(self) -> Dict: ...
15
14
  @overload
16
15
  @classmethod
17
16
  def create( # type: ignore
reflex/state.py CHANGED
@@ -1959,6 +1959,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1959
1959
  if var in self.base_vars or var in self._backend_vars:
1960
1960
  self._was_touched = True
1961
1961
  break
1962
+ if var == constants.ROUTER_DATA and self.parent_state is None:
1963
+ self._was_touched = True
1964
+ break
1962
1965
 
1963
1966
  def _get_was_touched(self) -> bool:
1964
1967
  """Check current dirty_vars and flag to determine if state instance was modified.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reflex
3
- Version: 0.6.6a2
3
+ Version: 0.6.6a3
4
4
  Summary: Web apps in pure Python.
5
5
  Home-page: https://reflex.dev
6
6
  License: Apache-2.0
@@ -34,12 +34,12 @@ reflex/.templates/web/utils/helpers/debounce.js,sha256=xGhtTRtS_xIcaeqnYVvYJNseL
34
34
  reflex/.templates/web/utils/helpers/paste.js,sha256=ef30HsR83jRzzvZnl8yV79yqFP8TC_u8SlN99cCS_OM,1799
35
35
  reflex/.templates/web/utils/helpers/range.js,sha256=FevdZzCVxjF57ullfjpcUpeOXRxh5v09YnBB0jPbrS4,1152
36
36
  reflex/.templates/web/utils/helpers/throttle.js,sha256=qxeyaEojaTeX36FPGftzVWrzDsRQU4iqg3U9RJz9Vj4,566
37
- reflex/.templates/web/utils/state.js,sha256=oNConr9R6v2pSlZTcxO9D3qkXZMWCyQHn3iG8IERF-0,28031
37
+ reflex/.templates/web/utils/state.js,sha256=16mswYQ40ly3uUTBVeMRxq0KFdSVkN20zVj2Pml5zn8,28182
38
38
  reflex/__init__.py,sha256=4R4EdOqGs60L9YmqrOpVhm39VDOpF9sGQ6ir4S-YGiY,10708
39
39
  reflex/__init__.pyi,sha256=K-xiTA024j_a9twP4H8nmbl82GGskoyQ66FJ2QqyXl4,11233
40
40
  reflex/__main__.py,sha256=6cVrGEyT3j3tEvlEVUatpaYfbB5EF3UVY-6vc_Z7-hw,108
41
41
  reflex/admin.py,sha256=_3pkkauMiTGJJ0kwAEBnsUWAgZZ_1WNnCaaObbhpmUI,374
42
- reflex/app.py,sha256=fi3pqTWP3dZx_AoBCs3GdwrQ_73NMwzIGNuknEyW8uM,54750
42
+ reflex/app.py,sha256=erCrSNFoNPnVLocomDVDQC9GfCAB0h3J8BqRDCi1Log,55355
43
43
  reflex/app_mixins/__init__.py,sha256=Oegz3-gZLP9p2OAN5ALNbsgxuNQfS6lGZgQA8cc-9mQ,137
44
44
  reflex/app_mixins/lifespan.py,sha256=IG72wp1Kas2polEP6Y1nB0wFPN3J4Kh0JAHvbQ-7wZ8,3185
45
45
  reflex/app_mixins/middleware.py,sha256=V5J06Ux9qZIHFX0pnz8qd3EuHHI8KIvtEKpfave_kjI,3209
@@ -308,8 +308,8 @@ reflex/components/recharts/general.py,sha256=G-uqoJ-wltsZS0lr-KkUjawfIbBr-pNIPBm
308
308
  reflex/components/recharts/general.pyi,sha256=vnRsLUIG5Ll7Vc4VNvtVaXMocoCoAsM0ip7wGYR2WCA,23243
309
309
  reflex/components/recharts/polar.py,sha256=JYwfQnTmda6Keml5iWrGv0-eV-KNIgkYJybWtkl9Ik0,15688
310
310
  reflex/components/recharts/polar.pyi,sha256=jAvLHbSaRQ-81wpDvlsVjh4mMKbcN5L7qyrQqe6181w,29429
311
- reflex/components/recharts/recharts.py,sha256=r3Fry0eE7vgonOvlOG-FrRlqDtyjowoyXG7rN5iZdHA,3595
312
- reflex/components/recharts/recharts.pyi,sha256=xwD-dYxpf4Jw8-F2JIFoCpjr8J4LVS6e2YkRKeRB_i0,7178
311
+ reflex/components/recharts/recharts.py,sha256=zzsyo668aRZUX8aAKmf_cSfMlVD97frco4-HkmpL1yI,3182
312
+ reflex/components/recharts/recharts.pyi,sha256=vPy4O4kAWG8hGrvqI6nKcr22L5OEDMb3P4zcSOnAVj4,7144
313
313
  reflex/components/sonner/__init__.py,sha256=L_mdRIy7-ccRGSz5VK6J8O-c-e-D1p9xWw29_ErrvGg,68
314
314
  reflex/components/sonner/toast.py,sha256=I43ktNqYUZoyJckk9KhQdx9s_M4Fhxez05VXZq0p6RA,11620
315
315
  reflex/components/sonner/toast.pyi,sha256=qUQVdvY5_wC8ng8CJQJnZO--6zhcjw8dEx5TKIyaDZk,7557
@@ -358,7 +358,7 @@ reflex/model.py,sha256=AaCs6V9iWFj-EZI7zfXL1LTy-TrnNfJKVit2MPqLM8M,14139
358
358
  reflex/page.py,sha256=N85R5tTI-NoFd9ArwYCN8OcV9aSPZIPrJI2ZFbH8ytk,2389
359
359
  reflex/reflex.py,sha256=ejJKZDYscjCYL1lMIPmPCbvqd5Gosw4FwbRsupyEIm4,21868
360
360
  reflex/route.py,sha256=WZS7stKgO94nekFFYHaOqNgN3zZGpJb3YpGF4ViTHmw,4198
361
- reflex/state.py,sha256=VxDHkkvNLzAZOe0e_sPwztoiOcBMXqomWF1-fQobi4w,134081
361
+ reflex/state.py,sha256=qFeY7g8SUovb3V-QNcoWS47eG4S4Y4_WV8gFb6rrJBI,134231
362
362
  reflex/style.py,sha256=-mBrpaq23jiNJIwgCir6Fzj182u9rGpp3qZ2cUt5aZs,12695
363
363
  reflex/testing.py,sha256=qkLVNeLcD3uxTg95WuV1IYoEhkmEdJ7o8Fbc8NaeoRQ,34792
364
364
  reflex/utils/__init__.py,sha256=y-AHKiRQAhk2oAkvn7W8cRVTZVK625ff8tTwvZtO7S4,24
@@ -388,8 +388,8 @@ reflex/vars/function.py,sha256=w_Xa7GGVHbcfP7nMqKG5-q9Y7Uj3Yinj1Csjqxz_leg,14596
388
388
  reflex/vars/number.py,sha256=BeHQr4Cj2gdXekEWcxSzLTIuRAC3sf6YvsdHlADETpQ,27499
389
389
  reflex/vars/object.py,sha256=dTfkkUGDmoxu7iPcKSnNJ-lTI48yoXbagUyA-lKwDDo,14335
390
390
  reflex/vars/sequence.py,sha256=mlmOkSV8FIxwdJHzQdu3NzHAoNB4KcGc93dcmdviIoo,49916
391
- reflex-0.6.6a2.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
392
- reflex-0.6.6a2.dist-info/METADATA,sha256=5fc1UxT1T6-ePqCYZBPdLLcKQvMZVu9gqJDoFDYjKQg,12101
393
- reflex-0.6.6a2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
394
- reflex-0.6.6a2.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
395
- reflex-0.6.6a2.dist-info/RECORD,,
391
+ reflex-0.6.6a3.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
392
+ reflex-0.6.6a3.dist-info/METADATA,sha256=AklydJ0ckgv6M0hyRShNCQxdCKPc8Og9a5ZAhpGdBMs,12101
393
+ reflex-0.6.6a3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
394
+ reflex-0.6.6a3.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
395
+ reflex-0.6.6a3.dist-info/RECORD,,