Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a115b3f3e6 | ||
![]() |
e148f19555 | ||
![]() |
270efb9f1b | ||
![]() |
d067fe9bb9 | ||
![]() |
72b0737544 |
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "reflex"
|
||||
version = "0.5.5"
|
||||
version = "0.5.6"
|
||||
description = "Web apps in pure Python."
|
||||
license = "Apache-2.0"
|
||||
authors = [
|
||||
|
@ -84,12 +84,18 @@ In the example above, you will be able to do `rx.list`
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from reflex.utils import lazy_loader
|
||||
from reflex.utils import (
|
||||
compat, # for side-effects
|
||||
lazy_loader,
|
||||
)
|
||||
|
||||
# import this here explicitly to avoid returning the page module since page attr has the
|
||||
# same name as page module(page.py)
|
||||
from .page import page as page
|
||||
|
||||
# Remove the `compat` name from the namespace, it was imported for side-effects only.
|
||||
del compat
|
||||
|
||||
RADIX_THEMES_MAPPING: dict = {
|
||||
"components.radix.themes.base": ["color_mode", "theme", "theme_panel"],
|
||||
"components.radix.themes.color_mode": ["color_mode"],
|
||||
|
@ -3,6 +3,8 @@
|
||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||
# ------------------------------------------------------
|
||||
|
||||
from reflex.utils import compat
|
||||
|
||||
from . import admin as admin
|
||||
from . import app as app
|
||||
from . import base as base
|
||||
@ -190,6 +192,7 @@ from .utils.serializers import serializer as serializer
|
||||
from .vars import Var as Var
|
||||
from .vars import cached_var as cached_var
|
||||
|
||||
del compat
|
||||
RADIX_THEMES_MAPPING: dict
|
||||
RADIX_THEMES_COMPONENTS_MAPPING: dict
|
||||
RADIX_THEMES_LAYOUT_MAPPING: dict
|
||||
|
@ -66,7 +66,7 @@ class Foreach(Component):
|
||||
raise ForeachVarError(
|
||||
f"Could not foreach over var `{iterable._var_full_name}` of type Any. "
|
||||
"(If you are trying to foreach over a state var, add a type annotation to the var). "
|
||||
"See https://reflex.dev/docs/library/layout/foreach/"
|
||||
"See https://reflex.dev/docs/library/dynamic-rendering/foreach/"
|
||||
)
|
||||
|
||||
if (
|
||||
@ -95,7 +95,8 @@ class Foreach(Component):
|
||||
if len(params) == 0 or len(params) > 2:
|
||||
raise ForeachRenderError(
|
||||
"Expected 1 or 2 parameters in foreach render function, got "
|
||||
f"{[p.name for p in params]}. See https://reflex.dev/docs/library/layout/foreach/"
|
||||
f"{[p.name for p in params]}. See "
|
||||
"https://reflex.dev/docs/library/dynamic-rendering/foreach/"
|
||||
)
|
||||
|
||||
if len(params) >= 1:
|
||||
|
@ -107,7 +107,7 @@ def cancel_upload(upload_id: str) -> EventSpec:
|
||||
An event spec that cancels the upload when triggered.
|
||||
"""
|
||||
return call_script(
|
||||
f"upload_controllers[{Var.create_safe(upload_id, _var_is_string=True)._var_name_unwrapped!r}]?.abort()"
|
||||
f"upload_controllers[{Var.create_safe(upload_id, _var_is_string=True)._var_name_unwrapped}]?.abort()"
|
||||
)
|
||||
|
||||
|
||||
|
@ -61,7 +61,6 @@ if TYPE_CHECKING:
|
||||
|
||||
Delta = Dict[str, Any]
|
||||
var = computed_var
|
||||
config = get_config()
|
||||
|
||||
|
||||
# If the state is this large, it's considered a performance issue.
|
||||
@ -2319,6 +2318,24 @@ def _dill_reduce_state(pickler, obj):
|
||||
dill.Pickler.dispatch[type](pickler, obj)
|
||||
|
||||
|
||||
def _default_lock_expiration() -> int:
|
||||
"""Get the default lock expiration time.
|
||||
|
||||
Returns:
|
||||
The default lock expiration time.
|
||||
"""
|
||||
return get_config().redis_lock_expiration
|
||||
|
||||
|
||||
def _default_token_expiration() -> int:
|
||||
"""Get the default token expiration time.
|
||||
|
||||
Returns:
|
||||
The default token expiration time.
|
||||
"""
|
||||
return get_config().redis_token_expiration
|
||||
|
||||
|
||||
class StateManagerRedis(StateManager):
|
||||
"""A state manager that stores states in redis."""
|
||||
|
||||
@ -2326,10 +2343,10 @@ class StateManagerRedis(StateManager):
|
||||
redis: Redis
|
||||
|
||||
# The token expiration time (s).
|
||||
token_expiration: int = config.redis_token_expiration
|
||||
token_expiration: int = pydantic.Field(default_factory=_default_token_expiration)
|
||||
|
||||
# The maximum time to hold a lock (ms).
|
||||
lock_expiration: int = config.redis_lock_expiration
|
||||
lock_expiration: int = pydantic.Field(default_factory=_default_lock_expiration)
|
||||
|
||||
# The keyspace subscription string when redis is waiting for lock to be released
|
||||
_redis_notify_keyspace_events: str = (
|
||||
|
Loading…
Reference in New Issue
Block a user