Commit Graph

2156 Commits

Author SHA1 Message Date
Simon Young
3d85936009
update cli version (#4333)
Co-authored-by: simon <simon@reflex.dev>
2024-11-07 19:17:55 -08:00
Khaleel Al-Adhami
a454b705a8
fix imports with alias from $ (#4332) 2024-11-07 19:17:07 -08:00
Khaleel Al-Adhami
4c4c59bf04
convert event return types to type hints (#4331) 2024-11-07 16:33:42 -08:00
Masen Furer
2ee2d52035
Fix pyi file merged after custom_attrs type change (#4330) 2024-11-07 16:18:28 -08:00
Elijah Ahianyo
855a20fd1c
[GTM-648]Add Missing Table props (#4322)
* Add Missing Table props

* add more props
2024-11-07 16:04:03 -08:00
Masen Furer
227d09a02c
test_exception_handlers: add test case that triggers ErrorBoundary (#4327) 2024-11-07 16:01:37 -08:00
benedikt-bartscher
8fd5c9f200
improve typing for serializer decorator (#4317)
* improve typing for serializer decorator

* use wrapped logic

* dang it darglint

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-11-07 15:52:11 -08:00
Khaleel Al-Adhami
0c482bda3c
mark var methods as private (#4319) 2024-11-07 14:50:26 -08:00
Khaleel Al-Adhami
7843a517bc
change custom attr to accept any (#4323) 2024-11-07 14:18:13 -08:00
benedikt-bartscher
2cb193e8d6
improve app_src typing (#4324) 2024-11-07 14:08:37 -08:00
Simon Young
e457d53924
Adding hosting v1 support (#4309)
Co-authored-by: simon <simon@reflex.dev>
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-11-06 17:18:41 -08:00
Khaleel Al-Adhami
68407ce2d8
unbreak pyi plotly (#4320) 2024-11-06 16:56:26 -08:00
Khaleel Al-Adhami
3bd35f53f2
add type hinting for plotly (#4279)
* add type hinting for plotly

* fix merge
2024-11-06 16:41:13 -08:00
Khaleel Al-Adhami
93ae79aa60
fix call_function events sent from backend (#4316) 2024-11-06 15:13:00 -08:00
Khaleel Al-Adhami
b9d73edd66
add metainfo to keyevent (#4287)
* 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
2024-11-06 15:10:02 -08:00
Thomas Brandého
4c0b49135b
stop ignoring some lint rules (#4311)
* bump python packages version

* stop ignoring some lint rules that pass ruff check

* stop ignoring rule F541

* remove sneaky test file
2024-11-06 13:32:31 -08:00
Khaleel Al-Adhami
6ea797d0cd
pin marked to correct version (#4313)
* pin marked to correct version

* remove it completely?

* missing quotations

* match against reflex
2024-11-06 11:28:08 -08:00
Carlos
8a4701143e
add toast classname prop (#4310) 2024-11-06 09:49:09 -08:00
Thomas Brandého
54b081c104
allow custom bunfig.toml file (#4280)
* allow custom bunfig.toml file

* always copy custom bunfig

* split tests into half

* forgot a space

* use different syntax

* also split node latest check

* turn off failfast for app harness

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-11-06 09:31:13 -08:00
Simon Young
8d5187432f
add codeowners (#4312)
Co-authored-by: simon <simon@reflex.dev>
2024-11-06 09:30:43 -08:00
Khaleel Al-Adhami
c57d496184
improve typing for non decorated events (#4308)
* improve typing for non decorated events

* fix any typing
2024-11-06 09:21:19 -08:00
Khaleel Al-Adhami
bfa7ca639f
better missing system package message (#4306)
* better missing system package message

* change error type
2024-11-06 09:21:04 -08:00
Khaleel Al-Adhami
6334cfab0d
allow for event handlers to ignore args (#4282)
* allow for event handlers to ignore args

* use a constant

* dang it darglint

* forgor

* keep the tests but move them to valid place
2024-11-06 09:20:37 -08:00
simon
d9ab3a0f1c Revert "add v1 support"
This reverts commit c216eeafeb.
2024-11-05 18:28:16 -08:00
simon
c216eeafeb add v1 support 2024-11-05 18:23:18 -08:00
Carlos
01e3844ac4
default props comment for GraphinTooltip (#4101)
* default props comment for GraphinTooltip

* update
2024-11-05 14:03:07 -08:00
benedikt-bartscher
4a6c16e9dc
More env var cleanup (#4248)
* 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
2024-11-05 12:25:13 -08:00
Thomas Brandého
1c4f410052
bump python packages version (#4302) 2024-11-05 10:50:43 -08:00
Thomas Brandého
ce22ca5f71
rollback to 14.2.16 until v15 is more stable (#4297) 2024-11-05 10:50:32 -08:00
Khaleel Al-Adhami
b5d1e03de1
improve object var symantics (#4290)
* 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
2024-11-05 09:56:10 -08:00
Thomas Brandého
0ed7c5d969
expose rx.get_state() to get instance of state from anywhere (#3959)
* expose rx.get_state() to get instance of state from anywhere

* fix circular import and add read-only proxy
2024-11-05 16:21:59 +01:00
abulvenz
bb903b605a
Fix wrong hook (#4295)
* fix: Typo in variable name.

* fix: Using existing hook constant.

---------

Co-authored-by: Benedikt Bartscher <bb@senbax.de>
2024-11-04 15:20:02 -08:00
Khaleel Al-Adhami
1122cbf0b1
handle none case in state setattr (#4301) 2024-11-04 14:37:58 -08:00
benedikt-bartscher
b3c199870e
bypass pydantic runtime validation for state init (#4256)
* bypass pydantic runtime validation for state init
closes #4235

* cleanup
2024-11-04 13:05:39 -08:00
graham
702808afa6
Bugfix/leave gitignore as is (#4291)
* 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
2024-11-04 11:36:12 -08:00
Khaleel Al-Adhami
51b0f7d28e
special case field in _isinstance (#4298) 2024-11-04 11:06:24 -08:00
Khaleel Al-Adhami
16ed266d11
move check of path to only check name (#4299)
* move check of path to only check name

* assert .name in other tests as well

* get even more ones
2024-11-04 11:01:14 -08:00
Khaleel Al-Adhami
ca81e623db
add noop event (#4288)
* add noop event

* fix pyi

* get it right pyright

* why

* remove silly events

* fix tests

* remove semi colon

* errors in merging
2024-11-04 10:33:07 -08:00
Khaleel Al-Adhami
6394a6dfc5
raise error when get package manager is not found (#4289)
* raise error when get package manager is not found

* add escape hatch

* handle installing frontend packages more gracefully

* fix no return

* dang it darglint
2024-11-04 10:31:24 -08:00
Masen Furer
163acf70a2
[ENG-759] [ENG-1104] patch json.dumps to handle __wrapped__ objects (#4166)
* [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>
2024-11-04 10:11:51 -08:00
Masen Furer
0d9fc53a7d
[REF-3961] move "warn_if_too_large" logic into BaseState (#4284)
Check for too large serialized state whenever `BaseState._serialize` is used,
so it can apply to all state managers, not just `StateManagerRedis`.
2024-11-04 10:11:04 -08:00
Tom Gotsman
b70f33d972
Update overlay props (#4261)
* hover card and one prop for dialog

* add missing props of drawer

* fix context and dropdown menu

* add popover props

* fix hover card and alert dialog final

* fix pyi

* update drawer pyi

* pyi fix again

* fix from masen changes

* fix pyi

* fix pyi again

* ruff fix

---------

Co-authored-by: Tom Gotsman <tomgotsman@Toms-MacBook-Pro.local>
2024-11-01 16:14:46 -07:00
Elijah Ahianyo
bcd51779e6
[GTM-345]Define component props in class for doc discoverability (#4183)
* Define component props in class for doc discoverability

* add other files

* fix accordion typing

* add more

* pyright fix

* pyi fix

* pyi fix fr

* resinstate connection banner api

* precommit fix

* fix reflex-web test for select

* exclude props we don't need from compiling.
use regular model fields where necessary

* fix counter tests

* list partial fix

* list fix

* list fix

* precommit fix

* Accept suggestions

* Update reflex/components/radix/primitives/accordion.py

Co-authored-by: Masen Furer <m_github@0x26.net>

* address missed comment

* pyright fix

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-01 10:55:02 +00:00
Elijah Ahianyo
dbc9ab2d63
change gallery link to Templates (#4283) 2024-10-31 17:14:53 -07:00
Thomas Brandého
c07eb2a6a0
[ENG-3943]type check for event handler if spec arg are typed (#4046)
* 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>
2024-10-31 12:45:28 -07:00
Khaleel Al-Adhami
c8cecbf3cc
fix typo in dataeditor prop (#4281)
* fix typo in dataeditor prop

* move other ones as well
2024-10-31 11:20:15 -07:00
Elijah Ahianyo
a968231750
[ENG-3892]Shiki codeblock support decorations (#4234)
* 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
2024-10-31 09:33:49 +00:00
Nikhil Rao
84b0864e7e
Add option to scroll to bottom (#4276)
* Add option to scroll to bottom

* use var shenangins

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-10-30 17:57:38 -07:00
Khaleel Al-Adhami
e5e494108e
improve page title default (#4278) 2024-10-30 17:48:23 -07:00
Khaleel Al-Adhami
a2126beca1
generate docs for event handlers (#4277) 2024-10-30 17:31:38 -07:00