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

Use ReactNative to the ios native project,and the compilation was several times slower #21032

Closed
luangaolei opened this issue Sep 10, 2018 · 4 comments
Labels
Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@luangaolei
Copy link

luangaolei commented Sep 10, 2018

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.4
CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 240.03 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.8.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.2.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
IDEs:
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: 16.3.1 => 16.3.1
react-native: ^0.56.0 => 0.56.0

Description

Hi,why did I add ReactNative to the native ios project? Every time when I first compiled the project, it was very slow. It was much slower than the native project.How should this problem be solved?
I tried using the latest version ReactNative v0.56.0 just now, but it still took me a long time to build the project for the first time, so the latest version doesn't solve that problem.
I find that comment out RCTWebSocket and RCTAnimation , and then pod install will not have that particularly slow compilation problem.

pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTLinkingIOS',
    'RCTPushNotification',
    'RCTImage',
    'RCTNetwork',
    #'RCTWebSocket', # Needed for debugging
    #'RCTAnimation', # Needed for FlatList and animations running on native UI thread
  ]

#21004

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Sep 10, 2018
@mwskwong
Copy link

mwskwong commented Sep 10, 2018

In short, you cannot solve it. What it does is compiling a bunch of extra objective-c, swift code from react native components into native code, so it is expected to be longer than native iOS.

However, once it is compiled and run, you can always use the "reload" feature which allows you to apply changes much faster.

To do that, press cmd + R in simulator, or shake the real device and select "reload" from the menu

@luangaolei
Copy link
Author

@matthewkwong2 Thank you. But I'm talking about the long build time after the clean project. Or I want to archive, which is very long...

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Sep 27, 2018
@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 27, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants