我有一个应用程序,是很久以前开发的,并与非常旧版本的离子和Angular 。
我想更新Angular,Ionic,plugins的版本和所有需要更新的依赖项。在更新之前,我们打算进行一个研究,我们应该遵循什么样的主要路径来更新项目。
在升级之前,您是否已经完成了此文档编制过程?您将如何记录此升级过程?对于遵循此文档编制,您有何建议?
我的包裹
{
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"test": "karma start ./test-config/karma.conf.js",
"test-ci": "karma start ./test-config/karma-ci.conf.js --coverage",
"lint": "node ./node_modules/tslint/bin/tslint --project ./",
"ionic:serve": "ionic-app-scripts serve",
"test-coverage": "karma start ./test-config/karma.conf.js --coverage ",
"test-sonar": "karma start ./test-config/karma.conf.js --coverage --single-run",
"sonar": "npm run test-ci && sonar-scanner"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"config": {
"ionic_webpack": "./config/webpack.config.js",
"ionic_bundler": "webpack",
"ionic_source_map": "source-map"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/barcode-scanner": "^4.18.0",
"@ionic-native/core": "~4.15.0",
"@ionic-native/globalization": "^4.17.0",
"@ionic-native/keyboard": "^4.20.0",
"@ionic-native/local-notifications": "^4.20.0",
"@ionic-native/native-storage": "^4.19.0",
"@ionic-native/network": "^4.20.0",
"@ionic-native/qr-scanner": "^4.18.0",
"@ionic-native/secure-storage": "^4.20.0",
"@ionic-native/splash-screen": "~4.15.0",
"@ionic-native/status-bar": "~4.15.0",
"@ionic/storage": "2.2.0",
"@ngx-translate/core": "^9.1.1",
"@ngx-translate/http-loader": "^2.0.1",
"@totvs/mobile-mingle": "file:totvs-mobile-mingle-3.4.2.tgz",
"angular2-text-mask": "^9.0.0",
"brmasker-ionic-3": "^1.6.3",
"cordova": "^11.0.0",
"cordova-ios": "4.5.5",
"cordova-plugin-app-version": "^0.1.12",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-geolocation": "^4.1.0",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^2.5.3",
"cordova-plugin-ios-camera-permissions": "^1.2.0",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-secure-storage": "^3.0.2",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-enable-cleartext-traffic": "^2.1.0",
"intl": "^1.2.5",
"ionic-angular": "3.9.2",
"ionic2-calendar": "^0.4.5",
"ionic2-mask-directive": "^1.0.8",
"ionicons": "3.0.0",
"js-sha256": "^0.9.0",
"moment": "^2.29.1",
"ngx-mask": "^7.4.0",
"node-sass": "^4.14.1",
"node-sass-middleware": "^0.11.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"to": "^0.2.9",
"update": "^0.7.4",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "1.4.8",
"@ionic/app-scripts": "^3.2.4",
"@totvs/thf-tslint": "^2.9.0",
"@types/jasmine": "2.8.3",
"@types/node": "7.0.7",
"angular2-template-loader": "^0.6.2",
"cordova-android": "^11.0.0",
"cordova-browser": "^4.1.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-badge": "github:katzer/cordova-plugin-badge#8e870f7f",
"cordova-plugin-local-notification": "github:VictorBassoon/cordova-plugin-local-notifications#ea09d29c",
"html-loader": "^0.5.1",
"husky": "^1.2.0",
"ionic-mocks": "^1.3.0",
"istanbul-instrumenter-loader": "^3.0.0",
"jasmine": "^3.6.3",
"jasmine-core": "^3.6.0",
"jasmine-spec-reporter": "^4.1.0",
"karma": "^1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.2",
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-jasmine": "^2.0.0",
"karma-jasmine-html-reporter": "^1.2.0",
"karma-junit-reporter": "^1.2.0",
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^2.0.3",
"null-loader": "^0.1.1",
"phonegap-plugin-barcodescanner-totvs": "^1.0.3",
"protractor": "^5.1.1",
"sonar-scanner": "^3.1.0",
"ts-loader": "^3.0.3",
"ts-node": "^3.0.2",
"tslint": "^5.11.0",
"tslint-sonarts": "^1.8.0",
"typescript": "2.8.4"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-globalization": {},
"cordova-plugin-ios-camera-permissions": {
"CAMERA_USAGE_DESCRIPTION": "your usage message",
"MICROPHONE_USAGE_DESCRIPTION": "your microphone usage message here",
"PHOTOLIBRARY_ADD_USAGE_DESCRIPTION": "your photo library usage message here",
"PHOTOLIBRARY_USAGE_DESCRIPTION": "your photo library usage message here"
},
"cordova-plugin-secure-storage": {},
"cordova-plugin-network-information": {},
"cordova-plugin-app-version": {},
"cordova-plugin-enable-cleartext-traffic": {},
"cordova-plugin-geolocation": {
"GPS_REQUIRED": "true",
"GEOLOCATION_USAGE_DESCRIPTION": "Meu Coletor de Dados uses geolocation to determine this device location."
},
"cordova-plugin-androidx-adapter": {},
"cordova-plugin-badge": {},
"cordova-plugin-local-notification": {
"ANDROID_SUPPORT_V4_VERSION": "26.+"
},
"phonegap-plugin-barcodescanner-totvs": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
},
"platforms": [
"ios",
"android"
]
}
}
我已经提出的要点:
引发应用程序中需要的所有更新,请考虑以下因素:
Angular/Typescript版本混合版本Ionic版本(升级到6)Plugins/dependencies/libs to be replaced在Devops跑步机上将Cordova替换为Capacitor Update(从Cordova到Capacitor的构建更改)更新所需的工作量最好创建一个所有内容都已更新的新项目吗?建议一个应用程序更新策略,以确保过程中的稳定性和组织性。
1条答案
按热度按时间qv7cva1a1#
https://update.angular.io/?v=5.0-15.0。一步一步来。从Angular 5到6。一直这样做,直到你失去离子和其他软件包的支持。然后更新那些。祝你好运。你长期被忽视的项目将很容易花费六个月的时间来更新。可能更多。我个人会从旧项目中挑选有用的部分重新开始。
成功更新后,不要忽略它。
每月至少运行一次
npx npm-check-updates
,并致力于保持新鲜感。