<aside> ⚠️ The guide is written to upgrade from Angular v13. Starting from earlier versions might work, but it’s not guaranteed. Skip the first steps in case you already have Angular v14.
</aside>
<aside> 🎏 Reference: https://update.angular.io/?v=13.0-15.0.
</aside>
In the front-end’s package.json
file remove any @idea-ionic/xxx
package. Then, run npm i
.
From the front-end
folder, run ng update @angular/core@14 @angular/cli@14
which should bring you to version 14 of Angular.
@angular-eslint/schematics
), remove them temporarily from the package.json
You will re-add them after the the update to Angular 15 is completed.tsconfig.spec.json
file, ignore it.In the angular.json
file, remove obsolete properties; they are highlighted in yellow when you open the file.
From the front-end
folder, run ng update @angular/core@15 @angular/cli@15
which should bring you to version 15 of Angular.
src/test.ts
file, ignore it.In your codebase, do the following actions, to ensure compatibility to Angular v15:
@keyframes
in CSS with the component's scope. This means that any TypeScript code that relies on keyframes
names no longer works in v15. Update any such instances to: define keyframes programmatically, use global stylesheets, or change the component's view encapsulation. Read further.<iframe>
instances might have security-sensitive attributes applied to them as an attribute or property binding. These security-sensitive attributes can occur in a template or in a directive's host bindings. Such occurrences require an update to ensure compliance with the new and stricter rules about <iframe>
bindings. For more information, see the error page.@Injectable
or @Directive
or the compiler returns an error. Read further.ActivatedRouteSnapshot
objects have a title
property. In v15, the title
property is a required property of ActivatedRouteSnapshot
. Read further.In the package.json
file:
@angular-eslint/builder
, @angular-eslint/eslint-plugin
, @angular-eslint/eslint-plugin-template
, @angular-eslint/template-parser
. Afterwards, run a npm i
.protractor
(obsolete).From the front-end
folder, run npm i PACKAGE@latest
, for each of the following packages:
@ionic/angular
.@ionic/storage-angular
.amazon-cognito-identity-js
(if present).rxjs
.tslib
.zone.js
.@idea-ionic/xxx
packages removed in the first steps.@capacitor-community/…
plugins.From the front-end
folder, run npm i -D PACKAGE@latest
, for each of the following dev packages:
@ionic/cli
.@capacitor/cli
.@angular-eslint/schematics
(previously removed).eslint
.@typescript-eslint/parser
(remove it first).@typescript-eslint/eslint-plugin
(remove it first).ts-node
.webpack-bundle-analyzer
.Upgrade Capacitor to v4 by running npx cap migrate
.
<aside> ⚠️ If the app is deployed on either iOS or Android, follow Capacitor’s specific update guide for further operations.
</aside>
From the front-end
folder, remove the package-lock.json
file and node_modules
folder. Then run npm i
: at this point, it shouldn’t throw any errors or vulnerability; it may still show some warnings.
From the back-end
folder, run npm i -D PACKAGE@latest
, for each of the following dev packages:
@apidevtools/swagger-parser
.@tsconfig/node16
.@types/aws-lambda
.@types/[email protected]
.@typescript-eslint/eslint-plugin
(remove it first).@typescript-eslint/parser
(remove it first).aws-cdk
.aws-cdk-lib
.aws-sdk
.constructs
.esbuild
.eslint
.Install (back-end
) the same typescript
version (as dev dependency) used in the front-end.
From the back-end
folder, remove the package-lock.json
file and node_modules
folder. Then run npm i
: at this point, it shouldn’t throw any errors or vulnerability; it may still show some warnings.
You’re done! Test everything before to commit!!
<aside>
➕ To remove the warnings that appear during the front-end’s compile phase, make sure to update the allowedCommonJsDependencies
in the angular.json
file to include at least the following values:
idea-toolbox
,isomorphic-unfetch
,localforage
,@aws-crypto/sha256-js
,js-cookie
.
</aside>