Skip to content

Commit

Permalink
XXX rn-0.60: unlink all third-party libraries [phase 1]
Browse files Browse the repository at this point in the history
React Native 0.60 uses radically different methods to find, include,
and link third-party libraries.

In most cases, a third party library will not need *any* explicit
linkage instructions, either on iOS or Android. (The days of fiddling
with our `.xcodeproj` are almost entirely gone, rather than merely
being replaced with fiddling with our Podfile.)

This is the first, automated step of the removal phase, done largely
with a nonce script (see below). There are two issues with this:

* The script removes certain customized Sentry build items which we'd
  prefer to keep. So we do. (These are simply excluded from the
  commit.)

* A few stray references are not removed from the Xcode project. These
  will be handled in phase 2.

The script follows.

```bash
(
  PACKAGES=(
    @react-native-community/async-storage
    @react-native-community/netinfo
    @remobile/react-native-toast
    @sentry/react-native
    react-native-device-info
    react-native-document-picker
    react-native-image-picker
    react-native-notifications
    react-native-orientation
    react-native-photo-view
    react-native-sound
    react-native-safari-view
    react-native-safe-area
    react-native-text-input-reset
    react-native-vector-icons
    react-native-webview
    rn-fetch-blob
  )

  for package in "${PACKAGES[@]}"; do
    echo -e "\033[34mUnlinking\033[0m \033[1m$package\033[0m..."
    react-native unlink "$package"
  done
)
```
  • Loading branch information
rk-for-zulip committed Jan 30, 2020
1 parent 11458ba commit 6b50b15
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 690 deletions.
14 changes: 0 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,6 @@ repositories {
}

dependencies {
implementation project(':@react-native-community_async-storage')
implementation project(':@sentry_react-native')
implementation project(':@react-native-community_netinfo')
implementation project(':react-native-document-picker')
implementation project(':react-native-webview')
implementation project(':react-native-text-input-reset')
implementation project(':react-native-image-picker')
implementation project(':react-native-orientation')
implementation project(':@remobile_react-native-toast')
implementation project(':react-native-photo-view')
implementation project(':rn-fetch-blob')
implementation project(':react-native-sound')
implementation project(':react-native-device-info')
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
Expand Down
26 changes: 0 additions & 26 deletions android/app/src/main/java/com/zulipmobile/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,11 @@

import android.app.Application;

import com.RNFetchBlob.RNFetchBlobPackage;
import com.facebook.react.ReactApplication;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.reactnativecommunity.netinfo.NetInfoPackage;
import io.github.elyx0.reactnativedocumentpicker.DocumentPickerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.github.yamill.orientation.OrientationPackage;
import com.imagepicker.ImagePickerPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.nikolaiwarner.RNTextInputReset.RNTextInputResetPackage;
import com.reactnative.photoview.PhotoViewPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.remobile.toast.RCTToastPackage;
import com.zmxv.RNSound.RNSoundPackage;
import io.sentry.RNSentryPackage;

import java.util.Arrays;
import java.util.List;
Expand All @@ -42,19 +29,6 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new AsyncStoragePackage(),
new NetInfoPackage(),
new DocumentPickerPackage(),
new RNCWebViewPackage(),
new RNTextInputResetPackage(),
new ImagePickerPackage(),
new OrientationPackage(),
new RNSentryPackage(),
new PhotoViewPackage(),
new RCTToastPackage(),
new RNFetchBlobPackage(),
new RNSoundPackage(),
new RNDeviceInfo(),
new ZulipNativePackage(),
new NotificationsPackage()
);
Expand Down
28 changes: 0 additions & 28 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
rootProject.name = 'ZulipMobile'
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
include ':@sentry_react-native'
project(':@sentry_react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@sentry/react-native/android')
include ':@react-native-community_netinfo'
project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android')
include ':react-native-document-picker'
project(':react-native-document-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-document-picker/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
include ':react-native-text-input-reset'
project(':react-native-text-input-reset').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-text-input-reset/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-orientation'
project(':react-native-orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation/android')
include ':@remobile_react-native-toast'
project(':@remobile_react-native-toast').projectDir = new File(rootProject.projectDir, '../node_modules/@remobile/react-native-toast/android')
include ':react-native-photo-view'
project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')
include ':rn-fetch-blob'
project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android')
include ':react-native-sound'
project(':react-native-sound').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sound/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')

include ':app'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
Loading

0 comments on commit 6b50b15

Please sign in to comment.