You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* react-native: Simplify react-native source map injection flow
* react-native: Flow adjustements & Code review
* react-native: Demo source map description
* react-native: Bring standard serialization method, formatting and fix environment variable read
* react-native: override correctly path to the debug id file in the source map upload script
* react-native: move upload script to the react-native directory and process source map via node, not via jq
* react-native: use basename of the script
Co-authored-by: Sebastian Alex <sebapotok@gmail.com>
* react-native: uplaod script- remove shebang from addDebugIdToSourceMap
* react-native: move scripts into the script directory and adjust paths to them in readme/xcode
---------
Co-authored-by: Konrad Dysput <konrad.dysput@saucelabs.com>
Co-authored-by: Sebastian Alex <sebapotok@gmail.com>
Copy file name to clipboardExpand all lines: examples/sdk/reactNative/README.md
+43-32
Original file line number
Diff line number
Diff line change
@@ -8,53 +8,64 @@ This example app shows features available in the @backtrace/react-native package
8
8
2.`npm install`. If you're on iOS, navigate to the `ios` directory and run `pod install`
9
9
3.`npm run start` and pick desired platform
10
10
11
-
#### Source maps
11
+
### Source maps
12
+
13
+
This example application is integrated with the source map support. Once you change the .backtracejsrc file, source maps will be automatically uploaded to your project.
12
14
13
15
Before executing any step:
14
16
15
-
- Please update .backtracejsrc file with your symbols submission URL and your sourcemap settings.
17
+
>Please update .backtracejsrc file with your symbols submission URL and your sourcemap settings.
16
18
17
-
On Android: You can verify our example app with the source map support. In order to do that, please use the
18
-
android-sourcemap.sh script.
19
+
Backtrace is compatible with metro build system. To enable source map support, set a `customSerializer` method in the `metro.config.js` file to the `processSourceMap` function available in `@backtrace/react-native/scripts/processSourceMap`.
Enable source map support in `app/build.gradle` by uncommenting hermes source map flags. With additional parameters, source maps will be generated. To automatically upload them to Backtrace, you can use the gradle task available the @backtrace/react-native library.
44
41
45
-
# use hermesc script provided by Backtrace to populate source maps
46
-
# if you dont use hermes support, please skip this step.
npx --yes @backtrace/javascript-cli run --config "$(pwd)/../.backtracejsrc" --path "$SOURCE_MAP_DIR/main.jsbundle"
54
+
**On iOS.**
56
55
57
-
```
56
+
Modify the code in the `Bundle React Native code and images` step in the `Build Phases` of your xcode project setting. In the end of the script, you can include the code below, to upload source maps directly to Backtrace after generating the applicaiton.
58
57
59
-
Note: this modification copy the output of the javascript build into the build directory created in your application
Copy file name to clipboardExpand all lines: examples/sdk/reactNative/ios/reactNative.xcodeproj/project.pbxproj
+1-1
Original file line number
Diff line number
Diff line change
@@ -269,7 +269,7 @@
269
269
);
270
270
runOnlyForDeploymentPostprocessing = 0;
271
271
shellPath = /bin/sh;
272
-
shellScript = "set -e\nset -x\n# destination source map directory\nSOURCE_MAP_DIR=\"$(pwd)/../build\"\nmkdir -p $SOURCE_MAP_DIR\n\nexport SOURCEMAP_FILE=\"$SOURCE_MAP_DIR/main.js.map\";\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n# use hermesc script provided by Backtrace to populate source maps\n# if you dont use hermes support, please skip this step.\nexport HERMES_CLI_PATH=\"$(pwd)/../ios-hermesc.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n\n# copy javascript build output to the build directory\ncp \"$CONFIGURATION_BUILD_DIR/main.jsbundle\" $SOURCE_MAP_DIR \n\nPROCESS_SOURCEMAPS_SCRIPT=\"$(pwd)/../ios-sourcemaps.sh\"\nexport BACKTRACE_JS_CONFIG=\"$(pwd)/../.backtracejsrc\"\nexport BACKTRACE_JS_BUNDLE_PATH=\"$SOURCE_MAP_DIR/main.jsbundle\"\n \n# process source map with javascript code\n/bin/sh -c \"$WITH_ENVIRONMENT $PROCESS_SOURCEMAPS_SCRIPT\"\n";
0 commit comments