Skip to content

Conversation

@zakstucke
Copy link
Collaborator

@zakstucke zakstucke commented Aug 29, 2025

  • Changes the behaviour of ScopedFuture::new_untracked to not emit diagnostics, in line with subscriber::untrack
  • Adds new ScopedFuture::new_untracked_with_diagnostics, to match subscriber::untrack_with_diagnostics
  • Replaces the call in ArcAsyncDerived::new_with_manual_dependencies to use ScopedFuture::new_untracked_with_diagnostics, as this one we want diagnostics.
  • The other usage of ScopedFuture::new_untracked is in Action usage, which is left unchanged, thereby disabling diagnostics, which are not needed in this context.
  • Adds untrack to the sync part of Action s to disable diagnostics there too

In case there's some confusion about why this is useful:

Having these diagnostics in action calls does not provide any value, a user is acutely aware that an action is something manually "dispatched". By disabling the warning, thereby it no longer being an error to use e.g. .get() inside an action, logic and getters that might contain signals and also be used in the view!{}/Effects, can be extracted into reusable functions, and not produce confusing warnings when used from actions.

@zakstucke zakstucke force-pushed the zak/reactive-warnings branch 2 times, most recently from 7bcf19b to 74be66c Compare August 29, 2025 14:17
@zakstucke zakstucke force-pushed the zak/reactive-warnings branch from 74be66c to ecc6fc7 Compare August 29, 2025 14:37
Copy link
Collaborator

@gbj gbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great! The explanation all makes sense to me. Couple small notes on debug-cfg'ing, otherwise I'm happy.

@zakstucke
Copy link
Collaborator Author

zakstucke commented Aug 31, 2025

I've had to restructure to avoid breaking semver, so we should merge this PR now, and #4274 for 0.9.

Edit: hmm actually looking at the diff again, this might still theoretically break semver in the CI check, because the future type is different, but imo in practice it will not break any user code so will be fine. should be fine now

@gbj
Copy link
Collaborator

gbj commented Aug 31, 2025

Ah! Yeah, fair enough. I'm fine with the new version. Thanks, Zak.

@gbj gbj merged commit f3a053f into leptos-rs:main Aug 31, 2025
283 checks passed
maccesch pushed a commit to maccesch/leptos that referenced this pull request Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants