Commit Graph

2220 Commits

Author SHA1 Message Date
Masen Furer
047c1ac753
Better support for LiteralComponentVar inside CustomComponent
Carry vars, hooks, custom code, and refs of any components passed as props
through the CustomComponent (rx.memo).
2025-02-13 22:45:35 -08:00
Khaleel Al-Adhami
7c4257a222
give option to only use main thread (#4809)
* give option to only use main thread

* change default to main thread

* fix comment

* default to None, as 0 would raise a ValueError

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

* add warning about passing 0

* move executor to config

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2025-02-13 18:36:30 -08:00
Khaleel Al-Adhami
8e579efe47
remove some benchmarks from CI (#4812) 2025-02-13 16:17:06 -08:00
Khaleel Al-Adhami
b44bbc81a0
import var perf improvements (#4813)
* import var perf improvements

* use tuples over iterator

* the only thing that matters

* maybe tuple map is faster than tuple list comprehension

* do it in one list comprehension
2025-02-13 15:54:10 -08:00
Khaleel Al-Adhami
aac61c69c2
actually get rid of callable var fr fr (#4821) 2025-02-13 15:40:01 -08:00
Khaleel Al-Adhami
6fb491471b
cache get_type_hints for environment (#4820) 2025-02-13 13:44:02 -08:00
Khaleel Al-Adhami
40294a7c9e
standarize filename from upload (#4734)
* standarize filename from upload

* all my friends hate fast api upload file

* make deprecated filename private

* lstrip the "/"

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

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2025-02-13 13:36:59 -08:00
Khaleel Al-Adhami
c6fb4e238d
improve into component conversion (#4754)
* improve into component conversion

* correct the order of .State
2025-02-13 12:44:42 -08:00
Khaleel Al-Adhami
10c45b185c
adjust setter to include type annotation (#4726)
* adjust setter to include type annotation

* apparently this discovered some bugs

* remove some pyright ignores

* add str to int/float conversion

* dang it darglint
2025-02-13 12:44:27 -08:00
Thomas Brandého
2ba73f7ff9
bump ruff to 0.9.6 (#4817) 2025-02-13 10:19:33 -08:00
Khaleel Al-Adhami
d79366d8b2
benchmark experimentation (#4811)
* benchmark experimentation

* do the same for test_evaluate_page

* import templates beforehands

* add auto reload

* disable extensions
2025-02-12 14:51:58 -08:00
Thomas Brandého
dd5b817f0f
fix port handling (#4773)
* handle port better

* setting port via envvar is possible again

* change default deploy_url and api_url

* fix for review

* update docstring

* type new envvar as optional
2025-02-12 19:06:01 +01:00
Khaleel Al-Adhami
977e1dcb67
update deps 2025-02-11 (#4804) 2025-02-12 09:05:36 -08:00
Thomas Brandého
a31301cb4f
add stateful benchmarks (#4764)
* add stateful benchmarks

* make stateful stuff more complex

* unpack tuple in itertag

* fix comment
2025-02-11 18:51:05 -08:00
Masen Furer
7da96a1175
pyproject.toml: bump to 0.7.1 for further development (#4808) 2025-02-11 18:41:04 -08:00
Masen Furer
3f68a27a22
[ENG-4647] Fix env_file handling (#4805)
* [ENG-4647] Fix env_file handling

* Import dotenv.load_dotenv early to avoid ImportError while loading
  rxconfig.py
* Read ENV_FILE from the environment explicitly.

fix #4803

* Config.Config: use_enum_values = False

Save enum fields as the enum object rather than the value.
2025-02-11 18:05:33 -08:00
Khaleel Al-Adhami
cb2e7df96a
invert logic of default hot reload exclusion (#4807)
* invert logic of default hot reload exclusion

* console debug reload paths
2025-02-11 17:47:44 -08:00
Khaleel Al-Adhami
6cbdd00169
fix toast provider needed (#4801)
* fix toast provider needed

* fix tests
2025-02-11 16:46:06 -08:00
Simon Young
289d10d30e
test actions in codeql (#4802) 2025-02-11 16:04:03 -08:00
Simon Young
e5e6c4e1d7
Create codeql.yml (#4799)
* Create codeql.yml

* add config

* fix that guy who's mad

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2025-02-11 15:49:06 -08:00
Declan Brady
894a01a5a5
Add toast.loading from the sonner package (#4792) 2025-02-11 12:21:27 -08:00
Thomas Brandého
64b1630d02
set global loglevel for subprocesses (#4791) 2025-02-11 12:15:38 -08:00
Khaleel Al-Adhami
372bd22475
raise error when passing a str(var) (#4769)
* raise error when passing a str(var)

* make it faster

* fix typo

* fix tests

* mocker consistency

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>

* ditto

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>

---------

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>
2025-02-11 11:39:55 -08:00
Khaleel Al-Adhami
d545ee3f0b
move overlays to _app.js (#4794)
* move overlays to _app.js

* fix unit tests

* fix dynamic imports app

* fix unit cases once again

* clear custom compoent cache between app harness tests
2025-02-11 11:39:38 -08:00
Khaleel Al-Adhami
a194c90d6f
improve hot reload handling (#4795) 2025-02-11 11:39:28 -08:00
Khaleel Al-Adhami
90be664981
improve icon error message (#4796) 2025-02-11 11:39:14 -08:00
Masen Furer
85f07fcd89
Sticky tweaks: only show in prod mode (#4789)
* Sticky tweaks: only show in prod mode

Only display the sticky badge in prod mode.

Display the mini-badge for mobile and tablet; full badge only displayed at
desktop width.

* Remove localhost checking
2025-02-10 12:22:37 -08:00
Thomas Brandého
3a02d03cb1
fix bun path handling and add a test (#4785)
* fix bun path handling and add a test

* fix flags

* fix tests

* fix unit tests and mock object

* fix units test again

* revert some changes for now

* remove unused test
2025-02-10 11:44:44 -08:00
Masen Furer
8b2c7291d3
Add ComputedVar overloads for BASE_TYPE, SQLA_TYPE, and DATACLASS_TYPE (#4777)
Allow typing to find __getattr__ for rx.var that returns an object-like model.
2025-02-07 17:38:42 -08:00
Simon Young
3de04156e9
allow gunicorn worker to be disabled (#4774)
* allow gunicorn worker to be disabled

* allow gunicorn worker to be disabled

* rewrite the command

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2025-02-07 17:20:35 -08:00
Khaleel Al-Adhami
ee731a908d
provide plotly subpackages (#4776) 2025-02-07 17:19:28 -08:00
Masen Furer
70920a64be
Copy/update assets on compile (#4765)
* Add path_ops.update_directory_tree:

Copy missing and newer files from src to dest

* add console.timing context

Log debug messages with timing for different processes.

* Update assets tree as app._compile step.

If the assets change between hot reload, then update them before reloading (in
case a CSS file was added or something).

* Add timing for other app._compile events

* Only copy assets if assets exist

* Fix docstring for update_directory_tree
2025-02-07 14:59:22 -08:00
Masen Furer
c17cda3e95
Ensure EventCallback exposes EventActionsMixin properties (#4772) 2025-02-07 14:57:12 -08:00
Khaleel Al-Adhami
f3220470e8
fix dynamic icons for underscore and positional argument (#4767)
* fix dynamic icons for underscore and positional argument

* use no return
2025-02-07 14:20:29 -08:00
Khaleel Al-Adhami
b3b79a652d
improve foreach behavior with strings (#4751)
* improve foreach behavior with strings

* add a defensive guard before giving up

* add integration tests
2025-02-06 10:41:38 -08:00
Khaleel Al-Adhami
ab558ce172
increase nested type checking for component var types (#4756)
* increase nested type checking for component var types

* handle mapping as dict in type hint

* fix weird cases of using _isinstance instead of isinstance

* test out nested=0

* move union below

* don't use _instance for simple unions
2025-02-06 10:09:40 -08:00
Khaleel Al-Adhami
9d23271c14
improve behavior on missing language with markdown code blocks (#4750)
* improve behavior on missing language with markdown code blocks

* special case on literal var

* fix tests

* missing f

* remove extra throw
2025-02-06 10:09:26 -08:00
Khaleel Al-Adhami
1651289485
use getattr when given str in getitem (#4761)
* use getattr when given str in getitem

* stronger checking and tests

* switch ordering

* use safe issubclass

* calculate origin differently
2025-02-06 10:09:05 -08:00
Khaleel Al-Adhami
6f4d328cde
add a config variable to add extra overlay components (#4763)
* add a config variable to add extra overlay components

* add integration test

* Apply suggestions from code review

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2025-02-05 18:34:53 -08:00
Khaleel Al-Adhami
88eae92d9b
make computed var generic over mapping (#4762) 2025-02-05 16:16:30 -08:00
Masen Furer
49e48a5a8c
Resolve custom component version dynamically (#4759)
If the custom component is using setuptools_scm or some other dynamic
versioning scheme, use `build.util` to get the actual version being published.
2025-02-05 16:15:23 -08:00
Thomas Brandého
d0199a326f
move benchmarks and add some more (#4758)
* move benchmarks and add some more

* change key and paths

* parametrize tests

* more specific ignore

* rename fixture

* remove previous file

* add tests for _compile_stateful_components
2025-02-05 13:19:45 -08:00
Khaleel Al-Adhami
19f40745f8
remove base_state from event types (#4740)
* remove base_state from event types

* pyi that guy

* unpack is new

* woops

* use type alias type to remove ambiguity of where types go

* use same thing with LAMBDA_OR_STATE

* do it for event type
2025-02-05 12:09:15 -08:00
Carlos
d0ffc9b6ce
Update disabled backend component (#4747)
* Update disabled backend component

* fix test message

* it's ruff out there

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2025-02-05 10:35:48 -08:00
Khaleel Al-Adhami
88f9424df7
chmod rm when rm fails (#4755) 2025-02-05 10:25:47 -08:00
Thomas Brandého
59d8d1eb62
throw error if computed var has args (#4753)
* throw error if computed var has args

* change message
2025-02-05 09:23:41 -08:00
Khaleel Al-Adhami
af9a914ecc
move id to trigger instead of root (#4752) 2025-02-04 17:30:41 -08:00
Khaleel Al-Adhami
c3ac051bbb
don't memoize tooltip or skeleton children (#4744)
* don't memoize tooltip children

* Skip memoizing skeleton children

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2025-02-04 10:59:03 -08:00
PeterYusuke
2e9654725e
fix readme typo and update gallery to templates (#4745) 2025-02-04 16:27:14 +01:00
Masen Furer
20e8b83421
[ENG-4570] Fix rx.foreach over dict (#4743)
* Add test case for literal dict in foreach

* [ENG-4570] Iterate over ObjectVar.entries

* Adjust expectations of test_foreach.py unit tests
2025-02-03 17:21:00 -08:00