Commit Graph

6 Commits

Author SHA1 Message Date
Thomas Brandého
61cb72596e
enable PTH rule (#4476)
* enable PTH rule

* fix import in test_call_script

* fix units tests

* reorder ruff rules

* Update reflex/utils/build.py

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

* format pyproject.toml

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-12-13 14:06:26 -08:00
Thomas Brandého
4ecb0b81ce
enable RUF rules for linting (#4465) 2024-12-10 09:11:50 -08:00
benedikt-bartscher
2cb193e8d6
improve app_src typing (#4324) 2024-11-07 14:08:37 -08: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
Masen Furer
a66e0f2e11
[ENG-3870] rx.call_script with f-string var produces incorrect code (#4039)
* Add additional test cases for rx.call_script

Include internal vars inside an f-string to be properly rendered on the backend
and frontend.

* [ENG-3870] rx.call_script with f-string var produces incorrect code

Avoid casting javascript code with embedded Var as LiteralStringVar

There are two cases that need to be handled:

1. The javascript code contains Vars with VarData, these can only be evaluated
   in the component context, since they may use hooks. Vars with VarData cannot be
   used from the backend. In this case, we cast the given code as a raw js
   expression and include the extracted VarData.

2. The javascript code has no VarData. In this case, we pass the code as the
   raw js expression and cast to a python str to get a js literal string to eval.

* use VarData.__bool__ instead of `is None`
2024-10-03 14:18:53 -07:00
Thomas Brandého
3f538865b5
reorganize all tests in a single top folder (#3981)
* lift node version restraint to allow more recent version if already installed

* add node test for latest version

* change python version

* use purple for debug logs

* update workflow

* add playwright dev dependency

* update workflow

* change test

* oops

* improve test

* update test

* fix tests

* mv units tests to a subfolder

* reorganize tests

* fix install

* update test_state

* revert node changes and only keep new tests organization

* move integration tests in tests/integration

* fix integration workflow

* fix dockerfile workflow

* fix dockerfile workflow 2

* fix shared_state
2024-09-26 01:22:52 +02:00