-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Minify state names v2 #3728
base: main
Are you sure you want to change the base?
Minify state names v2 #3728
Conversation
Actually, it's not a problem with the env vars not getting passed. Tests are failing due to |
b9c852e
to
bf6ec96
Compare
@masenf do you have any idea how to solve this? |
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.
as for the _var_set_state
, we probably could just save a reference to the state class and defer formatting of the state name until it's actually needed (_var_full_name_needs_state_prefix)
@@ -23,6 +23,8 @@ export const clientStorage = {{ client_storage|json_dumps }} | |||
export const clientStorage = {} | |||
{% endif %} | |||
|
|||
export const main_state_name = "{{const.main_state_name}}" |
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.
I think this is already coming in as state_name
.
reflex/compiler/compiler.py:90
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.
iirc this was the state name for rx.app.App.state
. will check
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.
Yes, they are not the same. compile_contexts
gets called from reflex.app.App._compile
with self.state
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.
maybe for clarity, we should call the var root_state_name
instead of main_state_name
just to indicate that it's the name of rx.State
, the root of the state "tree"
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.
What about main_state_dispatch
should we rename that one to root_state_dispatch
as well?
Thanks, i was thinking about that. Do you want me to migrate to state refs in this PR or in a followup? |
i think you can do the refs in this PR, as long as it's not too invasive. We have a big Var refactor coming in the next week or so, that might conflict, but we can fix that up |
alternative to #3701
currently the new tests are failing because somehow the env vars i was trying to set (in the fixtures) do not persist or do not get passed to frontend and backend correctly