* fix memoized event trigger order
* allow to declare deps in event signature for memoized event triggers
* clean up the code to pass tests
* handle position of hooks
* clean up code
* revert test changes
* add future annotations
* remove non-necessary stuff
* reuse data_callback name if already set during first call to add_hooks
* remove HookVar and use Var with VarData instead
* remove test change
* readd removed line
* fix order of stmt for cleaner code
* fix typing
* something broke during the merge I guess
* remove hack and pass proper const for position
* oops, bad syntax in jinja
* use "hook_position" instead of "hook_positions"
match the name of the enum
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* 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
* Include step attribute in input
* Remove `step` prop from TextField
it is inherited from Input, and does not need to be redefined
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* Use empty string for None values in `rx.input` and `rx.el.input`
* fix tests
* fix pyi scripts
* use nullish coalescing operator
* fix unit tests
* use ternary operator so old browsers and dynamic components tests pass
* address comment on doing this only for optionals
* Fix tests
* pyright!
* fix comments
* 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
* use `macos-latest` runner
macos-12 is deprecated and the jobs don't start anymore, so see if we can run
fine on latest.
* unit_tests.yml: use python versions with arm64 builds
* 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
* Reuse the sqlalchemy engine once it's created
* Implement `rx.asession` for async database support
Requires setting `async_db_url` to the same database as `db_url`, except using
an async driver; this will vary by database.
* resolve the url first, so the key into _ENGINE is correct
* Ping db connections before returning them from pool
Move connect engine kwargs to a separate function
* the param is `echo`
* sanity check that config db_url and async_db_url are the same
throw a warning if the part following the `://` differs between these two
* create_async_engine: use sqlalchemy async API
update types
* redact ASYNC_DB_URL similarly to DB_URL when overridden in config
* update rx.asession docstring
* use async_sessionmaker
* Redact sensitive env vars instead of hiding them
* Add production-one-port example
A more complex version of simple-one-port that facilitates better layer caching
to shorten build times and multi-stage build to reduce final image size.
Harder to understand, but ultimately nicer to use.
* fix Caddyfile format to avoid complaints
* docker-examples: bump all base images to python:3.13