reflex-dev
reflex
BlogDocsChangelog

ENG-8258: API for linking and sharing states

#6024
Comparing
masenf/linked-state
(
3d40cac
) with
main
(
fad67cf
)
CodSpeed Performance Gauge
0%
Untouched
8

Benchmarks

Passed

test_compile_stateful[_stateful_page]
tests/benchmarks/test_compilation.py
CodSpeed Performance Gauge
+1%
148.3 µs147.4 µs
test_get_all_imports[_complicated_page]
tests/benchmarks/test_compilation.py
CodSpeed Performance Gauge
0%
22.6 ms22.6 ms
test_compile_page[_complicated_page]
tests/benchmarks/test_compilation.py
CodSpeed Performance Gauge
0%
88.3 ms88.2 ms
test_compile_stateful[_complicated_page]
tests/benchmarks/test_compilation.py
CodSpeed Performance Gauge
0%
585.8 µs585.2 µs
test_evaluate_page[_stateful_page]
tests/benchmarks/test_evaluate.py
CodSpeed Performance Gauge
0%
6.5 ms6.5 ms
test_get_all_imports[_stateful_page]
tests/benchmarks/test_compilation.py
CodSpeed Performance Gauge
0%
3.1 ms3.1 ms
test_compile_page[_stateful_page]
tests/benchmarks/test_compilation.py
CodSpeed Performance Gauge
0%
10.4 ms10.4 ms
test_evaluate_page[_complicated_page]
tests/benchmarks/test_evaluate.py
CodSpeed Performance Gauge
-1%
46 ms46.4 ms

Commits

Click on a commit to change the comparison range
Base
main
fad67cf
-0.02%
ENG-8258: API for linking and sharing states It works by defining a substate of SharedState and then calling self._link_to(target_token) from some event handler. from that point on, whenever that user's state is loaded, the StateManager will patch in the linked shared states. whenever a linked state is modified, we explicitly load all of the other linked tokens, patch in the modified states, and send a delta to those clients You can call ._unlink to remove the link association, which causes the substate to be subsequently loaded from the client_token's tree as a private state It is intended to work transparently with computed vars, background events, and frontend rendering.
3d40cac
2 days ago
by masenf
© 2025 CodSpeed Technology
Home Terms Privacy Docs