Completely removed expo from android project

This commit is contained in:
Arnaud Vergnet 2020-04-29 13:04:59 +02:00
parent 8daa2641dc
commit a4bbd84136
8 changed files with 35 additions and 81 deletions

View file

@ -80,10 +80,7 @@ project.ext.react = [
enableHermes: true,
]
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
@ -194,18 +191,6 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
addUnimodulesDependencies([exclude: [
'expo-camera',
'expo-barcode-scanner',
'expo-error-recovery',
'expo-image-loader',
'expo-keep-awake',
'expo-linear-gradient',
'expo-location',
'expo-web-browser',
'expo-sqlite',
'expo-image-loader',
]])
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";

View file

@ -9,16 +9,6 @@ import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import fr.amicaleinsat.application.generated.BasePackageList;
import org.unimodules.adapters.react.ReactAdapterPackage;
import org.unimodules.adapters.react.ModuleRegistryAdapter;
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
import org.unimodules.core.interfaces.Package;
import org.unimodules.core.interfaces.SingletonModule;
import expo.modules.constants.ConstantsPackage;
import expo.modules.permissions.PermissionsPackage;
import expo.modules.filesystem.FileSystemPackage;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
@ -26,10 +16,6 @@ import java.util.List;
import javax.annotation.Nullable;
public class MainApplication extends Application implements ReactApplication {
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(
new BasePackageList().getPackageList(),
null
);
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
@ -40,7 +26,6 @@ public class MainApplication extends Application implements ReactApplication {
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
return packages;
}

View file

@ -1,16 +0,0 @@
package fr.amicaleinsat.application.generated;
import java.util.Arrays;
import java.util.List;
import org.unimodules.core.interfaces.Package;
public class BasePackageList {
public List<Package> getPackageList() {
return Arrays.<Package>asList(
new expo.modules.constants.ConstantsPackage(),
new expo.modules.filesystem.FileSystemPackage(),
new expo.modules.font.FontLoaderPackage(),
new expo.modules.permissions.PermissionsPackage()
);
}
}

View file

@ -1,8 +1,5 @@
rootProject.name = 'Campus'
apply from: '../node_modules/react-native-unimodules/gradle.groovy'
includeUnimodulesProjects()
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings)

View file

@ -1,11 +1,3 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo', '@babel/preset-flow'],
env: {
production: {
plugins: ['react-native-paper/babel'],
},
},
};
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};

View file

@ -1,8 +1,4 @@
import {registerRootComponent} from 'expo';
import {AppRegistry} from 'react-native';
import App from './App';
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in the Expo client or in a native build,
// the environment is set up appropriately
registerRootComponent(App);
AppRegistry.registerComponent('main', () => App);

17
metro.config.js Normal file
View file

@ -0,0 +1,17 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};

View file

@ -1,12 +1,13 @@
{
"name": "campus",
"version": "2.0.0",
"private": true,
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"test": "jest",
"testw": "jest --watch",
"testc": "jest --coverage"
"lint": "eslint ."
},
"jest": {
"preset": "react-native",
@ -24,7 +25,6 @@
"@react-navigation/drawer": "^5.1.1",
"@react-navigation/native": "^5.0.9",
"@react-navigation/stack": "^5.1.1",
"expo": "^37.0.0",
"i18n-js": "^3.3.0",
"react": "~16.9.0",
"react-dom": "16.9.0",
@ -49,7 +49,6 @@
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "~2.2.0",
"react-native-splash-screen": "^3.2.0",
"react-native-unimodules": "~0.9.0",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "~0.11.7",
"react-native-webview": "8.1.1",
@ -57,15 +56,14 @@
"react-navigation-header-buttons": "^3.0.5"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"babel-jest": "~25.2.6",
"jest": "^25.1.0",
"react-test-renderer": "^16.13.1",
"@babel/cli": "^7.8.4",
"@babel/preset-flow": "^7.9.0",
"babel-preset-expo": "^8.1.0",
"flow-bin": "^0.122.0",
"jest-extended": "^0.11.5"
},
"private": true
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.58.0",
"react-test-renderer": "16.9.0",
"flow-bin": "^0.122.0"
}
}