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

Alternative value subscription implementation #310

Merged
merged 13 commits into from
Mar 28, 2022
Merged

Conversation

wcandillon
Copy link
Contributor

@wcandillon wcandillon commented Mar 24, 2022

This is an alternative implementation of #264

fixes #230
fixes #261

@wcandillon wcandillon requested a review from chrfalch March 24, 2022 22:09
@wcandillon wcandillon self-assigned this Mar 24, 2022
Copy link
Contributor

@chrfalch chrfalch left a comment

Choose a reason for hiding this comment

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

I think this looks very promising, like the idea of implementing the value registration in a separate class again - since it removes this from the container which becomes much cleaner.

I only have a question about unsubscribing before adding values when setting properties - wouldn't we need to unsubscribe first? (see comment in code).

}

abstract draw(ctx: DrawingContext): void | DeclarationResult;

set props(props: AnimatedProps<P>) {
this.depMgr.addValues(props);
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we need to unsubscribe first before subscribing? If we get property updates?

@wcandillon wcandillon mentioned this pull request Mar 25, 2022
3 tasks
@wcandillon
Copy link
Contributor Author

@chrfalch Thanks for the review, I implemented the comments, it is now identical to the previous implementation but much simpler.

@wcandillon wcandillon requested a review from chrfalch March 25, 2022 14:52
chrfalch and others added 6 commits March 27, 2022 19:34
Now the SkiaDrawView on iOS will listen to the RCTBridgeWillInvalidateModulesNotification event on the notification center to tear down and unregister views on hot reload instead of after views are removed.
…l children in the removeNode method.

The removeNode method is only called from the reconciler on the topmost node that is removed, and the documentation says that if we want to release any resources used by children of the removed node we need to do so ourselves - so this has been added.
@wcandillon wcandillon merged commit 81a84fb into main Mar 28, 2022
@chrfalch chrfalch deleted the fix/value-subscription2 branch March 28, 2022 08:12
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.

useDerivedValue and hot reload issue Improve animation value subscription
2 participants