Skip to content

Commit

Permalink
feat!: upgrade to Angular 16 (#2728)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Angular has been upgraded to v16

ng update @angular/{pwa,core,cdk,cli,animations,common,compiler,elements,forms,platform-browser,platform-browser-dynamic,platform-server,router,service-worker,compiler
-cli,language-service}@16.0.0 @nguniversal/{builders,express-engine}@16.0.0 @angular-devkit/{schematics,build-angular,core}@16.
0.0 @angular-eslint/{builder,eslint-plugin,eslint-plugin-template,schematics,template-parser}@16.0.0 @ngrx/{effects,entity,rout
er-store,schematics,store,store-devtools}@16.0.0 [email protected] @angular-devkit/[email protected] angular-in-memory-web-ap
[email protected] [email protected] --force
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 16.2.11 to perform the update.
✔ Packages successfully installed.
Using package manager: npm
Collecting installed dependencies...
Found 106 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/architect @ "0.1602.11" (was "0.1502.9")...
    Updating package.json with dependency @angular-devkit/build-angular @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular-devkit/core @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular-devkit/schematics @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular-eslint/builder @ "16.0.0" (was "15.2.1")...
    Updating package.json with dependency @angular-eslint/eslint-plugin @ "16.0.0" (was "15.2.1")...
    Updating package.json with dependency @angular-eslint/eslint-plugin-template @ "16.0.0" (was "15.2.1")...
    Updating package.json with dependency @angular-eslint/schematics @ "16.0.0" (was "15.2.1")...
    Updating package.json with dependency @angular-eslint/template-parser @ "16.0.0" (was "15.2.1")...
    Updating package.json with dependency @angular/cli @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/compiler-cli @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/language-service @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @ngrx/store-devtools @ "16.0.0" (was "15.4.0")...
    Updating package.json with dependency @nguniversal/builders @ "16.0.0" (was "15.2.1")...
    Updating package.json with dependency ng-packagr @ "16.0.0" (was "15.2.2")...
    Updating package.json with dependency typescript @ "4.9.3" (was "4.8.4")...
    Updating package.json with dependency @angular/animations @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/cdk @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/common @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/compiler @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/core @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/elements @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/forms @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/platform-browser @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/platform-server @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/pwa @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/router @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @angular/service-worker @ "16.0.0" (was "15.2.9")...
    Updating package.json with dependency @ngrx/effects @ "16.0.0" (was "15.4.0")...
    Updating package.json with dependency @ngrx/entity @ "16.0.0" (was "15.4.0")...
    Updating package.json with dependency @ngrx/router-store @ "16.0.0" (was "15.4.0")...
    Updating package.json with dependency @ngrx/schematics @ "16.0.0" (was "15.4.0")...
    Updating package.json with dependency @ngrx/store @ "16.0.0" (was "15.4.0")...
    Updating package.json with dependency @nguniversal/express-engine @ "16.0.0" (was "15.2.1")...
    Updating package.json with dependency angular-in-memory-web-api @ "0.16.0" (was "0.15.0")...
    Updating package.json with dependency zone.js @ "0.13.3" (was "0.11.5")...
UPDATE package.json (4251 bytes)
✔ Packages successfully installed.
** Executing migrations of package '@angular-eslint/schematics' **

▸ Updates @angular-eslint to v16.
UPDATE package.json (4252 bytes)
✔ Packages installed successfully.
  Migration completed (1 file modified).

** Executing migrations of package '@angular/cli' **

▸ Remove 'defaultProject' option from workspace configuration.
  The project to use will be determined from the current working directory.
  Migration completed (No changes made).

▸ Replace removed 'defaultCollection' option in workspace configuration with 'schematicCollections'.
  Migration completed (No changes made).

▸ Update the '@angular-devkit/build-angular:server' builder configuration to disable 'buildOptimizer' for non optimized builds.
UPDATE angular.json (71902 bytes)
  Migration completed (1 file modified).

** Executing migrations of package '@angular/cdk' **

▸ Updates the Angular CDK to v16.
    Skipping migration for project demo-e2e. Unable to determine 'tsconfig.json' file in workspace config.
    Skipping migration for project daffio-e2e. Unable to determine 'tsconfig.json' file in workspace config.
    Skipping migration for project design-land-e2e. Unable to determine 'tsconfig.json' file in workspace config.

      ✓  Updated Angular CDK to version 16

  Migration completed (No changes made).

** Executing migrations of package '@angular/core' **

▸ In Angular version 15.2, the guard and resolver interfaces (CanActivate, Resolve, etc) were deprecated.
  This migration removes imports and 'implements' clauses that contain them.
UPDATE apps/demo/src/app/cart/routing-resolvers/resolvers/cart-resolver.service.ts (1198 bytes)
UPDATE apps/demo/src/app/cart/routing-resolvers/resolvers/empty-cart-resolver.service.ts (942 bytes)
UPDATE libs/external-router/routing/src/guard/existence.guard.ts (3506 bytes)
UPDATE libs/product/routing/src/resolvers/product-page-id/product-page-id.resolver.ts (1369 bytes)
UPDATE libs/product/routing/src/resolvers/product-page/product-page.resolver.ts (790 bytes)
UPDATE libs/product/routing/src/resolvers/product-page-url/product-page-url.resolver.ts (1700 bytes)
UPDATE libs/category/routing/src/resolvers/category-page-id/category-page-id.resolver.ts (1815 bytes)
UPDATE libs/category/routing/src/resolvers/category-page/category-page.resolver.ts (772 bytes)
UPDATE libs/category/routing/src/resolvers/category-page-url/category-page-url.resolver.ts (1703 bytes)
UPDATE libs/cart/routing/src/guards/billing-address/billing-address.guard.ts (1277 bytes)
UPDATE libs/cart/routing/src/guards/resolved-cart/resolved-cart.guard.ts (1781 bytes)
UPDATE libs/cart/routing/src/guards/resolve-cart/resolve-cart.guard.ts (3308 bytes)
UPDATE libs/cart/routing/src/guards/cart-items/cart-items.guard.ts (1409 bytes)
UPDATE libs/cart/routing/src/guards/in-stock-items/in-stock-items.guard.ts (1609 bytes)
UPDATE libs/cart/routing/src/guards/payment-method/payment-method.guard.ts (1268 bytes)
UPDATE libs/cart/routing/src/guards/shipping-address/shipping-address.guard.ts (1286 bytes)
UPDATE libs/cart/routing/src/guards/shipping-method/shipping-method.guard.ts (1277 bytes)
UPDATE libs/cart/routing/src/guards/order-result/order-result.guard.ts (1020 bytes)
UPDATE libs/cart/routing/src/resolvers/cart-resolver.service.ts (1837 bytes)
UPDATE libs/cart/routing/src/resolvers/empty-cart-resolver.service.ts (1402 bytes)
UPDATE apps/daffio/src/app/api/resolvers/api-list-resolver.service.ts (715 bytes)
UPDATE apps/daffio/src/app/docs/resolvers/docs-resolver.service.ts (1055 bytes)
UPDATE libs/auth/routing/src/guards/member-only.guard.ts (1690 bytes)
UPDATE libs/auth/routing/src/guards/guest-only.guard.ts (1689 bytes)
UPDATE libs/auth/routing/src/guards/reset-password.guard.ts (847 bytes)
UPDATE libs/paypal/routing/src/guards/express-payment/guard.ts (1283 bytes)
UPDATE libs/order/routing/src/guards/placed-order/placed-order.guard.ts (997 bytes)
UPDATE libs/search/routing/src/resolvers/search/search.resolver.ts (1844 bytes)
UPDATE libs/customer/routing/src/guards/clear-errors.guard.ts (627 bytes)
UPDATE libs/customer/routing/src/resolvers/customer.resolver.ts (474 bytes)
UPDATE libs/customer-store-credit/routing/src/guards/clear-errors.guard.ts (673 bytes)
UPDATE libs/customer-store-credit/routing/src/resolvers/customer-store-credit.resolver.ts (542 bytes)
UPDATE libs/cart-store-credit/routing/src/guards/clear-errors.guard.ts (653 bytes)
UPDATE libs/customer-payment/routing/src/guards/clear-errors.guard.ts (656 bytes)
UPDATE libs/customer-payment/routing/src/resolvers/customer-payments.resolver.ts (517 bytes)
UPDATE libs/seo/integration-tests/state/provided-canonical-updates.spec.ts (5800 bytes)
  Migration completed (36 files modified).

▸ As of Angular v16, the `moduleId` property of `@Component` is deprecated as it no longer has any effect.
  Migration completed (No changes made).

** Executing migrations of package '@ngrx/store' **

▸ The road to v16.0-beta.
  Migration completed (No changes made).
  • Loading branch information
griest024 committed Jan 25, 2024
1 parent 81bef44 commit e607f8f
Show file tree
Hide file tree
Showing 39 changed files with 5,964 additions and 5,166 deletions.
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@
]
},
"sourceMap": true,
"optimization": false
"optimization": false,
"buildOptimizer": false
},
"configurations": {
"production": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Injectable } from '@angular/core';
import {
Resolve,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import {
Observable,
EMPTY,
Expand All @@ -18,7 +15,7 @@ import { DaffioApiService } from '../services/api.service';
@Injectable({
providedIn: 'root',
})
export class DaffioApiListResolver implements Resolve<DaffioApiReference> {
export class DaffioApiListResolver {

constructor(private apiService: DaffioApiService, private router: Router) { }

Expand Down
9 changes: 2 additions & 7 deletions apps/daffio/src/app/docs/resolvers/docs-resolver.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
RouterStateSnapshot,
Resolve,
Router,
} from '@angular/router';
import { ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import {
Observable,
EMPTY,
Expand All @@ -23,7 +18,7 @@ import { DaffioDocsService } from '../services/docs.service';
@Injectable({
providedIn: 'root',
})
export class DocsResolver<T extends DaffioDoc, V extends DaffioGuideList> implements Resolve<T> {
export class DocsResolver<T extends DaffioDoc, V extends DaffioGuideList> {

constructor(private docService: DaffioDocsService<T, V>, private router: Router) { }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Injectable } from '@angular/core';
import {
Resolve,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import {
Store,
ActionsSubject,
Expand All @@ -27,7 +24,7 @@ import {
@Injectable({
providedIn: 'root',
})
export class CartResolver implements Resolve<Observable<Action>> {
export class CartResolver {
constructor(
private store: Store<DaffCartStateRootSlice>,
private dispatcher: ActionsSubject,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Injectable } from '@angular/core';
import {
Resolve,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import {
ActionsSubject,
Action,
Expand All @@ -25,7 +22,7 @@ import {
@Injectable({
providedIn: 'root',
})
export class EmptyCartResolver implements Resolve<Observable<Action>> {
export class EmptyCartResolver {
constructor(
private router: Router,
private cartResolver: CartResolver,
Expand Down
7 changes: 2 additions & 5 deletions libs/auth/routing/src/guards/guest-only.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Inject,
Injectable,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import {
Observable,
Expand Down Expand Up @@ -35,7 +32,7 @@ import { DaffAuthGuestOnlyGuardRedirectUrl } from './guest-only-guard-redirect.t
@Injectable({
providedIn: 'any',
})
export class GuestOnlyGuard implements CanActivate {
export class GuestOnlyGuard {
constructor(
private tokenCheck: DaffAuthDriverTokenCheck,
private storage: DaffAuthStorageService,
Expand Down
7 changes: 2 additions & 5 deletions libs/auth/routing/src/guards/member-only.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Inject,
Injectable,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import {
Observable,
Expand Down Expand Up @@ -36,7 +33,7 @@ import { DaffAuthMemberOnlyGuardRedirectUrl } from './member-only-guard-redirect
@Injectable({
providedIn: 'any',
})
export class MemberOnlyGuard implements CanActivate {
export class MemberOnlyGuard {
constructor(
private tokenCheck: DaffAuthDriverTokenCheck,
private storage: DaffAuthStorageService,
Expand Down
7 changes: 2 additions & 5 deletions libs/auth/routing/src/guards/reset-password.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Inject,
Injectable,
} from '@angular/core';
import {
ActivatedRouteSnapshot,
CanActivate,
} from '@angular/router';
import { ActivatedRouteSnapshot } from '@angular/router';
import {
Observable,
of,
Expand All @@ -24,7 +21,7 @@ import {
@Injectable({
providedIn: 'any',
})
export class DaffAuthResetPasswordGuard implements CanActivate {
export class DaffAuthResetPasswordGuard {
constructor(
private facade: DaffAuthFacade,
@Inject(DAFF_AUTH_ROUTING_CONFIG) private config: DaffAuthRoutingConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Injectable } from '@angular/core';
import {
CanDeactivate,
UrlTree,
} from '@angular/router';
import { UrlTree } from '@angular/router';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';

Expand All @@ -12,7 +9,7 @@ import { DaffCartStoreCreditClearErrors } from '@daffodil/cart-store-credit/stat
* A guard that will clear cart state errors before allowing route deactivation.
*/
@Injectable({ providedIn: 'root' })
export class DaffCartStoreCreditClearErrorsGuard implements CanDeactivate<unknown> {
export class DaffCartStoreCreditClearErrorsGuard {
constructor(private store: Store<any>) {}

canDeactivate(): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand All @@ -25,7 +22,7 @@ import { DaffCartBillingAddressGuardRedirectUrl } from './billing-address-guard-
@Injectable({
providedIn: 'root',
})
export class DaffBillingAddressGuard implements CanActivate {
export class DaffBillingAddressGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
7 changes: 2 additions & 5 deletions libs/cart/routing/src/guards/cart-items/cart-items.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand All @@ -27,7 +24,7 @@ import { DaffCartItemsGuardRedirectUrl } from './cart-items-guard-redirect.token
@Injectable({
providedIn: 'root',
})
export class DaffCartItemsGuard implements CanActivate {
export class DaffCartItemsGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
ActivatedRouteSnapshot,
CanActivate,
CanActivateChild,
Router,
RouterStateSnapshot,
UrlTree,
} from '@angular/router';
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand All @@ -31,7 +24,7 @@ import { DaffCartInStockItemsGuardRedirectUrl } from './in-stock-items-guard-red
@Injectable({
providedIn: 'root',
})
export class DaffCartInStockItemsGuard implements CanActivate, CanActivateChild {
export class DaffCartInStockItemsGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import {
Observable,
of,
Expand All @@ -23,7 +20,7 @@ import { DaffCartOrderResultGuardRedirectUrl } from './order-result-guard-redire
@Injectable({
providedIn: 'root',
})
export class DaffOrderResultGuard implements CanActivate {
export class DaffOrderResultGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand All @@ -25,7 +22,7 @@ import { DaffCartPaymentMethodGuardRedirectUrl } from './payment-method-guard-re
@Injectable({
providedIn: 'root',
})
export class DaffPaymentMethodGuard implements CanActivate {
export class DaffPaymentMethodGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
UrlTree,
} from '@angular/router';
import { Router, UrlTree } from '@angular/router';
import {
Observable,
iif,
Expand Down Expand Up @@ -60,7 +56,7 @@ const canActivate = (resolved: DaffCartResolveState): boolean => {
@Injectable({
providedIn: 'root',
})
export class DaffResolveCartGuard implements CanActivate {
export class DaffResolveCartGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
UrlTree,
} from '@angular/router';
import { Router, UrlTree } from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand Down Expand Up @@ -35,7 +31,7 @@ import {
@Injectable({
providedIn: 'root',
})
export class DaffResolvedCartGuard implements CanActivate {
export class DaffResolvedCartGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand All @@ -25,7 +22,7 @@ import { DaffCartShippingAddressGuardRedirectUrl } from './shipping-address-guar
@Injectable({
providedIn: 'root',
})
export class DaffShippingAddressGuard implements CanActivate {
export class DaffShippingAddressGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
CanActivate,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand All @@ -25,7 +22,7 @@ import { DaffCartShippingMethodGuardRedirectUrl } from './shipping-method-guard-
@Injectable({
providedIn: 'root',
})
export class DaffShippingMethodGuard implements CanActivate {
export class DaffShippingMethodGuard {
constructor(
private facade: DaffCartFacade,
private router: Router,
Expand Down
7 changes: 2 additions & 5 deletions libs/cart/routing/src/resolvers/cart-resolver.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import {
Injectable,
Inject,
} from '@angular/core';
import {
Resolve,
Router,
} from '@angular/router';
import { Router } from '@angular/router';
import {
Store,
ActionsSubject,
Expand Down Expand Up @@ -34,7 +31,7 @@ import { DaffCartResolverRedirectUrl } from './tokens/cart-resolver-redirect.tok
@Injectable({
providedIn: 'root',
})
export class DaffCartResolver implements Resolve<Observable<DaffCart>> {
export class DaffCartResolver {
constructor(
private store: Store<DaffCartStateRootSlice>,
private dispatcher: ActionsSubject,
Expand Down
Loading

0 comments on commit e607f8f

Please sign in to comment.