Commit Graph

2119 Commits

Author SHA1 Message Date
Khaleel Al-Adhami
8de14d4384
Fix recharts min width/height (#4672) 2025-01-22 11:11:25 -08:00
Thomas Brandého
728607643f
attempt to fix usage when volta is installing node (#4664)
* attempt to fix usage when volta is installing node

* use absolute() instead of resolve()

* fix stuff
2025-01-22 16:58:33 +01:00
Khaleel Al-Adhami
a923f657ac
retry failed tests (#4675)
* retry failed tests

* retry even more
2025-01-22 16:27:17 +01:00
Ahmad Hakim
80966dbff0
[ENG-4406] cell component wrapper (#4670)
* cell component wrapper

* add pyi files changes

---------

Co-authored-by: pourhakimi <84860195+pourhakimi@users.noreply.github.com>
Co-authored-by: Lendemor <thomas.brandeho@gmail.com>
2025-01-22 09:00:43 +02:00
Elijah Ahianyo
048416163d
Remove token check in reflex deploy (#4640)
This logic has been moved upstream to reflex-hosting-cli
2025-01-21 13:28:05 -08:00
Khaleel Al-Adhami
bea266b8ed
make object var handle all mapping instead of just dict (#4602)
* make object var handle all mapping instead of just dict

* unbreak ci

* get it right pyright

* create generic variable for field

* add support for typeddict (to some degree)

* import from extensions
2025-01-21 13:14:02 -08:00
Elijah Ahianyo
abaaa22adb
Allow deploy with project name and app id (#4550)
* `reflex deploy --project-name`

* add app id as well

* config file update

* Update reflex/reflex.py

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

* Update reflex/reflex.py

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

---------

Co-authored-by: simon <simon@reflex.dev>
Co-authored-by: Masen Furer <m_github@0x26.net>
2025-01-21 13:06:12 -08:00
Khaleel Al-Adhami
0c70146013
check frontend version on connect (#4611)
* check frontend version on connect

* do something a bit silly

* thanks masen

* just delete the tests you don't pass
2025-01-21 13:05:35 -08:00
Masen Furer
212b2d4af9
Skip saving page components when skipping compile output (#4653)
Obviously we still have to evaluate the pages to make sure we know about all
states, but not saving them to `App.pages` dict reduces high-line memory usage
for backend-only process from ~900Mb to ~530Mb on reflex-web.
2025-01-21 13:05:04 -08:00
Khaleel Al-Adhami
4dc106545b
add defensive checks against data being funny (#4633) 2025-01-20 14:00:08 -08:00
Thomas Brandého
2855ed4887
add some of the TRY rules (#4651) 2025-01-20 13:58:17 -08:00
Thomas Brandého
9c019a65d5
check for dict passed as children for component (#4656) 2025-01-20 13:55:53 -08:00
Elijah Ahianyo
268effe62e
[ENG-4134]Allow specifying custom app module in rxconfig (#4556)
* Allow custom app module in rxconfig

* what was that pyscopg mess?

* fix another mess

* get this working with relative imports and hot reload

* typing to named tuple

* minor refactor

* revert redis knobs positions

* fix pyright except 1

* fix pyright hopefully

* use the resolved module path

* testing workflow

* move nba-proxy job to counter job

* just cast the type

* fix tests for python 3.9

* darglint

* CR Suggestions for #4556 (#4644)

* reload_dirs: search up from app_module for last directory containing __init__

* Change custom app_module to use an import string

* preserve sys.path entries added while loading rxconfig.py

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2025-01-20 10:12:54 -08:00
Thomas Brandého
4da32a122b
allow dynamic icons name (#4636)
* allow dynamic icons name

* handle literal vars

* clean up code
2025-01-17 16:43:11 -08:00
Thomas Brandého
6e546526b4
computed var default to cache=True (#4194)
* computed var default to cache=True

* fix lifespan integration tests

* fix redis test
2025-01-16 21:49:54 +01:00
Khaleel Al-Adhami
c8de356d98
cast return_expr to Var all the time (#4649) 2025-01-16 20:22:56 +01:00
Thomas Brandého
e8dd0ae47d
don't need node when --backend_only is used (#4641) 2025-01-15 15:57:50 -08:00
Khaleel Al-Adhami
cb24492371
fix boolean to boolen comparisons (#4620)
* fix boolean to boolen comparisons

* fixes #4618

* fix tests
2025-01-15 14:23:45 -08:00
Khaleel Al-Adhami
b50b7692b2
improve type support for .get_state (#4623)
* improve type support for .get_state

* dang it darglint
2025-01-15 14:21:33 -08:00
Thomas Brandého
9fe8e6f1ce
bump nextJS to v15 (#4630)
* bump nextJS to v15

* make turbopack depends on env var
2025-01-15 14:20:04 -08:00
Masen Furer
fbf9524a6c
Show file and line number in deprecation warnings (#4631)
* Show file and line number in deprecation warnings

* Exclude modules/packages by import

Less bespoke method of considering some packages to be part of the framework
and passed over when finding user code.
2025-01-15 14:19:11 -08:00
Khaleel Al-Adhami
caf29c3680
put import at the top of dynamic component evaluation (#4632) 2025-01-15 14:17:58 -08:00
Masen Furer
e8a7112249
[ENG-4383] Handle special float values on frontend (#4638)
Add a test case to `test_computed_vars.py` which renders a list of special floats.

Fix #4637
2025-01-15 13:04:15 -08:00
Thomas Brandého
f69be58f59
small fix for color_mode_button (#4634) 2025-01-14 15:02:54 +01:00
Masen Furer
1e7a37bcf9
[ENG-4351] Add mapping for lucide icons (#4622)
* [ENG-4351] Add mapping for lucide icons

For icon names that don't auto-translate to the correct lucide tag name,
provide manual override.

Fix #4621

* account for new mapping in unit tests
2025-01-10 15:23:16 -08:00
Masen Furer
427d7c56ab
Revert "[ENG-4005] Proxy backend requests on '/' to the frontend (#3300)" (#4614)
This reverts commit 438b31f270.
2025-01-09 16:30:49 -08:00
Masen Furer
fe9c02062d
EventChain.create accepts arbitrary kwargs (#4609)
Pass _var_data when creating LiteralVar

Partial fixes for #4608
2025-01-09 16:14:38 -08:00
Khaleel Al-Adhami
79611abdab
make that one line better (#4610) 2025-01-08 17:16:38 -08:00
Masen Furer
4c97072a3c
pyproject.toml: bump to 0.7.0dev1 for further development (#4604) 2025-01-08 09:37:33 -08:00
Masen Furer
5d877d54d0
Use older python versions for macos actions (#4601)
Use python versions that have a darwin/arm64 build for use with the newer
(faster) macos actions runners
2025-01-07 15:46:26 -08:00
Khaleel Al-Adhami
0ad0a84ee1
fix recursive UI (#4599)
* fix recursive UI

* get it right pyright

* dang it darglint
2025-01-07 15:11:38 -08:00
Khaleel Al-Adhami
880975ae94
improve client state (#4597)
* improve client state

* no comma

* update python for unit tests

* overwrite it for windows

* bump other python versions
2025-01-07 14:41:03 -08:00
Masen Furer
93245ef143
[ENG-4255] Code blocks lead to redefined const in web page (#4598)
Instead of potentially defining `_LANGUAGE` constant twice in a component,
simply pass the language prop directly to the hook generator function.

If no language is passed, then it defaults to `_LANGUAGE`, which continues to
work for markdown component_map use case.
2025-01-07 13:20:25 -08:00
Masen Furer
5f169bc884
test_lifespan: stop periodic events (#4600)
avoid lingering events after getting the information we came for
2025-01-07 13:20:10 -08:00
Masen Furer
08d9fbf9bc
unbreak link _hover (#4537)
* unbreak link _hover

* add a test to catch the error

* change tmp path for harness

* add () to fixture

* add spacer to avoid initial hover

* only install chromium browser for faster ci

---------

Co-authored-by: Lendemor <thomas.brandeho@gmail.com>
2025-01-07 10:35:36 -08:00
Masen Furer
72d7616726
Enable automatic retry on redis errors (#4595)
* Enable automatic retry on redis errors

ExponentialBackoff 3x retry for BusyLoadingError, ConnectionError, and TimeoutError

* retry on any redis error

* Use default single-retry for any RedisError

Using the default Retry means that async and sync clients get the appropriate type of Retry
2025-01-07 10:24:43 -08:00
Masen Furer
eae15e3a83
poetry 2.0.0 compatibility (#4593)
Remove `packages` key, since this project uses the "default" package layout, so
this key isn't needed.
2025-01-06 14:35:45 -08:00
Thomas Brandého
9fafb6d526
use position in vardata to mark internal hooks (#4549)
* use position in vardata to mark internal hooks

* update all render to use position

* use macros for rendering

* reduce number of iterations over hooks during rendering

* cleanup code and add typing

* add __future__

* use new macros to render component maps in markdown

* remove calls to _get_all_hooks_internal

* fix typo

* forgot to replace this

* unnecessary expand in utils.py
2025-01-06 13:06:56 -08:00
Masen Furer
59b3aaca42
Add deprecation message for non-cached var (#4591)
DeprecationWarning: Default non-cached rx.var has been deprecated in version
0.6.8 the default value will be `@rx.var(cache=True)` in a future release. To
retain uncached var, explicitly pass `@rx.var(cache=False)`. It will be
completely removed in 0.7.0
2025-01-06 11:17:03 -08:00
Kanva Bhatia
ab4e05be34
fixes #4578 - correct the way dim_props created (#4587) 2025-01-05 14:53:39 -08:00
Masen Furer
dcdcbfd833
[ENG-2157] [Refix] Allow rx.download to resolve rx.get_upload_url (#4470)
* [ENG-2157] [Refix] Allow `rx.download` to resolve `rx.get_upload_url`

Update the special case in a way that works with the new Var system and its
unstoppable determination to concatenate strings instead of using template
string

This has been broken since 0.6.0, so a regression test was added to avoid
future inadvertant breakage.

Fix #2812 (again)

* use safer indirect eval
2025-01-03 16:56:29 -08:00
Masen Furer
438b31f270
[ENG-4005] Proxy backend requests on '/' to the frontend (#3300)
* Proxy backend requests on '/' to the frontend

If the optional extra `proxy` is installed, then the backend can handle all
requests by proxy unrecognized routes to the frontend nextjs server.

* Update lock file

* pre-commit fu

* AppHarness: set config frontend_port and backend_port

* integration: frontend port and backend port should return the same content

with proxying enabled by default in dev mode, both frontend and backend ports
on / should return the same content.

* Retry up to 100 times when proxying to frontend

* Reduce retry attempts to 25

Fix log level passing to subprocess

* scripts/wait_for_listening_port: primarily check HTTP responses

if the port is up or not, we don't really care... the HTTP request needs to
work and not return errors

* aiohttp is an optional dep

* adapt integration.sh for --backend-only (counter integration test)

* woops

* windows WTF?

* scratching my head 🎄

* double WTF windows

* Fix remaining integration tests
2025-01-03 15:50:38 -08:00
Masen Furer
316a0c9bde
Do not allow call_function callback argument to be added afterwards (#4552)
The default behavior for EventSpec is to treat the spec as a partial, wherein
if additional unfilled arguments are available, and the event trigger wants to
pass additional arguments, they will be applied positionally.

However, it never makes sense to fill in `callback` with an event trigger arg.
Therefore, if the callback is not provided initially, set it to None explicitly
so that some invalid value cannot be added later.
2025-01-03 15:50:01 -08:00
Masen Furer
8477a1aba0
BaseState.get_var_value helper to get a value from a Var (#4553)
* BaseState.get_var_value helper to get a value from a Var

When given a state Var or a LiteralVar, retrieve the actual value associated
with the Var.

For state Vars, the returned value is directly tied to the associated state and
can be modified.

Modifying LiteralVar values or ComputedVar values will have no useful effect.

* Use Var[VAR_TYPE] annotation to take advantage of generics

This requires rx.Field to pass typing where used.

* Add case where get_var_value gets something that's not a var
2025-01-03 15:49:46 -08:00
Masen Furer
41cb2d8cff
[ENG-4083] Track internal changes in dataclass instances (#4558)
* [ENG-4083] Track internal changes in dataclass instances

Create a dynamic subclass of MutableProxy with `__dataclass_fields__` set
according to the dataclass being wrapped.

* support dataclasses.asdict on MutableProxy instances
2025-01-03 15:49:28 -08:00
Simon Young
4b89b8260b
HOS-400: adding support for config (#4540)
* HOS-400: adding support for config

* ruff

---------

Co-authored-by: simon <simon@reflex.dev>
2025-01-03 15:15:13 -08:00
benedikt-bartscher
879dcbd1bf
improve dynamic route vars, no need to compute deps (#4551) 2025-01-03 13:00:48 -08:00
celsius narhwal
0d9b2c75e4
Upgrade lucide-react to version 0.469.0 (#4571) 2025-01-03 12:59:05 -08:00
JonZeolla
72a60f074b
chore: update sonner (toast) (#4572) 2025-01-03 12:55:51 -08:00
Thomas Brandého
53f09756b6
autodetect print/breakpoints (#4581)
* catch stray breakpoints and prints

* autodetect debug prints and breakpoints in main code

* readd hacky print in pyi_generator?
2025-01-03 12:51:02 -08:00