* allow for event handlers to ignore args
* use a constant
* dang it darglint
* forgor
* keep the tests but move them to valid place
* add metainfo to keyevent
* format code
* fix pyi files
* generate all prefixes of event types
* change format rule
* 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
* improve object var symantics
* add case for serializers
* check against serializer with to = dict
* add tests
* fix typing issues
* remove default value
* older version of python doesn't have assert type
* add base to rx field cases
* get it from typing_extension
* Refactor initialize_gitignore to support list type for files_to_ignore and improve current ignore handling. Dont sort the gitignore file.
* more consistent list comprehension var
* raise error when get package manager is not found
* add escape hatch
* handle installing frontend packages more gracefully
* fix no return
* dang it darglint
* [ENG-1104] patch `json.dumps` to handle `__wrapped__` objects
Unwrap proxied objects if the default serializer doesn't work.
* pre-commit fixup
* Skip default fallback logic when `cls` is specified
`cls` will provide its own default serialization mechanism, passing a `cls`
Encoder class is now also a way to opt-out of our patching shenanigans and just
use your own code.
This will work, provided the library doing the JSON encoding isn't also using
their own custom class.
* Override JSONEncoder.default instead of json.dumps
Many libraries (like httpx, used by openai), will use `from json import dumps`,
and if they do that before `reflex.state` gets imported, then they will get the
original dumps function instead of our patched one.
To workaround this, monkeypatch the `JSONEncoder.default` function instead.
This is also nicer behavior for custom subclasses of JSONEncoder; if someone
wants to opt-out of our monkeypatching, they can simply not call
`super().default(o)` in their subclass, which by default only raises a
TypeError.
---------
Co-authored-by: Nikhil Rao <nikhil@reflex.dev>
* type check for event handler if spec arg are typed
* fix the typecheck logic
* rearrange logic pieces
* add try except
* add try except around compare
* change form and improve type checking
* print key instead
* dang it darglint
* change wording
* add basic test to cover it
* add a slightly more complicated test
* challenge it a bit by doing small capital list
* add multiple argspec
* fix slider event order
* i hate 3.9
* add note for UnionType
* move function to types
* add a test for type hint is subclass
* make on submit dict str any
* add testing for dict cases
* add check against any
* accept dict str str
* bruh i used i twice
* escape strings and print actual error message
* disable the error and print deprecation warning instead
* disable tests
* fix doc message
---------
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
* Shiki codeblock support decorations
* add decorations to useEffect
* fix pyright
* validate decorations dict
* Fix exception message plus unit tests
* possible test fix
* fix pyright
* possible tests fix
* cast decorations before creating codeblock
* `plain` is not a valid theme
* pyi fix
* address PR comment