Permalink
Browse files

Fork UIExplorer.xcodeproj into UIExplorerCxx.xcodeproj

Reviewed By: javache

Differential Revision: D4434102

fbshipit-source-id: 45e128e7d985b58c04dda14f8e692051a552a491
  • Loading branch information...
mhorowitz authored and facebook-github-bot committed Feb 1, 2017
1 parent aeab15d commit 81b2d695754ec209a9b61f8971068673445e61a8
@@ -56,13 +56,8 @@ - (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWith
- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge
{
- NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"Examples/UIExplorer/js/UIExplorerApp.ios"
- fallbackResource:nil];
- if (!getenv("CI_USE_PACKAGER")) {
- jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
- }
-
- return jsCodeLocation;
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"Examples/UIExplorer/js/UIExplorerApp.ios"
+ fallbackResource:nil];
}
@@ -13,6 +13,7 @@
*/
#import <UIKit/UIKit.h>
+
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@@ -0,0 +1,28 @@
+// Copyright 2004-present Facebook. All Rights Reserved.
+
+/**
+ * The examples provided by Facebook are for non-commercial testing and
+ * evaluation purposes only.
+ *
+ * Facebook reserves all rights not expressly granted.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
+ * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#import <UIKit/UIKit.h>
+
+#import <React/RCTCxxBridge.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ [RCTCxxBridge enable];
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
Oops, something went wrong.

7 comments on commit 81b2d69

@janicduplessis

This comment has been minimized.

Show comment
Hide comment
@janicduplessis

janicduplessis Mar 1, 2017

Collaborator

@mhorowitz I was trying to get the cxx bridge working in my app and was hitting compile issues about missing headers. Then I tried running UIExplorer with UIExplorerCxx.xcodeproj and hit similar compile errors. Could you verify if it works for you? I'm not sure why the error happens but it seems like the react code doesn't get compiled / headers copied before it tries to build other projects like RCTActionSheet.

Collaborator

janicduplessis replied Mar 1, 2017

@mhorowitz I was trying to get the cxx bridge working in my app and was hitting compile issues about missing headers. Then I tried running UIExplorer with UIExplorerCxx.xcodeproj and hit similar compile errors. Could you verify if it works for you? I'm not sure why the error happens but it seems like the react code doesn't get compiled / headers copied before it tries to build other projects like RCTActionSheet.

@mhorowitz

This comment has been minimized.

Show comment
Hide comment
@mhorowitz

mhorowitz Mar 3, 2017

Contributor

@janicduplessis thanks for taking the time to try out the new bridge!

I fetched a fresh copy of RN from github and tried to build it myself. It looks like there were a few regressions in the form of some renames and new files, but nothing related to RCTActionSheet, or that looks like ordering.

I've committed a fix for the problems I was seeing (218e37d), and here's what I did to confirm everything is working:

git clone https://github.com/facebook/react-native.git
cd react-native/
./ios-install-third-party.sh
yarn install
open Examples/UIExplorer/UIExplorerCxx.xcodeproj
Make sure the UIExplorer scheme is selected, and ⌘R

If you're seeing problems which look like dependency ordering, check the Build tab of your scheme, and make sure "Parallelize Build" is unchecked.

Definitely let me know if you have any more issues or questions. I'm working now on making this a bit more seamless to drop in so people can test with it more easily.

Contributor

mhorowitz replied Mar 3, 2017

@janicduplessis thanks for taking the time to try out the new bridge!

I fetched a fresh copy of RN from github and tried to build it myself. It looks like there were a few regressions in the form of some renames and new files, but nothing related to RCTActionSheet, or that looks like ordering.

I've committed a fix for the problems I was seeing (218e37d), and here's what I did to confirm everything is working:

git clone https://github.com/facebook/react-native.git
cd react-native/
./ios-install-third-party.sh
yarn install
open Examples/UIExplorer/UIExplorerCxx.xcodeproj
Make sure the UIExplorer scheme is selected, and ⌘R

If you're seeing problems which look like dependency ordering, check the Build tab of your scheme, and make sure "Parallelize Build" is unchecked.

Definitely let me know if you have any more issues or questions. I'm working now on making this a bit more seamless to drop in so people can test with it more easily.

@janicduplessis

This comment has been minimized.

Show comment
Hide comment
@janicduplessis

janicduplessis Mar 3, 2017

Collaborator

@mhorowitz Cool, I think I just realize what my issue was, I had RCTActionSheet as the selected project to build instead of UIExplorer... Xcode -_-

Going to try it in my app too now, is there anything else I have to do to convert my existing project to a cxx bridge one except to remove React.xcproj and add CxxReact.xcproj?

Collaborator

janicduplessis replied Mar 3, 2017

@mhorowitz Cool, I think I just realize what my issue was, I had RCTActionSheet as the selected project to build instead of UIExplorer... Xcode -_-

Going to try it in my app too now, is there anything else I have to do to convert my existing project to a cxx bridge one except to remove React.xcproj and add CxxReact.xcproj?

@janicduplessis

This comment has been minimized.

Show comment
Hide comment
@janicduplessis

janicduplessis Mar 3, 2017

Collaborator

Ok I figured it out, I also had to go in the build section of my scheme and remove the missing React dependency from the React project and add it back from the CxxReact project

Collaborator

janicduplessis replied Mar 3, 2017

Ok I figured it out, I also had to go in the build section of my scheme and remove the missing React dependency from the React project and add it back from the CxxReact project

@janicduplessis

This comment has been minimized.

Show comment
Hide comment
@janicduplessis

janicduplessis Mar 4, 2017

Collaborator

@mhorowitz Found an issue when trying to generate an archive. Looks like double-conversion doesn't work when building for generic ios device. You can repro in xcode by choosing 'Generic iOS Device' as the target and building.

Target architecture was not detected as supported by Double-Conversion.

Collaborator

janicduplessis replied Mar 4, 2017

@mhorowitz Found an issue when trying to generate an archive. Looks like double-conversion doesn't work when building for generic ios device. You can repro in xcode by choosing 'Generic iOS Device' as the target and building.

Target architecture was not detected as supported by Double-Conversion.

@mhorowitz

This comment has been minimized.

Show comment
Hide comment
@mhorowitz

mhorowitz Mar 7, 2017

Contributor

double-conversion-1.1.5 fixes this. I'm working on an update now.

Contributor

mhorowitz replied Mar 7, 2017

double-conversion-1.1.5 fixes this. I'm working on an update now.

@mhorowitz

This comment has been minimized.

Show comment
Hide comment
@mhorowitz

mhorowitz Mar 7, 2017

Contributor

Fix here cb3a439

Contributor

mhorowitz replied Mar 7, 2017

Fix here cb3a439

Please sign in to comment.