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

Refresh live compose scan by observing RecomposerInfo instead of only the top-most recompose scope. #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zach-klippenstein
Copy link
Collaborator

@zach-klippenstein zach-klippenstein commented Mar 2, 2021

This makes use of the new Flow-based APIs for observing Recomposer state.

@pyricau
Copy link
Contributor

pyricau commented Mar 2, 2021

Is there a "I have no idea what YOU're doing" dog meme?

viewFilter = skipComposeTestTagsFilter(LIVE_HIERARCHY_TEST_TAG)
)
LaunchedEffect(Unit) {
runLiveScanning { liveHierarchy.value = it }
Copy link
Contributor

Choose a reason for hiding this comment

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

cool so this effectively says "rescan every time we've recomposed". btw does that not retrigger a composition / any risk of infinite loop?

Copy link
Collaborator Author

@zach-klippenstein zach-klippenstein Mar 2, 2021

Choose a reason for hiding this comment

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

Correct. It does not trigger infinite composition loop, although I'm not super clear on why not. I can look into it and document, because it does seem like that should happen.

  • Figure out why no infinite loop

Copy link
Collaborator Author

@zach-klippenstein zach-klippenstein Mar 3, 2021

Choose a reason for hiding this comment

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

Ok I get why there's no infinite loop now. Because we exclude the scan result composable from the scan, a scan in which only the scan output changes will result in the scan string being set to the same value, which won't invalidate any recompose scopes.

I'll add a comment about this and punch up the docs on the Recomposers stuff.

@zach-klippenstein
Copy link
Collaborator Author

Is there a "I have no idea what YOU're doing" dog meme?

image

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.

3 participants