[FIX] Remove console on production builds (#1124)
* [FIX] Remove console on production builds * Add react-native-markdown-renderer patch * Update react-native-notifications * Increase maxHeapSize
This commit is contained in:
parent
e351a77a6b
commit
047a0ddf8d
8
.babelrc
8
.babelrc
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"presets": ["module:metro-react-native-babel-preset"],
|
|
||||||
"env": {
|
|
||||||
"production": {
|
|
||||||
"plugins": ["transform-remove-console"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
# android.enableAapt2=false # commenting this makes notifications to stop working
|
# android.enableAapt2=false # commenting this makes notifications to stop working
|
||||||
# android.useDeprecatedNdk=true
|
# android.useDeprecatedNdk=true
|
||||||
|
org.gradle.jvmargs=-Xmx2048M -XX\:MaxHeapSize\=32g
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
VERSIONCODE=999999999
|
VERSIONCODE=999999999
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { createStore, applyMiddleware, compose } from 'redux';
|
import { createStore, applyMiddleware, compose } from 'redux';
|
||||||
import Reactotron from 'reactotron-react-native';
|
|
||||||
import createSagaMiddleware from 'redux-saga';
|
import createSagaMiddleware from 'redux-saga';
|
||||||
import applyAppStateListener from 'redux-enhancer-react-native-appstate';
|
import applyAppStateListener from 'redux-enhancer-react-native-appstate';
|
||||||
|
|
||||||
|
@ -10,8 +9,8 @@ let sagaMiddleware;
|
||||||
let enhancers;
|
let enhancers;
|
||||||
|
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
/* eslint-disable global-require */
|
|
||||||
const reduxImmutableStateInvariant = require('redux-immutable-state-invariant').default();
|
const reduxImmutableStateInvariant = require('redux-immutable-state-invariant').default();
|
||||||
|
const Reactotron = require('reactotron-react-native').default;
|
||||||
sagaMiddleware = createSagaMiddleware({
|
sagaMiddleware = createSagaMiddleware({
|
||||||
sagaMonitor: Reactotron.createSagaMonitor()
|
sagaMonitor: Reactotron.createSagaMonitor()
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
module.exports = {
|
||||||
|
presets: ['module:metro-react-native-babel-preset'],
|
||||||
|
env: {
|
||||||
|
production: {
|
||||||
|
plugins: ['transform-remove-console']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
6
index.js
6
index.js
|
@ -1,9 +1,11 @@
|
||||||
import 'react-native-console-time-polyfill';
|
import 'react-native-console-time-polyfill';
|
||||||
|
|
||||||
import './app/ReactotronConfig';
|
|
||||||
import { AppRegistry } from 'react-native';
|
import { AppRegistry } from 'react-native';
|
||||||
import { name as appName, share as shareName } from './app.json';
|
import { name as appName, share as shareName } from './app.json';
|
||||||
|
|
||||||
|
if (__DEV__) {
|
||||||
|
require('./app/ReactotronConfig');
|
||||||
|
}
|
||||||
|
|
||||||
AppRegistry.registerComponent(appName, () => require('./app/index').default);
|
AppRegistry.registerComponent(appName, () => require('./app/index').default);
|
||||||
AppRegistry.registerComponent(shareName, () => require('./app/share').default);
|
AppRegistry.registerComponent(shareName, () => require('./app/share').default);
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
"react-native-markdown-renderer": "^3.2.8",
|
"react-native-markdown-renderer": "^3.2.8",
|
||||||
"react-native-mime-types": "^2.2.1",
|
"react-native-mime-types": "^2.2.1",
|
||||||
"react-native-modal": "^11.3.0",
|
"react-native-modal": "^11.3.0",
|
||||||
"react-native-notifications": "2.0.3",
|
"react-native-notifications": "^2.0.6",
|
||||||
"react-native-optimized-flatlist": "^1.0.4",
|
"react-native-optimized-flatlist": "^1.0.4",
|
||||||
"react-native-orientation-locker": "^1.1.6",
|
"react-native-orientation-locker": "^1.1.6",
|
||||||
"react-native-picker-select": "6.3.0",
|
"react-native-picker-select": "6.3.0",
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
diff --git a/node_modules/react-native-markdown-renderer/src/index.js b/node_modules/react-native-markdown-renderer/src/index.js
|
||||||
|
index 653bba2..e5cb521 100644
|
||||||
|
--- a/node_modules/react-native-markdown-renderer/src/index.js
|
||||||
|
+++ b/node_modules/react-native-markdown-renderer/src/index.js
|
||||||
|
@@ -88,9 +88,15 @@ export default class Markdown extends Component {
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
- copy = '';
|
||||||
|
- renderer = null;
|
||||||
|
- markdownParser = null;
|
||||||
|
+ constructor(props) {
|
||||||
|
+ super(props);
|
||||||
|
+ this.copy = '';
|
||||||
|
+ this.renderer = null;
|
||||||
|
+ this.markdownParser = null;
|
||||||
|
+ }
|
||||||
|
+ // copy = '';
|
||||||
|
+ // renderer = null;
|
||||||
|
+ // markdownParser = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only when the copy changes will the markdown render again.
|
|
@ -9672,10 +9672,10 @@ react-native-modal@^9.0.0:
|
||||||
prop-types "^15.6.2"
|
prop-types "^15.6.2"
|
||||||
react-native-animatable "^1.2.4"
|
react-native-animatable "^1.2.4"
|
||||||
|
|
||||||
react-native-notifications@2.0.3:
|
react-native-notifications@^2.0.6:
|
||||||
version "2.0.3"
|
version "2.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/react-native-notifications/-/react-native-notifications-2.0.3.tgz#139f693c79e4e37b3e4aa78e7373f5abca53f8e4"
|
resolved "https://registry.yarnpkg.com/react-native-notifications/-/react-native-notifications-2.0.6.tgz#5355fad1ea53327fb00fd5e8a6570279fe32f2a9"
|
||||||
integrity sha512-kMrfhnwFaogErVsJORnUD3L3XFhzG3UkQpI8xPFG+cOo80u03U27J4hPXiEqOAp03ReiuxMgP4EvMXB8NRsLAg==
|
integrity sha512-NFx5ADlqfQYTFkKWvd/GxM8rxKf1lSWJZJY0jbydAOZAuhnKFR/CsH7Mpx6T+9pY5Z3rvu7UzBtVn9LTBx0jYg==
|
||||||
dependencies:
|
dependencies:
|
||||||
core-js "^1.0.0"
|
core-js "^1.0.0"
|
||||||
uuid "^2.0.3"
|
uuid "^2.0.3"
|
||||||
|
|
Loading…
Reference in New Issue