Skip to content

Commit

Permalink
add feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Feb 27, 2023
1 parent 0f0cb5c commit 662f085
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions apps/bare-expo/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require File.join(File.dirname(`node --print "require.resolve('expo/package.json

require 'json'
podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == true

prepare_react_native_project!

Expand Down
2 changes: 1 addition & 1 deletion apps/bare-expo/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ SPEC CHECKSUMS:
EXPermissions: 2291c6736a823b4c680d5bf8e12d3c1c5d11da35
Expo: 79deb55f33fab1b232232868a74713772943238d
expo-dev-client: fb5994b219d6df2a39d73f45b40a4ad2f29d47c2
expo-dev-launcher: 0eaee0ae43104252e3994f6d7a4810c3aad62fc0
expo-dev-launcher: 535eef9421a2cd0529bcc1f9e67ab7cb58fda3e7
expo-dev-menu: b1f53d0ec3d9f330b53a1c701ea3257aad5ce28a
expo-dev-menu-interface: 6c82ae323c4b8724dead4763ce3ff24a2108bdb1
ExpoAppleAuthentication: 7bd5e4150d59e8df37aa80b425850ae88adf9e65
Expand Down
3 changes: 2 additions & 1 deletion apps/bare-expo/ios/Podfile.properties.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"expo.jsEngine": "hermes"
"expo.jsEngine": "hermes",
"EX_DEV_CLIENT_NETWORK_INSPECTOR": true
}
19 changes: 13 additions & 6 deletions packages/expo-dev-launcher/expo-dev-launcher.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,24 @@ Pod::Spec.new do |s|
'GCC_PREPROCESSOR_DEFINITIONS' => "EX_DEV_LAUNCHER_VERSION=#{s.version}"
}

# Swift/Objective-C compatibility
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES" }
other_c_flags = '$(inherited)'
dev_launcher_url = ENV['EX_DEV_LAUNCHER_URL'] || ""
if dev_launcher_url != ""
escaped_dev_launcher_url = Shellwords.escape(dev_launcher_url).gsub('/','\\/')
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'OTHER_CFLAGS[config=Debug]' => "$(inherited) -DEX_DEV_LAUNCHER_URL=\"\\\"" + escaped_dev_launcher_url + "\\\"\""
}
other_c_flags += " -DEX_DEV_LAUNCHER_URL=\"\\\"" + escaped_dev_launcher_url + "\\\"\""
end
other_swift_flags = "$(inherited)"
if ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == '1'
other_swift_flags += ' -DEX_DEV_CLIENT_NETWORK_INSPECTOR'
end

# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'OTHER_CFLAGS[config=Debug]' => other_c_flags,
'OTHER_SWIFT_FLAGS[config=Debug]' => other_swift_flags,
}

s.user_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-launcher/Swift Compatibility Header\"",
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React

#if DEBUG
#if DEBUG && EX_DEV_CLIENT_NETWORK_INSPECTOR

/**
This class intercepts all default `URLSession` requests and send CDP events to the connecting metro-inspector-proxy
Expand Down

0 comments on commit 662f085

Please sign in to comment.