From dca0985380c63af9ec933c1cfb1069b321f4f96b Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 25 Jul 2024 10:59:24 +0300 Subject: [PATCH] [angular-18 | WIP] upgrade angular core and cli to v18 --- package.json | 30 ++++++++--------- src/app/app.module.ts | 73 ++++++++++++++++++---------------------- src/assets/common-assets | 2 +- 3 files changed, 49 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index 686fd4b..abc18a8 100644 --- a/package.json +++ b/package.json @@ -21,19 +21,19 @@ }, "private": true, "dependencies": { - "@angular/animations": "^17.3.12", + "@angular/animations": "^18.1.2", "@angular/cdk": "^17.3.10", - "@angular/common": "^17.3.12", - "@angular/compiler": "^17.3.12", - "@angular/core": "^17.3.12", - "@angular/forms": "^17.3.12", - "@angular/localize": "^17.3.12", + "@angular/common": "^18.1.2", + "@angular/compiler": "^18.1.2", + "@angular/core": "^18.1.2", + "@angular/forms": "^18.1.2", + "@angular/localize": "^18.1.2", "@angular/material": "^17.3.10", - "@angular/platform-browser": "^17.3.12", - "@angular/platform-browser-dynamic": "^17.3.12", - "@angular/platform-server": "^17.3.12", - "@angular/router": "^17.3.12", - "@angular/ssr": "^17.3.8", + "@angular/platform-browser": "^18.1.2", + "@angular/platform-browser-dynamic": "^18.1.2", + "@angular/platform-server": "^18.1.2", + "@angular/router": "^18.1.2", + "@angular/ssr": "^18.1.2", "clipboard": "^1.5.16", "core-js": "^2.5.4", "express": "^4.15.2", @@ -46,10 +46,10 @@ "zone.js": "~0.14.0" }, "devDependencies": { - "@angular-devkit/build-angular": "^17.3.8", - "@angular/cli": "^17.3.8", - "@angular/compiler-cli": "^17.3.12", - "@angular/language-service": "^17.3.12", + "@angular-devkit/build-angular": "^18.1.2", + "@angular/cli": "^18.1.2", + "@angular/compiler-cli": "^18.1.2", + "@angular/language-service": "^18.1.2", "@types/compression": "^1.7.0", "@types/express": "^4.17.0", "@types/jasmine": "~3.6.0", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 0655d2e..41f9350 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,7 +1,7 @@ import {APP_ID, NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {CommonModule} from '@angular/common'; -import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http"; +import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http"; import {BrowserModule} from '@angular/platform-browser'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {AppComponent} from './app.component'; @@ -22,45 +22,38 @@ import {AlertModalModule} from "./openaireLibrary/utils/modal/alertModal.module" import {isDevelopmentGuard} from './openaireLibrary/error/isDevelopmentGuard.guard'; import {HelperModule} from "./openaireLibrary/utils/helper/helper.module"; -@NgModule({ - - imports: [ - SharedModule, - BrowserAnimationsModule, - CommonModule, - HttpClientModule, - ErrorModule, - FormsModule, - NavigationBarModule, - QuickContactModule, - BottomModule, - CookieLawModule, - BrowserModule, - AppRoutingModule, - Schema2jsonldModule, - AlertModalModule, - HelperModule - ], - declarations: [AppComponent, OpenaireErrorPageComponent], - exports: [AppComponent], - providers: [ - isDevelopmentGuard, - {provide: APP_ID, useValue: 'monitor'}, - { - provide: HTTP_INTERCEPTORS, - useClass: HttpInterceptorService, - multi: true - }, - { - provide: HTTP_INTERCEPTORS, - useClass: ErrorInterceptorService, - multi: true - }, - [{provide: HTTP_INTERCEPTORS, useClass: TimeoutInterceptor, multi: true}], - [{provide: DEFAULT_TIMEOUT, useValue: 30000}] - ], - bootstrap: [AppComponent] -}) +@NgModule({ declarations: [AppComponent, OpenaireErrorPageComponent], + exports: [AppComponent], + bootstrap: [AppComponent], imports: [SharedModule, + BrowserAnimationsModule, + CommonModule, + ErrorModule, + FormsModule, + NavigationBarModule, + QuickContactModule, + BottomModule, + CookieLawModule, + BrowserModule, + AppRoutingModule, + Schema2jsonldModule, + AlertModalModule, + HelperModule], providers: [ + isDevelopmentGuard, + { provide: APP_ID, useValue: 'monitor' }, + { + provide: HTTP_INTERCEPTORS, + useClass: HttpInterceptorService, + multi: true + }, + { + provide: HTTP_INTERCEPTORS, + useClass: ErrorInterceptorService, + multi: true + }, + [{ provide: HTTP_INTERCEPTORS, useClass: TimeoutInterceptor, multi: true }], + [{ provide: DEFAULT_TIMEOUT, useValue: 30000 }], + provideHttpClient(withInterceptorsFromDi()) + ] }) // export class AppModule { } diff --git a/src/assets/common-assets b/src/assets/common-assets index ee1a55a..eb0051d 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit ee1a55a529fde844f54761633e59f3be791717e3 +Subproject commit eb0051dc347cdaa44476048dea9f6b61200f257f