Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Clean up of React nested optimized logic #2348

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Aug 1, 2018

Release notes: none

Follow up to #2346. This PR cleans up all the React specific nested optimized function logic, removing most of the old legacy code in favor of the simpler/cleaner approach.

This also introduces a bubbleSideEffectReports parameter to evaluatePure for specific case where we don't want side-effects to be reported to parent evaluatePure calls; necessary for the React reconciler to not throw a UnsupportedSideEffect which will cause the reconciliation process to hard-fail (instead nested optimize functions bail-out to be inline abstract function calls like before, and we do not try and optimize the nested function).

Lastly, we now throw an SideEffect object when evaluating a nested optimized function and detecting a side-effect. There's no point in continuing evaluation of a given side-effectful function, so this speeds things up a bit by terminating execution.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

trueadm is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants