-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fabric: working podspecs & works in RNTester #23803
Conversation
This comment has been minimized.
This comment has been minimized.
Wow! Clearly a lot of work went into this. This is awesome, thanks for doing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
eslint
found some issues. Runyarn lint --fix
to automatically fix problems.flow
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
The The podspecs are complete, I am not sure if it is optimal to have a Folly Fabric podspec, but it is easiest without breaking existing users. We can converge once fabric is "done". I think it is fairly safe to import everything except for the changes to RNTester- as they are hacks. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hard work! I put some comments, but at high level:
- RNTester Fabric mode needs to be configurable
- Let's find out how to not depend on libevent
- You probably should split this PR into a few parts: React.xcodeproj changes, pod file changes, then RNTester changes
@@ -127,6 +127,7 @@ | |||
"eslint-plugin-react-native": "3.5.0", | |||
"eslint-plugin-relay": "0.0.28", | |||
"flow-bin": "^0.94.0", | |||
"flow-remove-types": "^1.2.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this for? is it to run the codegen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for codegen.
RNTester/RNTester/AppDelegate.m
Outdated
} | ||
@end | ||
|
||
// FIXME: this is a hack, remove when surfaces start correctly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you open an issue then link that issue here? We'll look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will do that shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's put this link in the FIXME comment: https://github.com/facebook/react-native/issues/23910
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
shellcheck
found some issues.
One other note: I think in general we want to make Fabric (including compiling it) optional at the moment, because if you include it the core React.xcodeproj or React podspec, then every app has to pay the extra cost of having fabric even if they don't use it (they shouldn't use it for now). This means extra app size or latent bugs for them. So let's split it in this PR. Given that, I think the ideal place I'd like to go to is:
Now, re: .xcodeproj vs podspec, I'd rather just maintain 1 thing going forward. So if the general community is moving towards CocoaPods, we can just drop support for the fabric in .xcodeproj setup. Long-long term, I recognize it's tedious to manually "sync" these configurations across BUCK/podspec/gradle, so we can have a separate discussion about either utilizing |
@@ -17,7 +17,9 @@ | |||
3D13F84A1D6F6AFD00E69E0E /* OtherImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated: I thought we're not supposed to check in .xcodeproj/.xcworkspace file when using cocoapods? should probably remove this in different PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally you check in the xcodeproj
but not the xcworkspace
when working with pods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok sounds good
Fabric requires a lot more stuff than react, lets just setup a diff podspec if you want to work with fabric.
This reverts commit b626ede.
this greatly simplifies the work required to enable fabric and keeps existing podspecs sparkling clean.
And some small formatting
2f9977e
to
31c110c
Compare
Great work! (sorry for the noise, just wanted to thank you :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fkgozali has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @ericlewis in 97e6ea1. When will my fix make it into a release? | Upcoming Releases |
Summary
This is the couple of hacks I used after I finished #23802 in order to get fabric working on RNTester. This is inspired from prior work by @kmagiera.
The goal of this PR is to show others what I’m struggling with, and to eventually merge it sans hacks.
Directions to use
Notes
SurfaceHostingView
&SurfaceHostingProxyRootView
both try to start the surface immediately, this leads to a race condition due to the javascript not having loaded yet, the hack here is:start
method onRCTFabricSurface
to no-op when called.RCTJavaScriptDidLoadNotification
_startAllSurfaces
on_surfacePresenter
in AppDelegate when we receiveRCTJavaScriptDidLoadNotification
.Changelog
[General] [Added] - Use Fabric in RNTester
Test Plan
Pod install, and run RNTester.