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

refact: merge Fabric & Paper impls: ScreenStackHeaderConfig (3) #1417

Merged
merged 137 commits into from
Apr 28, 2022

Conversation

kkafar and others added 30 commits April 8, 2022 11:38
It caused RN_FABRIC_ENABLED flag to be invalid (as it merged with
    previous flag from the list...)
Otherwise C++ standard headers are not visible from .m files -> project
fails to build.

e.g. Whem=n A.m includes B.h & B.h imports memory header: "#include
<memory>" -- memory header is not visible & compilation fails
1. move the prop to implemented section in JS
2. move the prop to "common" section in RNSScreenView interface
most likely some kind of merging artifact
most likely some kind of merge artifact
temporary solution until customAnimationOnSwipe is not added to
RNSScreenView on Fabric
these directives should be removed once implementations ale fully merged
to Paper specific section

This method is not present in RNSScreenStackComponentView, therefore I
conclude it is not necessary at least for now
Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

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

I added some initial comments.

ios/RNSScreen.mm Outdated Show resolved Hide resolved
RNSScreenStackHeaderConfigComponentView *config =
(RNSScreenStackHeaderConfigComponentView *)((RNSScreenView *)view).config;
[RNSScreenStackHeaderConfigComponentView willShowViewController:viewController animated:animated withConfig:config];
RNSScreenStackHeaderConfig *config = (RNSScreenStackHeaderConfig *)((RNSScreenView *)view).config;
Copy link
Member

Choose a reason for hiding this comment

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

Could you debug why this code is added and the previous implementation is not used instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not understand this completely, but paper implementation of RNSScreenView does not expose config property. In Fabric implementation this prop is updated when child component view is being mounted (mountChildComponentView method) or unmounted (unmountChildComponentView method)

Copy link
Member

Choose a reason for hiding this comment

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

Hmm but we could you old implementation on Fabric too, it is possible to traverse react children of the view there too I think. The question is was it breaking something?

ios/RNSScreenStackHeaderConfig.h Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Outdated Show resolved Hide resolved
for (RNSScreenStackHeaderSubviewComponentView *subview in config.reactSubviews) {
switch (subview.type) {
case facebook::react::RNSScreenStackHeaderSubviewType::Left: {
//#if !TARGET_OS_TV
Copy link
Member

Choose a reason for hiding this comment

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

Why is it commented?

Copy link
Member Author

@kkafar kkafar Apr 27, 2022

Choose a reason for hiding this comment

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

@property (nonatomic) BOOL backButtonInCustomView; is not implemented yet on Fabric.

I do not resolve this conversation as it requires to be added in following PR

ios/RNSScreenStackHeaderConfig.mm Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Outdated Show resolved Hide resolved
Base automatically changed from @kkafar/merge-fabric-to-paper-screen-stack to main April 27, 2022 10:37
@kkafar kkafar marked this pull request as ready for review April 27, 2022 10:38
@kkafar kkafar requested a review from WoLewicki April 28, 2022 06:21
Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

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

Good job! I added some comments

RNSScreenStackHeaderConfigComponentView *config =
(RNSScreenStackHeaderConfigComponentView *)((RNSScreenView *)view).config;
[RNSScreenStackHeaderConfigComponentView willShowViewController:viewController animated:animated withConfig:config];
RNSScreenStackHeaderConfig *config = (RNSScreenStackHeaderConfig *)((RNSScreenView *)view).config;
Copy link
Member

Choose a reason for hiding this comment

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

Hmm but we could you old implementation on Fabric too, it is possible to traverse react children of the view there too I think. The question is was it breaking something?

ios/RNSScreenStack.mm Outdated Show resolved Hide resolved
ios/RNSScreenStack.mm Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.h Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.h Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.mm Outdated Show resolved Hide resolved
@kkafar kkafar merged commit ac92e93 into main Apr 28, 2022
@kkafar kkafar deleted the @kkafar/merge-fabric-to-paper-screen-stack-header-config branch April 28, 2022 10:28
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