Commit Graph

1941 Commits

Author SHA1 Message Date
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
Khaleel Al-Adhami
4254eadce3
use better typing for on_load (#4274)
* use better typing for on_load

* make app dataclass

* get it right pyright

* make lifespan into a dataclass
2024-10-30 16:52:16 -07:00
Masen Furer
2ab662b757
[ENG-4013] Catch more exceptions for dill pickle fallback (#4270)
Additionally catch TypeError, IndexError, and ValueError which may be thrown
when attempting to pickle unpicklable objects.
2024-10-30 16:50:19 -07:00
Khaleel Al-Adhami
c288741cab
resync steps with task advance (#4275) 2024-10-30 15:16:34 -07:00
Khaleel Al-Adhami
141cb8d21b
unbreak ci lighthouse (#4273)
* unbreak ci lighthouse

* forgot to precommit
2024-10-30 15:16:16 -07:00
benedikt-bartscher
0bdc828889
cleanup dead code (#4271) 2024-10-30 13:58:22 -07:00
Khaleel Al-Adhami
24363170d3
components as literal vars (#4223)
* 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
2024-10-30 11:31:28 -07:00
Khaleel Al-Adhami
c8a7ee52bf
add type validation for state setattr (#4265)
* add type validation for state setattr

* add type to check to state setattr

* add type validation to computed vars
2024-10-30 11:11:03 -07:00
Khaleel Al-Adhami
4260a0cfc3
rx.event(background=True) (#4263)
* event background True

* fix typo

* fix overloads

* forgor

* remove extra parens

* more forgor
2024-10-30 11:10:51 -07:00
Elijah Ahianyo
d6540b192e
Fix for shiki copy button animation firing off after clicking copy button (#4252) 2024-10-30 15:54:22 +00:00
Khaleel Al-Adhami
d478387007
expose staticPageGenerationTimeout (#4266)
* expose staticPageGenerationTimeout

* update tests
2024-10-29 22:02:35 -07:00
Khaleel Al-Adhami
1f627c5a30
update nodejs to lts 22 for real this time (#4267) 2024-10-29 22:02:21 -07:00
Khaleel Al-Adhami
98394ceb8e
add existing path subclass for env checks (#4260)
* add existing path subclass for env checks

* use the power of dataclasses

* use metaclass

* fake the class name

* use annotated

* use flag instead of dict

* dang it darglint

* cleanups
2024-10-29 13:02:10 -07:00
Masen Furer
8f07082eba
Handle props annotated as list/dict of EventHandler (#4257)
These props are NOT event triggers themselves, but rather they are props that
expect a list or dict of event handlers.

Additional fix for calling an `@rx.event` decorated event handler with no
arguments.
2024-10-28 16:59:26 -07:00
Khaleel Al-Adhami
41b1958626
fix stateful components on delayed evaluation (#4247)
* fix stateful components on delayed evaluation

* remove unused code

* ignore custom components in stateful components

* skip ones with wraps

* fix order of operations and add note
2024-10-28 12:13:46 -07:00
benedikt-bartscher
08d8d54b50
port enum env var support from #4248 (#4251)
* port enum env var support from #4248

* add some tests for interpret env var functions
2024-10-28 11:56:40 -07:00