Move nativeId parsing into the Props ctor initializer list#57339
Closed
javache wants to merge 1 commit into
Closed
Move nativeId parsing into the Props ctor initializer list#57339javache wants to merge 1 commit into
nativeId parsing into the Props ctor initializer list#57339javache wants to merge 1 commit into
Conversation
Summary: Every Props subclass parses its fields in its 3-arg ctor's initializer list, but `Props` was the odd one out — its 3-arg ctor had an empty initializer list and a body that called a separate `Props::initialize` method, which then assigned `nativeId` and (on Android) ran `initializeDynamicProps`. Fold the `nativeId` parse back into the initializer list and inline the Android `initializeDynamicProps` call into the ctor body, matching the subclass pattern. This removes the only remaining external caller of `Props::initialize`: `YogaStylableProps`'s ctor was constructing its `Props` subobject via `Props()` and then calling `initialize(...)` from its body. Replace with the standard `Props(ctx, sourceProps, rawProps, filterObjectKeys)` initializer-list chain. With both call sites gone, delete `Props::initialize` outright. Behaviour is unchanged: the work that `initialize` did still runs on the same construction path, just via the ctor itself. Changelog: [Internal] Differential Revision: D109691981
|
@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109691981. |
|
This pull request has been merged in 9052f0b. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Every Props subclass parses its fields in its 3-arg ctor's initializer list, but
Propswas the odd one out — its 3-arg ctor had an empty initializer list and a body that called a separateProps::initializemethod, which then assignednativeIdand (on Android) raninitializeDynamicProps.Fold the
nativeIdparse back into the initializer list and inline the AndroidinitializeDynamicPropscall into the ctor body, matching the subclass pattern.This removes the only remaining external caller of
Props::initialize:YogaStylableProps's ctor was constructing itsPropssubobject viaProps()and then callinginitialize(...)from its body. Replace with the standardProps(ctx, sourceProps, rawProps, filterObjectKeys)initializer-list chain. With both call sites gone, deleteProps::initializeoutright.Behaviour is unchanged: the work that
initializedid still runs on the same construction path, just via the ctor itself.Changelog:
[Internal]
Differential Revision: D109691981