Repository navigation
Promote client state to rx.client_state with a scoped store #6936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
masenf
wants to merge
59
commits into
main
Choose a base branch
from
claude/clientstatevar-context-refactor-jv3pig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6,186
−692
Draft
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
e6fe6fa
feat(client_state): promote to rx.client_state on a React context
claude 6225012
fix(client_state): valid codegen with no default, and two runtime fixes
claude b745638
fix(client_state): address review nits on retrieve, provider teardown…
claude 047710e
test(js): add vitest unit tests for the shipped frontend javascript
claude b7dc16d
refactor(client_state): pass the registry in, and fix hash and docstring
claude 7d80c8f
feat(client_state): scope client state by name down the component tree
claude c94d4b9
docs(client_state): document naming and tree scoping
claude 73add07
feat(foreach): scope loop vars per item, fixing #3210
claude fca7ce7
fix(client_state): carry a Var default's hooks and imports
claude 57b017b
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 362efa4
refactor(client_state): give the registry key one definition per lang…
claude 70b34c5
perf(memo): stop analyzing one memo's params twice
claude 8a4fb6e
test(client_state): pin down what frees a client state slot
claude f01da50
test(foreach): pin what a list change does to a row's values and state
claude 5abe947
docs(foreach): spell out the stale-seed caveat under positional keys
claude 2f538da
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 5efdd80
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 1000b0f
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 4099719
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude b9d7a5e
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude c2d3b78
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 657e5fe
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude c3cf471
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 5c82e45
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude acfa5af
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 1ba7886
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 46b3ca8
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude e03ef30
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude c59c7bf
Merge remote-tracking branch 'origin/main' into codex/pr-6936
masenf ead24d8
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 703b28a
fix: declare the addEvents alias where the callback is eval'd
claude 97cf561
Merge remote-tracking branch 'origin/main' into codex/pr-6936
masenf 1bf14fe
Bind serialized client-state callbacks to the current event dispatcher
masenf d6ca3df
fix: also alias addEvents in applyEvent's own eval scope
claude f6251ee
Merge concurrent client-state callback dispatch fix
masenf 7be165c
Merge remote-tracking branch 'origin/claude/clientstatevar-context-re…
masenf 089e5d6
test: assert every user-code eval scope declares the addEvents alias
claude a3d63de
Merge remote-tracking branch 'origin/main' into codex/pr-6936
masenf 42300f4
Merge remote-tracking branch 'origin/main' into codex/pr-6936
masenf 1f515a7
Merge origin/main into claude/clientstatevar-context-refactor-jv3pig
claude b048af5
fix(components-internal): floor reflex at 0.9.13.dev0 for rx.client_s…
claude f3a5fd2
fix(experimental): keep the legacy ClientStateVar shim a plain subclass
claude c669965
Merge origin/main into claude/clientstatevar-context-refactor-jv3pig
claude 5ce5534
test(client_state): assert the state hook by its declaration, not its…
claude ae3593d
Keep unnamed legacy rx._x.client_state vars global
claude d641b2d
Render every foreach item through its own component
claude 31ff217
Drop the explicit memo body walk; document the loop-in-memo case
claude d297f06
Hash a forced snapshot memo body by its whole subtree
claude ce75353
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 3b94f00
Raise sibling floors past the 0.10.1 release; refresh memo.pyi hash
claude 268cd02
Tighten comments and news fragments
claude ea7de06
Move the foreach loop-var scoping to a follow-up
claude a715564
Separate generated client state names from their prefix with $
claude dd94b01
Merge remote-tracking branch 'origin/main' into claude/clientstatevar…
claude 6cd51ff
Refresh the memo.pyi hash for the merged lock
claude b5681fb
Declare trigger arguments a setter value reads from placeholders
claude 0662361
Find trigger args through nested lambdas; derive position from the si…
claude f6beab9
Reach the client state store without a mounted provider
claude 15ff5f7
Decide the owner of a local client state var at compile time
FarhanAliRaza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add `rx.client_state` for client-only state. A named var (`rx.client_state("", name="query")`) is global: any component can read and write it, and the backend can `push` and `retrieve` it. An unnamed var is owned by the outermost page or `@rx.memo` that uses it, so each `@rx.memo` instance gets its own value and a page's values reset when it unmounts. Setting a var re-renders only the components that read it. `.set` takes a value, a `FunctionVar`, or a lambda (`count.set(lambda v: v + 1)`) and replaces `.set_value`. `rx._x.client_state` remains available with a deprecation warning. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add `rx.client_state` for client-only state. A named var (`rx.client_state("", name="query")`) is global: any component can read and write it, and the backend can `push` and `retrieve` it. An unnamed var is owned by the outermost page or `@rx.memo` that uses it, so each `@rx.memo` instance gets its own value and a page's values reset when it unmounts. Setting a var re-renders only the components that read it. `.set` takes a value, a `FunctionVar`, or a lambda (`count.set(lambda v: v + 1)`) and replaces `.set_value`. `rx._x.client_state` remains available with a deprecation warning. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refsis a module export of$/utils/state, not a global. In the devtools console,refs["__client_state"]fails withReferenceError: refs is not defined. Please remove the console claim, or give a path that works in the console.