Skip to content

Commit

Permalink
[ios] Build client with ENABLE_PACKAGER_CONNECTION=0 to fix websocket…
Browse files Browse the repository at this point in the history
… spam

RN has "packager connection" code that attempts to visit a (mostly) hardcoded URL with a hardcoded port and repeatedly tries to reconnect without backoff, leading to hundreds or thousands of bad requests. I looked into the packager connection code on both iOS and Android -> it receives commands from the packager such as taking a heap snapshot or reloading. Searching all of RN and Metro, these commands aren't sent and it looks like open-source doesn't actually use this feature. (Live reload uses a different mechanism.)

For the iOS client, I built it with `ENABLE_PACKAGER_CONNECTION=0` which mitigates this request spam. There are still some `nw_socket` log messages but no longer dozens per second. XDL (Podfile generation) changes are here: expo/expo-cli#78

Test plan: build the iOS client from source and verify that it doesn't spam as many `nw_socket` errors. Test live reload with NCL.
  • Loading branch information
ide committed Oct 9, 2018
1 parent 16bbf00 commit 5913221
Show file tree
Hide file tree
Showing 11 changed files with 849 additions and 22,962 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,6 @@ SPEC CHECKSUMS:
yogaABI29_0_0: 4fdf5bbd444d2968ec42ccadec97b02c672eda80
yogaABI30_0_0: 4c86e39466368a6b018b8b78aeb654b6620512a1

PODFILE CHECKSUM: e2c3b9e7c18e8ebe481f43490091329168dcfa60
PODFILE CHECKSUM: bce5fe6b1fa5db1699042fd1863caf1a5ab8981d

COCOAPODS: 1.5.3
2 changes: 1 addition & 1 deletion ios/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23,798 changes: 839 additions & 22,959 deletions ios/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion template-files/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ${PODFILE_UNVERSIONED_EXPO_MODULES_DEPENDENCIES}
${PODFILE_UNVERSIONED_RN_DEPENDENCY}
${PODFILE_VERSIONED_RN_DEPENDENCIES}

# Build React Native with RCT_DEV enabled
# Build React Native with RCT_DEV enabled and ENABLE_PACKAGER_CONNECTION disabled
post_install do |installer|
installer.pods_project.main_group.tab_width = '2';
installer.pods_project.main_group.indent_width = '2';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.build_settings['OTHER_CFLAGS'] = ['-DkNeverRequested=ReactABI24_0_0kNeverRequested','-DkNeverProgressed=ReactABI24_0_0kNeverProgressed','-DkSMCalloutViewRepositionDelayForUIScrollView=ReactABI24_0_0kSMCalloutViewRepositionDelayForUIScrollView','-DregionAsJSON=ReactABI24_0_0regionAsJSON','-DunionRect=ReactABI24_0_0unionRect','-DJSNoBytecodeFileFormatVersion=ReactABI24_0_0JSNoBytecodeFileFormatVersion','-DJSSamplingProfilerEnabled=ReactABI24_0_0JSSamplingProfilerEnabled','-DRECONNECT_DELAY_MS=ReactABI24_0_0RECONNECT_DELAY_MS','-DMAX_DELTA_TIME=ReactABI24_0_0MAX_DELTA_TIME','-DgCurrentGenerationCount=ReactABI24_0_0gCurrentGenerationCount','-DgPrintSkips=ReactABI24_0_0gPrintSkips','-DgPrintChanges=ReactABI24_0_0gPrintChanges','-DlayoutNodeInternal=ReactABI24_0_0layoutNodeInternal','-DgDepth=ReactABI24_0_0gDepth','-DgPrintTree=ReactABI24_0_0gPrintTree','-DisUndefined=ReactABI24_0_0isUndefined','-DgNodeInstanceCount=ReactABI24_0_0gNodeInstanceCount']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI24_0_0RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI24_0_0ENABLE_PACKAGER_CONNECTION=0'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.build_settings['OTHER_CFLAGS'] = ['-DkNeverRequested=ReactABI25_0_0kNeverRequested','-DkNeverProgressed=ReactABI25_0_0kNeverProgressed','-DkSMCalloutViewRepositionDelayForUIScrollView=ReactABI25_0_0kSMCalloutViewRepositionDelayForUIScrollView','-DregionAsJSON=ReactABI25_0_0regionAsJSON','-DunionRect=ReactABI25_0_0unionRect','-DJSNoBytecodeFileFormatVersion=ReactABI25_0_0JSNoBytecodeFileFormatVersion','-DJSSamplingProfilerEnabled=ReactABI25_0_0JSSamplingProfilerEnabled','-DRECONNECT_DELAY_MS=ReactABI25_0_0RECONNECT_DELAY_MS','-DMAX_DELTA_TIME=ReactABI25_0_0MAX_DELTA_TIME','-DgCurrentGenerationCount=ReactABI25_0_0gCurrentGenerationCount','-DgPrintSkips=ReactABI25_0_0gPrintSkips','-DgPrintChanges=ReactABI25_0_0gPrintChanges','-DlayoutNodeInternal=ReactABI25_0_0layoutNodeInternal','-DgDepth=ReactABI25_0_0gDepth','-DgPrintTree=ReactABI25_0_0gPrintTree','-DisUndefined=ReactABI25_0_0isUndefined','-DgNodeInstanceCount=ReactABI25_0_0gNodeInstanceCount']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI25_0_0RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI25_0_0ENABLE_PACKAGER_CONNECTION=0'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.build_settings['OTHER_CFLAGS'] = ['-DkNeverRequested=ReactABI26_0_0kNeverRequested','-DkNeverProgressed=ReactABI26_0_0kNeverProgressed','-DkSMCalloutViewRepositionDelayForUIScrollView=ReactABI26_0_0kSMCalloutViewRepositionDelayForUIScrollView','-DregionAsJSON=ReactABI26_0_0regionAsJSON','-DunionRect=ReactABI26_0_0unionRect','-DJSNoBytecodeFileFormatVersion=ReactABI26_0_0JSNoBytecodeFileFormatVersion','-DJSSamplingProfilerEnabled=ReactABI26_0_0JSSamplingProfilerEnabled','-DRECONNECT_DELAY_MS=ReactABI26_0_0RECONNECT_DELAY_MS','-DMAX_DELTA_TIME=ReactABI26_0_0MAX_DELTA_TIME','-DgCurrentGenerationCount=ReactABI26_0_0gCurrentGenerationCount','-DgPrintSkips=ReactABI26_0_0gPrintSkips','-DgPrintChanges=ReactABI26_0_0gPrintChanges','-DlayoutNodeInternal=ReactABI26_0_0layoutNodeInternal','-DgDepth=ReactABI26_0_0gDepth','-DgPrintTree=ReactABI26_0_0gPrintTree','-DisUndefined=ReactABI26_0_0isUndefined','-DgNodeInstanceCount=ReactABI26_0_0gNodeInstanceCount']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI26_0_0RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI26_0_0ENABLE_PACKAGER_CONNECTION=0'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.build_settings['OTHER_CFLAGS'] = ['-DkNeverRequested=ReactABI27_0_0kNeverRequested','-DkNeverProgressed=ReactABI27_0_0kNeverProgressed','-DkSMCalloutViewRepositionDelayForUIScrollView=ReactABI27_0_0kSMCalloutViewRepositionDelayForUIScrollView','-DregionAsJSON=ReactABI27_0_0regionAsJSON','-DunionRect=ReactABI27_0_0unionRect','-DJSNoBytecodeFileFormatVersion=ReactABI27_0_0JSNoBytecodeFileFormatVersion','-DJSSamplingProfilerEnabled=ReactABI27_0_0JSSamplingProfilerEnabled','-DRECONNECT_DELAY_MS=ReactABI27_0_0RECONNECT_DELAY_MS','-DMAX_DELTA_TIME=ReactABI27_0_0MAX_DELTA_TIME','-DgCurrentGenerationCount=ReactABI27_0_0gCurrentGenerationCount','-DgPrintSkips=ReactABI27_0_0gPrintSkips','-DgPrintChanges=ReactABI27_0_0gPrintChanges','-DlayoutNodeInternal=ReactABI27_0_0layoutNodeInternal','-DgDepth=ReactABI27_0_0gDepth','-DgPrintTree=ReactABI27_0_0gPrintTree','-DisUndefined=ReactABI27_0_0isUndefined','-DgNodeInstanceCount=ReactABI27_0_0gNodeInstanceCount']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI27_0_0RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI27_0_0ENABLE_PACKAGER_CONNECTION=0'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.build_settings['OTHER_CFLAGS'] = ['-DkNeverRequested=ReactABI28_0_0kNeverRequested','-DkNeverProgressed=ReactABI28_0_0kNeverProgressed','-DkSMCalloutViewRepositionDelayForUIScrollView=ReactABI28_0_0kSMCalloutViewRepositionDelayForUIScrollView','-DregionAsJSON=ReactABI28_0_0regionAsJSON','-DunionRect=ReactABI28_0_0unionRect','-DJSNoBytecodeFileFormatVersion=ReactABI28_0_0JSNoBytecodeFileFormatVersion','-DJSSamplingProfilerEnabled=ReactABI28_0_0JSSamplingProfilerEnabled','-DRECONNECT_DELAY_MS=ReactABI28_0_0RECONNECT_DELAY_MS','-DMAX_DELTA_TIME=ReactABI28_0_0MAX_DELTA_TIME','-DgCurrentGenerationCount=ReactABI28_0_0gCurrentGenerationCount','-DgPrintSkips=ReactABI28_0_0gPrintSkips','-DgPrintChanges=ReactABI28_0_0gPrintChanges','-DlayoutNodeInternal=ReactABI28_0_0layoutNodeInternal','-DgDepth=ReactABI28_0_0gDepth','-DgPrintTree=ReactABI28_0_0gPrintTree','-DisUndefined=ReactABI28_0_0isUndefined','-DgNodeInstanceCount=ReactABI28_0_0gNodeInstanceCount']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI28_0_0RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI28_0_0ENABLE_PACKAGER_CONNECTION=0'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.build_settings['OTHER_CFLAGS'] = ['-DkNeverRequested=ReactABI29_0_0kNeverRequested','-DkNeverProgressed=ReactABI29_0_0kNeverProgressed','-DkSMCalloutViewRepositionDelayForUIScrollView=ReactABI29_0_0kSMCalloutViewRepositionDelayForUIScrollView','-DregionAsJSON=ReactABI29_0_0regionAsJSON','-DunionRect=ReactABI29_0_0unionRect','-DJSNoBytecodeFileFormatVersion=ReactABI29_0_0JSNoBytecodeFileFormatVersion','-DJSSamplingProfilerEnabled=ReactABI29_0_0JSSamplingProfilerEnabled','-DRECONNECT_DELAY_MS=ReactABI29_0_0RECONNECT_DELAY_MS','-DMAX_DELTA_TIME=ReactABI29_0_0MAX_DELTA_TIME','-DgCurrentGenerationCount=ReactABI29_0_0gCurrentGenerationCount','-DgPrintSkips=ReactABI29_0_0gPrintSkips','-DgPrintChanges=ReactABI29_0_0gPrintChanges','-DlayoutNodeInternal=ReactABI29_0_0layoutNodeInternal','-DgDepth=ReactABI29_0_0gDepth','-DgPrintTree=ReactABI29_0_0gPrintTree','-DisUndefined=ReactABI29_0_0isUndefined','-DgNodeInstanceCount=ReactABI29_0_0gNodeInstanceCount']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI29_0_0RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI29_0_0ENABLE_PACKAGER_CONNECTION=0'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.build_settings['OTHER_CFLAGS'] = ['-DkNeverRequested=ReactABI30_0_0kNeverRequested','-DkNeverProgressed=ReactABI30_0_0kNeverProgressed','-DkSMCalloutViewRepositionDelayForUIScrollView=ReactABI30_0_0kSMCalloutViewRepositionDelayForUIScrollView','-DregionAsJSON=ReactABI30_0_0regionAsJSON','-DunionRect=ReactABI30_0_0unionRect','-DJSNoBytecodeFileFormatVersion=ReactABI30_0_0JSNoBytecodeFileFormatVersion','-DJSSamplingProfilerEnabled=ReactABI30_0_0JSSamplingProfilerEnabled','-DRECONNECT_DELAY_MS=ReactABI30_0_0RECONNECT_DELAY_MS','-DMAX_DELTA_TIME=ReactABI30_0_0MAX_DELTA_TIME','-DgCurrentGenerationCount=ReactABI30_0_0gCurrentGenerationCount','-DgPrintSkips=ReactABI30_0_0gPrintSkips','-DgPrintChanges=ReactABI30_0_0gPrintChanges','-DlayoutNodeInternal=ReactABI30_0_0layoutNodeInternal','-DgDepth=ReactABI30_0_0gDepth','-DgPrintTree=ReactABI30_0_0gPrintTree','-DisUndefined=ReactABI30_0_0isUndefined','-DgNodeInstanceCount=ReactABI30_0_0gNodeInstanceCount']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI30_0_0RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ABI30_0_0ENABLE_PACKAGER_CONNECTION=0'
# needed for GoogleMaps 2.x
config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
Expand Down

0 comments on commit 5913221

Please sign in to comment.