Skip to content

Commit dc9fd9e

Browse files
Update README.md
Some major edits since all is working now.
1 parent 5b36727 commit dc9fd9e

File tree

1 file changed

+40
-14
lines changed

1 file changed

+40
-14
lines changed

README.md

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,52 @@
1+
## Who am I
2+
3+
This is demo repo is used by Solution Engineers when demo'ing Sentry's [React Native](https://docs.sentry.io/platforms/react-native) SDK's capabilties.
4+
15
## Where do I begin
26

37
Please see [INSTALL.md](./Install.md) to get started with the setup.
48

9+
## What next
10+
* If you are ready to demo:
11+
```
12+
$git clone <this repo>
13+
Edit App.js to add your Sentry's react-native's project's DSN key
14+
$npx @sentry/wizard -i reactNative -p ios android
15+
```
16+
### Above will :
17+
* Launch the [Sentry wizard](https://github.com/getsentry/sentry-wizard) allowing you to link with the correct Sentry react-native project.
18+
* Create `ios/sentry.properties` and `android/sentry.properties`.
19+
### Gotcha:
20+
At this point, you may get an error like:
21+
* `TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
22+
23+
From my test runs I've noted that it is safe to look past this error. A minor issue is that it blocks creation of `ios/sentry.properties`. So simply make a copy of `android/sentry.properties` and put it in `ios/sentry.properties`
24+
25+
```
26+
cp andoid/sentry.properties ios/sentry.properties
27+
cd ios
28+
pod install
29+
```
30+
31+
### To Launch the Demo apps:
32+
33+
* _iOS version_: `npx react-native run-ios --configuration Release`
34+
* _Android version_: `npx react-native run-android --variant Release`
535

636
## Why so many files
737

8-
Please see [Steps](#what-were-the-steps-again) or go through the [first ten commits](https://github.com/sentry-demos/sentry_react_native/commits/master) (and their git log) messages in chronological order, to see the exact commands that were run, step by step, to get all the autogenertaed files we needed as we kept in mind that "junk" does not belong in an SCM system.
38+
Actually, its so not that many :-) . The size of this repo is approx. 1.3MB while the size of the [original react-native](https://github.com/sentry-demos/react-native) is approx 350MB.
939

10-
Turns out react-native generates it own [.gitignore file](https://stackoverflow.com/questions/49099131/recommended-gitignore-for-react-native/49099219
11-
), which is of course part of this repo, so only those [autogenerated files](https://stackoverflow.com/questions/48448426/why-dont-we-gitignore-ios-and-android-in-react-native ) that are required for a baseline setup and the original demo code (files) are part of this repo. So now we are at point, where one can simply clone, make a few edits and like DSN, project name, auth token and be up and running.
40+
Please see [Steps](#what-were-the-steps-again) or go through the [first ten commits](https://github.com/sentry-demos/sentry_react_native/commits/master) (and their git log) messages in chronological order, to see the exact commands that were run and what files that were autogenerated.
1241

42+
Please know that react-native generates it own [.gitignore file](https://stackoverflow.com/questions/49099131/recommended-gitignore-for-react-native/49099219
43+
), which is of course part of this repo, so only those [autogenerated files](https://stackoverflow.com/questions/48448426/why-dont-we-gitignore-ios-and-android-in-react-native ) that are required for a baseline setup and the original demo code (files) are part of this repo.
1344

14-
## Where's the "original" code
45+
So now we are at point, where one can simply clone, make a few edits and like DSN, project name, auth token and be up and running.
1546

16-
Adam worked on App.js which I took as-is from him. Plus the 2 image files in the assets dir (which are also present in [original react-native repo ]( https://github.com/sentry-demos/react-native/commit/269f58d63426065a4de67a3f22d2e774787cd996)
47+
## Where's the "original" code
1748

49+
Adam worked on App.js which I took as-is from him. I also got from him the 2 image files in the assets dir (which are also present in [original react-native repo ]( https://github.com/sentry-demos/react-native)
1850

1951
## What else
2052

@@ -24,14 +56,13 @@ Since the assets are taken from there, and that it has its own App.js, it makes
2456

2557
### Update
2658

27-
So I took the major files from this working demo viz. package.json, package-lock.json, ios/Podfile, ios/Podfile.lock, because it is these files that make the deliverable self-contained, amongst other changes like DSN and put them on top of [original react-native repo ]( https://github.com/sentry-demos/react-native/commit/269f58d63426065a4de67a3f22d2e774787cd996) , and I am getting comile errors for both ios and android.
59+
So I took the major files from this working demo viz. `package.json`, `package-lock.json`, `ios/Podfile`, `ios/Podfile.lock`, because it is such files that make the deliverable self-contained, amongst other changes like DSN. When I put them on top of [original react-native repo ]( https://github.com/sentry-demos/react-native/commit/269f58d63426065a4de67a3f22d2e774787cd996) , I am get comile errors for both ios and android versions.
2860

29-
At this time, I propose, we use this very repo (sentry_react_native) as the new working demo for RN stuff and forget about making them work on TOP of [original react-native repo ]( https://github.com/sentry-demos/react-native/commit/269f58d63426065a4de67a3f22d2e774787cd996) . That to me is now a hacker's or pure development exercise.
61+
At this time, I propose, we use this very repo (sentry_react_native) as the new working demo for RN stuff and forget about making them work on TOP of [original react-native repo](https://github.com/sentry-demos/react-native) . That to me is now a hacker's or pure development exercise.
3062

3163
## What were the steps again
3264

33-
This is just the background steps to get to this repo in this state. You can simply clone and make minimal changes to DSN key to get up and running.
34-
65+
This is just the background steps to answer "How did we get here ?" . Below is not needed/related to the demoing this app.
3566
```
3667
npx react-native init sentry_react_native (where sentry_react_native is the project name) This generates the boiler plate code for the RN app
3768
cd sentry_react_native
@@ -55,10 +86,5 @@ cd ios
5586
pod install
5687
cd ..
5788
```
58-
5989
Ran git commit along the way and finally pushed to this repo.
6090

61-
62-
Launch iOS simulator: `npx react-native run-ios --configuration Release`
63-
64-
Launch Android: `npx react-native run-android --variant Release`

0 commit comments

Comments
 (0)