[#149390457] Add support for source maps in Error Analytics - #33
Conversation
| @@ -0,0 +1,16 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Does the script needs bash, can it run with sh?
Also, better to move it under a bin directory to avoid polluting the project root
There was a problem hiding this comment.
The original script runs as bash
https://github.com/facebook/react-native/blob/master/scripts/react-native-xcode.sh
| @@ -0,0 +1,16 @@ | |||
| #!/bin/bash | |||
|
|
|||
| script=./node_modules/react-native/scripts/react-native-xcode.sh | |||
There was a problem hiding this comment.
please add a comment describing what this script does and how to use it
| @@ -0,0 +1,16 @@ | |||
| #!/bin/bash | |||
|
|
|||
| @@ -0,0 +1,16 @@ | |||
| #!/bin/bash | |||
|
|
|||
| script=./node_modules/react-native/scripts/react-native-xcode.sh | |||
There was a problem hiding this comment.
is there a variable name more descriptive than script ? :)
| #!/bin/bash | ||
|
|
||
| script=./node_modules/react-native/scripts/react-native-xcode.sh | ||
| backup=./node_modules/react-native/scripts/react-native-xcode.back.sh |
There was a problem hiding this comment.
not sure if you should backup into node_modules, that directory is supposed to be transient
another option could be to backup into project root and have that file in .gitignore ?
There was a problem hiding this comment.
I gave this more than one thought, having our own version of the script /node_modules/react-native/scripts/react-native-xcode.sh would require a customization of our native projects, possibly causing errors in migrations, it might also soon end up being up out of sync with the repo, resulting in wrong builds or errors in builds without us not even knowing why.
The current patch script at bin/add-ios-source-maps.sh is ran as npm postinstall script. On each new install of the node_modules the patch is meant to be executed again.
| # append ` --sourcemap-output "$BUNDLE_FILE.map"` to the `bundle` after `--bundle-output "$BUNDLE_FILE" \` | ||
| replace=$(awk '1;/bundle-output /{ print " --sourcemap-output \"$BUNDLE_FILE.map\" \\"}' "$script") | ||
| echo "$replace" > "$script" | ||
|
|
There was a problem hiding this comment.
you should print something in the else, like "backup file already exist, skipping backup"
| /* | ||
| Imported from | ||
| https://github.com/philipshurpik/react-native-source-maps/blob/master/index.js | ||
| due to dependecies' errors |
There was a problem hiding this comment.
The native dependency react-native-fs was throwing some errors on invocations when installed from the original npm module. This could be due to a API breaking version.
Also I ended up customizing the source code in order to allow Android support.
https://github.com/teamdigitale/ItaliaApp/pull/33/files/5cf0f6cb242961f26d249ad2909912ff9e7934b3#diff-7652556149ff20e100d57fa7df5beadfR60
We could send a PR or fork the repo/module once we're positive about the solution. Right now the original committer is not responsive
philipshurpik/react-native-source-maps#2
There was a problem hiding this comment.
ok, thanks, please add this explanation to the comment above, for future reference
| ` | ||
| We have reported this to our team! Please close the app and start again! | ||
| ` | ||
| 'We have reported this to our team! Please close the app and start again!' |
There was a problem hiding this comment.
can you please create a story on Pivotal for translating this string?
There was a problem hiding this comment.
|
How is the upgrade of react handled? do I need to run something after |
|
This is a minor upgrade (from should do the job. |
| @@ -0,0 +1,23 @@ | |||
| #!/bin/bash | |||
|
|
|||
There was a problem hiding this comment.
Need a comment on what this script purpose is, e.g: This script configures... It gets executed by ... after ...
| /* | ||
| Imported from | ||
| https://github.com/philipshurpik/react-native-source-maps/blob/master/index.js | ||
| due to dependecies' errors |
There was a problem hiding this comment.
ok, thanks, please add this explanation to the comment above, for future reference
Adds
react-native-device-info, in order to retrieve the readable app version (
${package.version}.${build.version}i.e. 0.1.22)react-native-fs needed by
react-native-source-mapsa custom script to patch
node_modules/react-native/scripts/react-native-xcode.shin order to append--sourcemap-output "$BUNDLE_FILE.mapfor source map generationcustomized version of react-native-source-maps that will create a readable stack trace from source maps
Upgrades
0.46.4in order to improve the app's buildDemo