* add backend disabled dialog
* pyi that guy
* pyi the other guy
* extend test_connection_banner to also test the cloud banner
* oops, need asyncio _inside_ the app
* Update reflex/components/core/banner.py
Co-authored-by: Masen Furer <m_github@0x26.net>
* use universal cookies
* fix pre-commit
* revert universal cookie 🍪
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* Handle python `range` passed to rx.Var.create
Fix the range function to use Math.ceil to handle jagged steps.
Update test cases.
* Set ToVarOperation.__qualname__ for better repr
* rename private fields with leading underscore in App
* fix constants API
* fix public API for some attributes of App()
* fix conflicts properly 🙈
* remove extra private
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
* Fix setting default color mode in dev mode
Without this, the last_compiled_timestamp local storage never gets set because
it's always `null` until it gets set.
* test_client_storage: also pop `theme` key from next-themes
* remove deprecated features and support for py3.9
* remove other deprecated stuff
* update lock file
* fix units tests
* relock poetry
* fix _replace for computed_var
* fix some merge typo
* fix typing of deploy args
* fix benchmarks.yml versions
* console.error instead of raising Exception
* fix tests
* ignore lambdas when resolving annotations
* simplify redirect logic in event.py
* more fixes
* fix unit tests again
* give back default annotations for lambdas
* fix signature check for on_submit
* remove useless stuff
* update pyi
* readd the getattr
* raise if log_level is wrong type
* silly goose, loglevel is a subclass of str
* i don't believe this code
* add guard
---------
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
* make object var handle all mapping instead of just dict
* unbreak ci
* get it right pyright
* create generic variable for field
* add support for typeddict (to some degree)
* import from extensions
* [ENG-4351] Add mapping for lucide icons
For icon names that don't auto-translate to the correct lucide tag name,
provide manual override.
Fix#4621
* account for new mapping in unit tests
* unbreak link _hover
* add a test to catch the error
* change tmp path for harness
* add () to fixture
* add spacer to avoid initial hover
* only install chromium browser for faster ci
---------
Co-authored-by: Lendemor <thomas.brandeho@gmail.com>
* [ENG-2157] [Refix] Allow `rx.download` to resolve `rx.get_upload_url`
Update the special case in a way that works with the new Var system and its
unstoppable determination to concatenate strings instead of using template
string
This has been broken since 0.6.0, so a regression test was added to avoid
future inadvertant breakage.
Fix#2812 (again)
* use safer indirect eval
* Proxy backend requests on '/' to the frontend
If the optional extra `proxy` is installed, then the backend can handle all
requests by proxy unrecognized routes to the frontend nextjs server.
* Update lock file
* pre-commit fu
* AppHarness: set config frontend_port and backend_port
* integration: frontend port and backend port should return the same content
with proxying enabled by default in dev mode, both frontend and backend ports
on / should return the same content.
* Retry up to 100 times when proxying to frontend
* Reduce retry attempts to 25
Fix log level passing to subprocess
* scripts/wait_for_listening_port: primarily check HTTP responses
if the port is up or not, we don't really care... the HTTP request needs to
work and not return errors
* aiohttp is an optional dep
* adapt integration.sh for --backend-only (counter integration test)
* woops
* windows WTF?
* scratching my head 🎄
* double WTF windows
* Fix remaining integration tests
The default behavior for EventSpec is to treat the spec as a partial, wherein
if additional unfilled arguments are available, and the event trigger wants to
pass additional arguments, they will be applied positionally.
However, it never makes sense to fill in `callback` with an event trigger arg.
Therefore, if the callback is not provided initially, set it to None explicitly
so that some invalid value cannot be added later.
* BaseState.get_var_value helper to get a value from a Var
When given a state Var or a LiteralVar, retrieve the actual value associated
with the Var.
For state Vars, the returned value is directly tied to the associated state and
can be modified.
Modifying LiteralVar values or ComputedVar values will have no useful effect.
* Use Var[VAR_TYPE] annotation to take advantage of generics
This requires rx.Field to pass typing where used.
* Add case where get_var_value gets something that's not a var
* [ENG-4083] Track internal changes in dataclass instances
Create a dynamic subclass of MutableProxy with `__dataclass_fields__` set
according to the dataclass being wrapped.
* support dataclasses.asdict on MutableProxy instances
* add datetime var operations
* add future annotations
* add LiteralDatetimeVar
* remove methods that don't apply
* fix serialization
* add unit and integrations test
* oops, forgot to commit that important change
* Throw warnings when Redis lock is held for more than the allowed threshold
* initial tests
* fix tests and address comments
* fix tests fr, and use pydantic validators
* darglint fix
* increase lock expiration in tests to 2500
* remove print statement
---------
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
* [ENG-4165] Consider default and default_factory for state vars
When determining whether a state var should be marked as optional, check that
it is missing both default and default_factory and is not required.
Fix#4471
* add test for default factory with rx.foreach (#4515)
---------
Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com>
* Avoid double JSON encode/decode for socket.io
socket.io (python and js) already has a built in mechanism for JSON encoding
and decoding messages over the websocket. To use it, we pass a custom `json`
namespace which uses `format.json_dumps` (leveraging reflex serializers) to encode the
messages. This avoids sending a JSON-encoded string of JSON over the wire, and
reduces the number of serialization/deserialization passes over the message
data.
The side benefit is that debugging websocket messages in browser tools displays
the parsed JSON hierarchy and is much easier to work with.
* JSON5.parse in on_upload_progress handler responses
* add eradicate rules for commented out code
* remove output change
* fix pyi messed up indent
* fix pyi again
* fix layout docstring
* fix pyi_generator to remove commented out props from docs
* fix pyi_generator and regenerate some pyi
* fix double strip
* update all pyi
* try to fix stuff in pyi_gen
* whatever
* remove that maybe? i don't know
* fix that shit?
* fix more shit, idk
* better not see you ever again, extra line
* fix: handle default_factory in get_attribute_access_type, add tests for sqla dataclasses
* only test classes which have default_factory + add test for no default
* add test for color mode (initial and toggle)
* add css check
* add page reload in the tests
* update test to catch the appearance regression
* don't render the appearance prop of rx.theme