Как мне улучшить время реакции на запуск? - PullRequest
0 голосов
/ 25 сентября 2019

Я продолжаю разрабатывать мобильное приложение для электронной коммерции, и мой ноутбук немного запаздывает, он достигает 30m для создания приложений!Как улучшить время сборки, что ли какая-то библиотека делает ее тяжелой, или я делаю это неправильно?

30 минут для сборки: время реакции and-native run-android

Моя спецификация

Версия Java: 8 Моя машина: Dell Latitude E7440, i5Gen4, 8GB RAM

ОС: Linux Ubuntu 18

реактивный: 0,59

используемые зависимости:

"dependencies": {
    "@ptomasroos/react-native-multi-slider": "1.0.0",
    "@rematch/core": "1.0.6",
    "@rematch/persist": "1.1.5",
    "autobind-decorator": "2.1.0",
    "base-64": "0.1.0",
    "crypto-js": "3.1.9-1",
    "hoist-non-react-statics": "3.2.1",
    "html-entities": "1.2.1",
    "i18n-js": "3.2.1",
    "lodash": "4.17.4",
    "metro-react-native-babel-preset": "0.54.0",
    "moment": "2.20.1",
    "native-base": "2.7.0",
    "next-frame": "0.2.3",
    "react": "16.8.3",
    "react-native": "0.59.10",
    "react-native-autoheight-webview": "1.1.3",
    "react-native-branch": "2.3.3",
    "react-native-camera": "1.4.3",
    "react-native-code-push": "5.6.0",
    "react-native-device-info": "2.3.2",
    "react-native-exit-app-no-history": "1.0.2",
    "react-native-fast-image": "5.2.0",
    "react-native-fbsdk": "0.8.0",
    "react-native-fetch-polyfill": "1.1.3",
    "react-native-firebase": "5.1.1",
    "react-native-fs": "2.12.1",
    "react-native-google-signin": "1.2.2",
    "react-native-i18n": "2.0.10",
    "react-native-image-picker": "0.28.0",
    "react-native-iphone-x-helper": "1.0.2",
    "react-native-looped-carousel": "git+https://github.com/phil-r/react-native-looped-carousel.git#e23e1ad41e67ee9e95558e7df00c364fbb1b688b",
    "react-native-maps": "0.24.2",
    "react-native-masked-text": "1.9.1",
    "react-native-material-textfield": "0.12.0",
    "react-native-modal": "6.5.0",
    "react-native-modal-datetime-picker": "6.0.0",
    "react-native-moengage": "3.0.0",
    "react-native-offline": "3.14.1",
    "react-native-photo-view": "1.5.2",
    "react-native-share": "1.0.23",
    "react-native-snackbar": "0.5.3",
    "react-native-splash-screen": "3.2.0",
    "react-native-star-rating": "1.0.8",
    "react-native-webview": "5.12.0",
    "react-native-svg": "9.5.1",
    "react-navigation": "1.5.2",
    "react-navigation-redux-helpers": "1.0.3",
    "react-redux": "5.0.6",
    "redux": "3.7.2",
    "redux-actions": "2.2.1",
    "redux-logger": "3.0.6",
    "redux-persist": "5.10.0",
    "redux-saga": "0.15.6",
    "rn-placeholder": "1.2.0",
    "rn-viewpager": "1.2.9",
    "rollbar-react-native": "0.5.0",
    "sendbird": "3.0.64",
    "shorthash": "0.0.2",
    "url": "0.11.0"
  },
  "devDependencies": {
    "babel-eslint": "10.0.1",
    "@babel/core": "7.4.5",
    "@babel/runtime": "7.4.5",
    "@babel/plugin-proposal-class-properties": "7.4.4",
    "appium": "1.8.1",
    "appium-doctor": "1.4.3",
    "babel-jest": "24.1.0",
    "babel-plugin-module-resolver": "3.1.1",
    "babel-preset-es2015": "6.24.1",
    "enzyme": "3.3.0",
    "enzyme-adapter-react-16": "1.1.1",
    "jest": "24.1.0",
    "jest-serializer-enzyme": "1.0.0",
    "jsdom": "11.5.1",
    "jsdom-global": "3.0.2",
    "metro-react-native-babel-preset": "0.54.0",
    "react-addons-test-utils": "15.6.2",
    "react-dom": "16.8.3",
    "react-native-mock": "0.3.1",
    "react-test-renderer": "16.8.3",
    "reactotron-react-native": "3.5.0",
    "redux-mock-store": "1.4.0",
    "wd": "1.4.0",
    "why-did-you-update": "1.0.6",
    "eslint": "5.16.0",
    "eslint-config-airbnb": "17.1.0",
    "eslint-config-prettier": "4.1.0",
    "eslint-import-resolver-webpack": "0.11.0",
    "eslint-plugin-import": "2.16.0",
    "eslint-plugin-jsx-a11y": "6.2.1",
    "eslint-plugin-prettier": "3.0.1",
    "eslint-plugin-react": "7.12.4",
    "eslint-plugin-react-hooks": "1.6.0",
    "husky": "2.3.0",
    "lint-staged": ">=8",
    "prettier": "1.16.4",
    "prettier-eslint": "8.8.2",
    "prettier-eslint-cli": "4.7.1",
    "prop-types": "15.7.2"
  },

1 Ответ

0 голосов
/ 25 сентября 2019

У вас есть несколько вариантов решения, как показано ниже

  • ваш проект android/app/build.gradle замените слово compile на implementation в зависимостях

  • В том же файле вы можете обновить версию своего проекта build:gradle, например 3.1.3

  • Обновить версию Gradle в android / gradle / wrapper / gradle-wrapper.properties

  • Также я обнаружил, что React-native Run-android занимает слишком много времени

Если вы хотите больше информации о реакции нативной производительности, вы можетечитать этот пост https://facebook.github.io/react-native/docs/performance

...