Commit Graph

1889 Commits

Author SHA1 Message Date
Masen Furer
e471dc199a
bump to 0.6.4 release 2024-10-29 16:38:37 -07:00
Masen Furer
00e0c44b84
bump to 0.6.4a3 2024-10-29 13:07:51 -07:00
Khaleel Al-Adhami
6be3a819b7
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:06:58 -07:00
benedikt-bartscher
2e100e38d9
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-29 13:06:58 -07:00
Masen Furer
cdbe7f820b
bump to 0.6.4a2 2024-10-28 17:00:24 -07:00
Masen Furer
5a5be8162b
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 17:00:13 -07:00
Masen Furer
85cae46ed3
bump to 0.6.4a1 2024-10-25 09:24:16 -07:00
Masen Furer
d85236b9b0
[ENG-3970] When normal pickle fails, try dill (#4239)
* [ENG-3970] When normal pickle fails, try dill

If dill is not installed, suggest that the user `pip install` it.

Fix #4147

* re-lock depenedencies

* Include original pickle error message for better debugging

When the pickling throws a warning and dill is not installed, include the
original pickle error.

Add a test case for an object that even dill cannot pickle to ensure error path
is hit as expected.

* py3.9 compatibility
2024-10-24 16:19:32 -07:00
Thomas Brandého
cba6993247
test for stateless apps (#3816)
* 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
2024-10-24 14:53:42 -07:00
Khaleel Al-Adhami
c3848d0db4
use $ syntax (#4237)
* use $ syntax

* missing test case change

* try being a little smart

* improve merge imports logic

* add public as well

* oops missed that one

* last one there
2024-10-24 14:34:39 -07:00
Masen Furer
2e703f7aaa
Fix 'enter_key_submit=True' on 'rx.text_area' by carrying custom_code on debounce (#4142)
* debounce: handle custom code from child component

Include _get_all_hooks when rendering the child element, instead of just
internal hooks.

* textarea: handle special behaviors during `create`

Move special behavior handling to `create` classmethod to allow carrying of
added props when wrapped in debounce, which does not call `_render` on the
child component.
2024-10-24 14:34:23 -07:00
benedikt-bartscher
c0ed8b7d91
fix: async default setters break setvar (#4169)
* fix: async default setters break setvar

* fix unit test
2024-10-24 14:27:35 -07:00
Khaleel Al-Adhami
d0c1eb7488
fix inverted alembic file check (#4238) 2024-10-24 14:26:31 -07:00
benedikt-bartscher
9d29e7f3ee
fix and test bug in config env loading (#4205)
* 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
2024-10-24 10:27:23 -07:00
Thomas Brandého
0bf778e270
make python-dotenv optional (#4222)
* python-dotenv is optional

* add type ignore
2024-10-23 16:29:50 -07:00
Masen Furer
24cef3d4b6
[ENG-3989] Ensure non-serialized states are present in StateManagerDisk (#4230)
If a non-root state was serialized, but its substates were not, then these
would not be populated when reloading the pickled state, because only substates
from the root were being populated with fresh versions.

Now, capture the substates from all fresh states and apply them to the
deserialized state for each substate to ensure that the entire state tree has
all substates instantiated after deserializing, even substates that were never
serialized originally.
2024-10-23 16:09:02 -07:00
Khaleel Al-Adhami
fafad0e3d5
add additional typing for calling events (#4218)
* add additional typing for calling events

* simplify some code

* self isn't with us

* fix pyi
2024-10-23 15:12:02 -07:00
Khaleel Al-Adhami
3eab2b6e7d
implement rx dynamic (#4195)
* implement rx dynamic

* dang it darglint

* add custom type
2024-10-22 14:27:04 -07:00
Khaleel Al-Adhami
a65fc2e90b
Add on progress typing to react player (#4211)
* add on progress typing to react player

* fix pyi file

* have the pyi here as well

* more pyi changes

* fix imports

* run pyi

* for some reason it want event on three lines no clue why

* simplify case for when type is in the same module

* run pyi

* remove last missing type for datadisplay
2024-10-22 13:09:14 -07:00
Simon Young
227fb2cb75
HOS-93: add support for .env file (#4219)
* HOS-93: add support for .env file

* HOS-93: remove stray print

* HOS-93: poetry lock

* HOS-93: update comment

---------

Co-authored-by: simon <simon@reflex.dev>
2024-10-22 12:37:17 -07:00
Thomas Brandého
13591793de
move client storage classes to their own file (#4216)
* move client storage classes to their own file

* fix 3.9 annotations
2024-10-22 21:17:31 +02:00
Thomas Brandého
0aca89781f
bump ruff to 0.7.0 (#4213)
* bump ruff to 0.7.0

* ignore SIM115 and reverse change for it
2024-10-22 20:48:47 +02:00
Simon Young
993bfaef2d
HOS-92: added max-request support to gunicorn (#4217)
Co-authored-by: simon <simon@reflex.dev>
2024-10-22 11:32:13 -07:00
Elijah Ahianyo
d63b3a2bce
[ENG-3848][ENG-3861]Shiki Code block Experimental (#4030)
* Shiki Code block Experimental

* refactor

* update code

* remove console.log

* add transformers to namespace

* some validations

* fix components paths

* fix ruff

* add a high-level component

* fix mapping

* fix mapping

* python 3.9+

* see if this fixes the tests

* fix pyi and annotations

* minimal update of theme and language map

* add hack for reflex-web/flexdown

* unit test file commit

* [ENG-3895] [ENG-3896] Update styling for shiki code block

* strip transformer triggers

* minor refactor

* linter

* fix pyright

* pyi fix

* add unit tests

* sneaky pyright ignore

* the transformer trigger regex should remove the language comment character

* minor refactor

* fix silly mistake

* component mapping in markdown should use the first child for codeblock

* use ternary operator in numbers.py, move code block args to class for docs discoverability

* precommit

* pyright fix

* remove id on copy button animation

* pyright fix for real

* pyi fix

* pyi fix fr

* check if svg exists

* copy event chain

* do a concatenation instead of first child

* added comment

---------

Co-authored-by: Carlos <cutillascarlos@gmail.com>
2024-10-22 17:01:34 +00:00
Khaleel Al-Adhami
c103ab5e28
Add type hinting to dataeditor events (#4210) 2024-10-21 18:53:51 -07:00
Khaleel Al-Adhami
3ab750fecd
add event types to suneditor (#4209) 2024-10-21 18:17:27 -07:00
Khaleel Al-Adhami
45959881ac
add type hinting to error boundary (#4182)
* add type hinting to error boundary

* remove logFrontendError

* fix other calls to handle_frontend_exception
2024-10-21 18:17:06 -07:00
Khaleel Al-Adhami
54ad9f0f4b
make var system expandable (#4175)
* make var system expandable

* use old syntax

* remove newer features

* that's a weird error

* remove unnecessary error message

* remove hacky getattr as it's no longer necessary

* improve color handling

* get it right pyright

* dang it darglint

* fix prototype to string

* don't try twice

* adjust test case

* add test for var alpha

* change place of type ignore

* fix json

* add name to custom var operation

* don't delete that you silly

* change logic

* remove extra word
2024-10-21 17:05:13 -07:00
Khaleel Al-Adhami
f39e8c9667
move all environment variables to the same place (#4192)
* move all environment variables to the same place

* reorder things around

* move more variables to environment

* remove cyclical imports

* forgot default value for field

* for some reason type hints aren't being interpreted

* put the field type *before* not after

* make it get

* move a bit more

* add more fields

* move reflex dir

* add return

* put things somewhere else

* add custom error
2024-10-21 13:28:55 -07:00
Masen Furer
c05da488f9
Raise TypeError when ComputedVar.__init__ gets bad kwargs (#4199)
It's easy to mis-spell `rx.var(cached=True)` instead of `rx.var(cache=True)`,
and in 0.6.3, this doesn't actual raise an error... the bad value is silently
discarded and the var is NOT marked as being cached.
2024-10-21 12:56:56 -07:00
Thomas Brandého
7168b42bab
versions bump before 0.6.4 (#4208) 2024-10-21 12:56:36 -07:00
benedikt-bartscher
7560bf6429
allow setting run mode via env, add helpers to determine it (#4168) 2024-10-21 12:26:09 -07:00
Khaleel Al-Adhami
fcc97b0402
upgrade node to latest lts (#4191) 2024-10-21 12:11:00 -07:00
Masen Furer
6cb87a812f
Fix runtime error on python 3.11.0 (#4197)
All generic types present in a Union must be parametrized on 3.11.0 if any
other generic types in the union are parametrized.

This appears to be a bug in 3.11.0, as the behavior is not observed in 3.11.1
or 3.10; fixing here as this is technically more correct anyway and avoids a
crash.
2024-10-17 19:21:43 -07:00
Masen Furer
330c280c78
When REDIS_URL is set, use redis, regardless of config preference. (#4196)
We might change this down the road, but we don't want to introduce a breaking
change at this time.
2024-10-17 16:54:36 -07:00
Masen Furer
e14c79d57d
[ENG-3954] Treat ArrayVar.foreach index as int (#4193)
* [ENG-3954] Treat ArrayVar.foreach index as int

* foreach: convert return value to a Var

When the value returned from the foreach is not hashable (mutable type), then
it will raise an exception if it is not first converted to a LiteralVar.
2024-10-17 16:16:24 -07:00
Khaleel Al-Adhami
101fb1b540
check for none before returning which (#4187) 2024-10-16 15:21:47 -07:00
Khaleel Al-Adhami
35810fe1bd
use larger or equal for node version check (#4189) 2024-10-16 15:20:51 -07:00
Khaleel Al-Adhami
d8ea2fc795
fix pyi for untyped event handlers (#4186)
* fix pyi for untyped event handlers

* no more empty lambdas
2024-10-16 13:39:49 -07:00
Alek Petuskey
13c9094343
Remove demo command (#4176)
* Remove demo command

* Format

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
2024-10-16 11:35:56 -07:00
Masen Furer
da9d7eabdd
Arbitrary arg access two levels deep for untyped handler (#4180)
* Arbitrary arg access two levels deep for untyped handler

Provide drop-in compatibility with existing component wrapping code
that was accessing attributes on the default handler arg type.

* py3.9 compat
2024-10-16 11:35:27 -07:00
Masen Furer
4422515f4b
LiteralEventChainVar becomes an ArgsFunctionOperation (#4174)
* LiteralEventChainVar becomes an ArgsFunctionOperation

Instead of using the ArgsFunctionOperation to create the string representation
of the _js_expr, make the identity of the var an ArgsFunctionOperation so the
_args_names and _return_expr remain accessible.

Rely on the default behavior of ArgsFunctionOperation to create the
_cached_var_name / _js_expr value.

This allows the compat shim in `format_event_chain` to remain functional, as it
does special handling for ArgsFunctionOperation to retain the previous behavior
of that function (this was a regression introduced in 0.6.2).

* _var_type is EventChain; fix parent class order

* Re-fix LiteralEventChainVar inheritence list w/ comment

* [ENG-3942] LiteralEventVar becomes VarCallOperation

instead of using `.call` when constructing the `_js_expr`, have the identity of
a LiteralEventVar as a VarCallOperation to take advantage of the _var_data
carrying.

* add event overlords

* EventCallback descriptor always returns EventSpec from class

Relax actual `__get__` definition to support the multitude of overloads

* test case for event related vars carrying _var_data

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-10-16 11:35:09 -07:00
Khaleel Al-Adhami
7565ae15ef
disk is memory is disk (#4185) 2024-10-16 11:31:05 -07:00
Khaleel Al-Adhami
2018be8e08
only treat dict object vars as key value mapping (#4177) 2024-10-15 12:21:03 -07:00
Masen Furer
5b802c2c9e
bump version to 0.6.4dev1 for further development (#4178) 2024-10-15 10:54:14 -07:00
Masen Furer
3a14025999
pin AppHarness tests to ubuntu-22.04 runner (#4173) 2024-10-14 15:36:30 -07:00
Manoj Bhat
d6797a1f1d
Change the defalut direction of radio group (#4070). (#4146)
- The default direction of radio groups is column.
- Since most use cases are horizontal, change the default direction from
  column to row.
2024-10-14 08:47:38 -07:00
Masen Furer
1d268f8b13
Support aria and data props (#4149)
* Support aria and data props

* Fix busted docstring

* Ignore special_attributes logic for defined props

* simplify special attribute checking logic

avoid special cases in the special case handling code 🙄
2024-10-14 08:45:25 -07:00
Khaleel Al-Adhami
b2d2719f90
add type hinting to events (#4145)
* 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>
2024-10-14 08:44:31 -07:00
Khaleel Al-Adhami
b1d449897a
unionize base var fields types (#4153)
* unionize base var fields types

* add tests

* fix union types for vars (#4152)

* remove 3.11 special casing

* special case on version

* fix old versions of python

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-10-11 17:27:15 -07:00