Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: avishayil/react-native-restart
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8c29a7744c25a3308bf869cd470b0cffc93d1d71
Choose a base ref
...
head repository: avishayil/react-native-restart
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 529faa21c97015a703afd73e0f717f2d9011f58d
Choose a head ref
Loading
Showing with 19,915 additions and 4,380 deletions.
  1. +15 −0 .editorconfig
  2. +1 −0 .env.example
  3. +3 −0 .eslintignore
  4. +1 −0 .gitattributes
  5. +56 −34 .gitignore
  6. +3 −1 .npmignore
  7. +28 −0 .travis.yml
  8. +57 −0 CONTRIBUTING.md
  9. +0 −3 Example/.babelrc
  10. +4 −0 Example/.eslintrc.js
  11. +48 −19 Example/.flowconfig
  12. +12 −6 Example/.gitignore
  13. +6 −0 Example/.prettierrc.js
  14. +132 −0 Example/App.js
  15. +6 −4 Example/__tests__/{index.ios.js → App-test.js}
  16. +0 −12 Example/__tests__/index.android.js
  17. +0 −66 Example/android/app/BUCK
  18. +55 −0 Example/android/app/_BUCK
  19. +97 −16 Example/android/app/build.gradle
  20. +19 −0 Example/android/app/build_defs.bzl
  21. BIN Example/android/app/debug.keystore
  22. +0 −56 Example/android/app/proguard-rules.pro
  23. +8 −0 Example/android/app/src/debug/AndroidManifest.xml
  24. +72 −0 Example/android/app/src/debug/java/com/example/ReactNativeFlipper.java
  25. +6 −10 Example/android/app/src/main/AndroidManifest.xml
  26. +8 −8 Example/android/app/src/main/java/com/example/MainActivity.java
  27. +58 −19 Example/android/app/src/main/java/com/example/MainApplication.java
  28. BIN Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  29. BIN Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  30. BIN Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  31. BIN Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  32. BIN Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  33. BIN Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  34. BIN Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  35. BIN Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  36. BIN Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  37. BIN Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  38. +1 −0 Example/android/app/src/main/res/values/styles.xml
  39. +18 −5 Example/android/build.gradle
  40. +9 −1 Example/android/gradle.properties
  41. BIN Example/android/gradle/wrapper/gradle-wrapper.jar
  42. +1 −1 Example/android/gradle/wrapper/gradle-wrapper.properties
  43. +67 −48 Example/android/gradlew
  44. +103 −90 Example/android/gradlew.bat
  45. +0 −8 Example/android/keystores/BUCK
  46. +0 −4 Example/android/keystores/debug.keystore.properties
  47. +4 −3 Example/android/settings.gradle
  48. +4 −0 Example/app.json
  49. +3 −0 Example/babel.config.js
  50. +0 −63 Example/index.android.js
  51. +0 −63 Example/index.ios.js
  52. +9 −0 Example/index.js
  53. +53 −0 Example/ios/Example-tvOS/Info.plist
  54. +24 −0 Example/ios/Example-tvOSTests/Info.plist
  55. +587 −579 Example/ios/Example.xcodeproj/project.pbxproj
  56. +29 −21 .../RCTRestart.xcscheme → Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example-tvOS.xcscheme
  57. +2 −43 Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme
  58. +10 −0 Example/ios/Example.xcworkspace/contents.xcworkspacedata
  59. +8 −0 Example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  60. +2 −10 Example/ios/Example/AppDelegate.h
  61. +36 −15 Example/ios/Example/AppDelegate.m
  62. +0 −42 Example/ios/Example/Base.lproj/LaunchScreen.xib
  63. +6 −0 Example/ios/Example/Images.xcassets/Contents.json
  64. +18 −15 Example/ios/Example/Info.plist
  65. +58 −0 Example/ios/Example/LaunchScreen.storyboard
  66. +0 −9 Example/ios/Example/main.m
  67. +6 −11 Example/ios/ExampleTests/ExampleTests.m
  68. +1 −1 Example/ios/ExampleTests/Info.plist
  69. +34 −0 Example/ios/Podfile
  70. +478 −0 Example/ios/Podfile.lock
  71. +50 −0 Example/metro.config.js
  72. +27 −21 Example/package.json
  73. +5,932 −2,790 Example/yarn.lock
  74. +2 −3 LICENSE
  75. +63 −66 README.md
  76. +101 −17 android/build.gradle
  77. +3 −0 android/gradle.properties
  78. +0 −29 android/proguard-rules.pro
  79. +2 −1 android/src/main/AndroidManifest.xml
  80. +0 −15 android/src/main/java/com/avishayil/rnrestart/ReactInstanceHolder.java
  81. +7 −0 android/src/main/java/com/reactnativerestart/ReactInstanceHolder.java
  82. +5 −11 ...in/java/com/{avishayil/rnrestart/ReactNativeRestart.java → reactnativerestart/RestartModule.java}
  83. +3 −6 ...com/{avishayil/rnrestart/ReactNativeRestartPackage.java → reactnativerestart/RestartPackage.java}
  84. +3 −0 babel.config.js
  85. +1 −0 badges/badge-branches.svg
  86. +1 −0 badges/badge-functions.svg
  87. +1 −0 badges/badge-lines.svg
  88. +1 −0 badges/badge-statements.svg
  89. +3 −0 commitlint.config.js
  90. BIN gif/android.gif
  91. BIN gif/ios.gif
  92. +0 −11 index.js
  93. BIN ...start.xcodeproj/project.xcworkspace/xcuserdata/avishay.xcuserdatad/UserInterfaceState.xcuserstate
  94. +0 −22 ios/RCTRestart.xcodeproj/xcuserdata/avishay.xcuserdatad/xcschemes/xcschememanagement.plist
  95. +0 −6 ios/RCTRestart/RCTRestart.h
  96. +0 −24 ios/RCTRestart/RCTRestart.m
  97. +7 −0 ios/Restart.h
  98. +23 −0 ios/Restart.m
  99. +77 −59 ios/{RCTRestart.xcodeproj → Restart.xcodeproj}/project.pbxproj
  100. +1 −1 ios/{RCTRestart.xcodeproj/project.xcworkspace → Restart.xcworkspace}/contents.xcworkspacedata
  101. +8 −0 ios/Restart.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  102. +137 −12 package.json
  103. +19 −0 react-native-restart.podspec
  104. +5 −0 src/__mocks__/react-native-restart.tsx
  105. +10 −0 src/__tests__/index.test.tsx
  106. +9 −0 src/index.tsx
  107. +27 −0 tsconfig.json
  108. +92 −0 windows/.gitignore
  109. +14 −0 windows/NuGet.Config
  110. +187 −0 windows/ReactNativeRestart.sln
  111. +16 −0 windows/ReactNativeRestart/PropertySheet.props
  112. +52 −0 windows/ReactNativeRestart/RNRestart.h
  113. +3 −0 windows/ReactNativeRestart/ReactNativeRestart.def
  114. +158 −0 windows/ReactNativeRestart/ReactNativeRestart.vcxproj
  115. +20 −0 windows/ReactNativeRestart/ReactNativeRestart.vcxproj.filters
  116. +19 −0 windows/ReactNativeRestart/ReactPackageProvider.cpp
  117. +21 −0 windows/ReactNativeRestart/ReactPackageProvider.h
  118. +9 −0 windows/ReactNativeRestart/ReactPackageProvider.idl
  119. +5 −0 windows/ReactNativeRestart/packages.config
  120. +1 −0 windows/ReactNativeRestart/pch.cpp
  121. +8 −0 windows/ReactNativeRestart/pch.h
  122. +10,516 −0 yarn.lock
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=xxx
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Example/
lib/
coverage/
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pbxproj -text
90 changes: 56 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,41 +1,63 @@
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache

# OS or Editor folders
# OSX
#
.DS_Store
.cache
.project
.settings
.tags
.tmproj
.iml
nbproject
Thumbs.db
tags

# NPM packages folder.
node_modules/

# Brunch folder for temporary files.
tmp/
# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Brunch output folder.
public/
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Bower stuff.
bower_components/
# Android/IJ
#
.idea
.gradle
local.properties
android.iml

# API Docs
docs/api/
# Cocoapods
#
Example/ios/Pods

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# DotEnv
# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# generated by bob
lib/

# Dot Env
.env

# Coverage
coverage/
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
examples
__tests__/
_mocks_/
.commitling.config.js
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
jdk: oraclejdk8
language: android
sudo: false

android:
components:
- tools
- platform-tools
- build-tools-29.0.2
- build-tools-28.0.3
- android-29
- extra-google-m2repository

before_install:
- nvm install 12
- node --version
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update -qq
- sudo apt-get install -y -qq --no-install-recommends yarn

install:
- cd Example && yarn && cd .. && yarn

script:
- yarn lint
- yarn test
- cd Example/android && ./gradlew assembleRelease
57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Contributing to React Native Restart

## Development Process

I am an individual working on this project, all the work is public and presented on GitHub.

### Development workflow

1. Fork the repo and create your branch from `master` (a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/)).
2. Run `yarn bootstrap` to setup the development environment.
3. Do the changes you want and test them out in the example app before sending a pull request.

### Commit message convention

We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for commit messages:

* `fix`: bug fixes, e.g. fixed issues with custom component.
* `feat`: new features, e.g. added a prop or a capability.
* `refactor`: code refactor, e.g. new folder structure.
* `docs`: changes into documentation, e.g. add usage example.
* `test`: adding or updating tests, eg unit, snapshot testing.
* `chore`: tooling changes, e.g. change travis.yml config.
* `BREAKING CHANGE`: for changes that break existing usage, e.g. changed usage.

The built-in pre-commit hooks verify that your commit message matches this format when committing.

### Linting and tests

We use `typescript` for type checking, `eslint` for linting and formatting the code, and `jest` for testing. Our pre-commit hooks verify that the linter and tests pass when commiting. You can also run the following commands manually:

* `yarn typescript`: type-check files with `tsc`.
* `yarn lint`: lint files with `eslint`.
* `yarn test`: run unit tests with `jest`.

### Sending a pull request

When you're sending a pull request:

* Prefer small pull requests focused on one change.
* Verify that `typescript`, `eslint` and all tests are passing.
* Preview the documentation to make sure it looks good.
* Follow the pull request template when opening a pull request.
* Update the type definitions for Typescript if you changed an API or added a prop.

### Running the example

The example app uses [Expo](https://expo.io/) for the React Native example. You will need to install the Expo app for [Android](https://play.google.com/store/apps/details?id=host.exp.exponent) and [iOS](https://itunes.apple.com/app/apple-store/id982107779) to start developing.

After you're done, you can run `yarn example start` in the project root (or `expo start` in the `Example/` folder) and scan the QR code to launch it on your device.

## Reporting issues

You can report issues on the [bug tracker](https://github.com/avishayil/react-native-restart/issues). Please follow the issue template when opening an issue.

## License

By contributing to React Native Restart, you agree that your contributions will be licensed under its **MIT** license.
3 changes: 0 additions & 3 deletions Example/.babelrc

This file was deleted.

4 changes: 4 additions & 0 deletions Example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
67 changes: 48 additions & 19 deletions Example/.flowconfig
Original file line number Diff line number Diff line change
@@ -5,40 +5,69 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/
node_modules/react-native/interface.js
node_modules/react-native/flow/

[options]
module.system=haste
emoji=true

experimental.strict_type_args=true
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

unsafe.enable_getters_and_setters=true
[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.36.0
^0.122.0
18 changes: 12 additions & 6 deletions Example/.gitignore
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
@@ -34,20 +33,27 @@ local.properties
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
# https://docs.fastlane.tools/best-practices/source-control/

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
6 changes: 6 additions & 0 deletions Example/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
Loading