* 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>
* 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
* 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
* 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
* 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
* rx.upload must include _var_data from props
str-casting the dropzone arguments removed any VarData they depended on, like
the state context.
update test_upload to include passing a prop from a state var
* Handle large payload delta from upload event handler
Fix update chunk chaining logic; try/catch wasn't catching errors from the
async inner function.
* Unit test updates
* test_client_storage: simulate backend state expiry
* [HOS-333] Send a "reload" message to the frontend after state expiry
1. a state instance expires on the backing store
2. frontend attempts to process an event against the expired token and gets a
fresh instance of the state without router_data set
3. backend sends a "reload" message on the websocket containing the event and
immediately stops processing
4. in response to the "reload" message, frontend sends
[hydrate, update client storage, on_load, <previous_event>]
This allows the frontend and backend to re-syncronize on the state of the app
before continuing to process regular events.
If the event in (2) is a special hydrate event, then it is processed normally
by the middleware and the "reload" logic is skipped since this indicates an
initial load or a browser refresh.
* unit tests working with redis
* fix and test bug in config env loading
* streamline env var interpretation with @adhami3310
* improve error messages, fix invalid value for TELEMETRY_ENABLED
* just a small hint
* ruffing
* fix typo from review
* refactor - ruff broke the imports..
* cleanup imports
* more
* add internal and enum env var support
* ruff cleanup
* more global imports
* revert telemetry, it lives in rx.Config
* minor fixes/cleanup
* i missed some refs
* fix darglint
* reload config is internal
* fix EnvVar name
* add test for EnvVar + minor typing improvement
* bool tests
* was this broken?
* retain old behavior
* migrate APP_HARNESS_HEADLESS to new env var system
* migrate more APP_HARNESS env vars to new config system
* migrate SCREENSHOT_DIR to new env var system
* refactor EnvVar.get to be a method
* readd deleted functions and deprecate them
* improve EnvVar api, cleanup RELOAD_CONFIG question
* move is_prod_mode back to where it was
* component as literal vars
* fix pyi
* use render
* fix pyi
* only render once
* add type ignore
* fix upload default value
* remove testcases if you don't pass them
* improve behavior
* fix render
* that's not how icon buttons work
* upgrade to next js 15 and remove babel and enable turbo
* upload is a silly guy
* woops
* how did this work before
* set env variable
* lower it even more
* lower it even more
* lower it even more
* only do literals as component vars
* test for stateless apps
* add playwright to dev dependencies
* fix docstring
* fix install of playwright in CI
* fix install again
* add allowed license
* add retry on running integrations step
* another attempt to fix licensing issue
* update timeout duration for retry
* fix timeout workflows
* remove dep changes
* remove outdated diff
* fix scope in new test and workflow for appharness
* run playwright tests last
* add type hinting to events
* fix pyi
* make it a list
* add on change
* dang it darglintz
* add future annotations
* add try except becuse i hate this
* add check for class
* aaaa
* sometimes you need to make hard decisions
* ono
* i hate unions
* add rx event
* move stuff around
* maybe
* special case osmething
* i don't need no test
* remove stray print
Co-authored-by: Masen Furer <m_github@0x26.net>
* remove another stray print
Co-authored-by: Masen Furer <m_github@0x26.net>
* add rx event
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* Handle rx.State subclasses defined in function
* create a new container module: `reflex.istate.dynamic` to save references to
dynamically generated substates.
* for substates with `<locals>` in the name, copy these to the container module
and update the name to avoid duplication.
* add test for "poor man" ComponentState
Fix#4128
* test_state: disable local def handling for dupe-detection test
* Track the original module and name for type hint evaluation
Also use the original name when checking for the "mangled name" pattern when
doing undeclared Var assignment checking.
* Only serialize base vars
* Never serialize router/router_data in substates
* Hash the schema to reduce serialized size
* lru_cache the schema to avoid recomputing it
* Get default for backend var defined in mixin
If the backend var is defined in a mixin class, it won't appear in
`cls.__dict__`, but the value is still retrievable via `getattr` on `cls`.
Prefer to use the actual defined default before using
`Var.get_default_value()`.
If `Var.get_default_value()` fails, set the default to `None` such that the
backend var still gets recognized as a backend var when it is used on `self`.
----
Update test_component_state to include backend vars
Extra coverage for backend vars with and without defaults, defined in a
ComponentState/mixin class.
* fix integration test
* Add additional test cases for rx.call_script
Include internal vars inside an f-string to be properly rendered on the backend
and frontend.
* [ENG-3870] rx.call_script with f-string var produces incorrect code
Avoid casting javascript code with embedded Var as LiteralStringVar
There are two cases that need to be handled:
1. The javascript code contains Vars with VarData, these can only be evaluated
in the component context, since they may use hooks. Vars with VarData cannot be
used from the backend. In this case, we cast the given code as a raw js
expression and include the extracted VarData.
2. The javascript code has no VarData. In this case, we pass the code as the
raw js expression and cast to a python str to get a js literal string to eval.
* use VarData.__bool__ instead of `is None`
* use pathlib as much as possible
* fixstuff
* break locally to unbreak in CI 🤷
* add type on env
* debug attempt 1
* debugged
* oops, there is the actual fix
* fix 3.9 compat
* remove format_state and override behavior for bare
* pass the test cases
* only do one level of dicting dataclasses
* remove dict and replace list with set
* delete unnecessary serialize calls
* remove serialize for mutable proxy
* dang it darglint
* lift node version restraint to allow more recent version if already installed
* add node test for latest version
* change python version
* use purple for debug logs
* update workflow
* add playwright dev dependency
* update workflow
* change test
* oops
* improve test
* update test
* fix tests
* mv units tests to a subfolder
* reorganize tests
* fix install
* update test_state
* revert node changes and only keep new tests organization
* move integration tests in tests/integration
* fix integration workflow
* fix dockerfile workflow
* fix dockerfile workflow 2
* fix shared_state