Skip to content

Commit

Permalink
feat(rn): add relay debugger
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Sep 12, 2018
1 parent 1ce66be commit 7970aeb
Show file tree
Hide file tree
Showing 5 changed files with 745 additions and 20 deletions.
6 changes: 6 additions & 0 deletions client/react-native/common/relay/environment.js
@@ -1,6 +1,12 @@
import { Environment, Network, RecordSource, Store } from 'relay-runtime'
import { SubscriptionClient } from 'subscriptions-transport-ws'
import { Platform, NativeModules } from 'react-native'
import { installRelayDevTools } from 'relay-devtools'

// eslint-disable-next-line
if (__DEV__) {
installRelayDevTools()
}

// @TODO: patch web CoreModule
if (Platform.OS === 'web') {
Expand Down
4 changes: 2 additions & 2 deletions client/react-native/gomobile/Makefile
Expand Up @@ -40,9 +40,9 @@ init: deps
gomobile init -v -ndk $(ANDROID_NDK_HOME)

.PHONY: ios
ios: $(IOS_BUILD_PATH)/core.framework
ios: $(IOS_BUILD_PATH)/core.framework/Core

$(IOS_BUILD_PATH)/core.framework: $(CORE_SOURCES)
$(IOS_BUILD_PATH)/core.framework/Core: $(CORE_SOURCES)
mkdir -p $(IOS_BUILD_PATH)
CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_LDFLAGS="$(IOS_LDFLAGS)" \
gomobile bind -v -target=ios -o $(IOS_BUILD_PATH)/core.framework .
Expand Down
3 changes: 2 additions & 1 deletion client/react-native/mobile/package.json
Expand Up @@ -6,7 +6,8 @@
"start": "rm -rf $TMPDIR/metro-* && react-native start --reset-cache --root $PWD/../common",
"android": "react-native run-android --no-packager",
"ios": "react-native run-ios --no-packager",
"debugger": "open \"rndebugger://set-debugger-loc?host=localhost&port=8081\"",
"debug:relay": "relay-devtools",
"debug:react-native": "open \"rndebugger://set-debugger-loc?host=localhost&port=8081\"",
"test": "jest",
"link:rn": "ln -fs ../../node_modules/react-native node_modules",
"link:rn-vector-icons": "ln -fs ../../node_modules/react-native-vector-icons node_modules",
Expand Down
1 change: 1 addition & 0 deletions client/react-native/package.json
Expand Up @@ -16,6 +16,7 @@
"react-navigation": "^2.12.1",
"react-relay": "^1.4.1",
"relay-compiler": "^1.4.1",
"relay-devtools": "^1.4.0",
"subscriptions-transport-ws": "^0.9.14"
},
"devDependencies": {
Expand Down

0 comments on commit 7970aeb

Please sign in to comment.