Skip to content
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

Fix rsx evaluation order #3944

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Apr 2, 2025

We expand dynamic expressions, component, and attributes in different sections of the rsx macro. This can lead to very confusing borrow checker errors where rust complains that a item is borrowed before it is moved which should be valid, but because we shuffle expressions the item ends up being borrowed after it is moved.

This PR fixes that issue by introducing a dynamic expression pool and expanding items in depth first order in that pool before using the bindings in our dynamic node and dynamic attribute pools

Closes #3737

@ealmloff ealmloff added bug Something isn't working breaking This is a breaking change rsx Related to rsx or the dioxus-rsx crate labels Apr 2, 2025
@ealmloff ealmloff marked this pull request as ready for review April 2, 2025 14:04
@ealmloff ealmloff requested a review from a team as a code owner April 2, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change bug Something isn't working rsx Related to rsx or the dioxus-rsx crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RSX macro changes expression evaluation order
1 participant