Skip to content

Commit 5577d38

Browse files
liamdebeasibrandyscarneythetaPCaveryjohnston
authored
refactor(angular): remove angular 14 and 15 dependencies (#29169)
Issue number: Internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> With Ionic 8 we are dropping Angular 14 and 15 support. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - This PR officially drops Angular 14 and 15 support. Note: The work to do this was done a while ago, but this branch was never merged into `feature-8.0`. The breaking change was already noted in the breaking change guide, so this is not an additional breaking change on top of what was already specified. ## Does this introduce a breaking change? - [x] Yes - [ ] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: Brandy Carney <[email protected]> Co-authored-by: Maria Hutt <[email protected]> Co-authored-by: Amanda Johnston <[email protected]>
1 parent 56014cf commit 5577d38

File tree

27 files changed

+7338
-63556
lines changed

27 files changed

+7338
-63556
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
strategy:
141141
fail-fast: false
142142
matrix:
143-
apps: [ng14, ng15, ng16, ng17]
143+
apps: [ng16, ng17]
144144
needs: [build-angular, build-angular-server]
145145
runs-on: ubuntu-latest
146146
steps:

packages/angular-server/package-lock.json

Lines changed: 2433 additions & 2924 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/angular-server/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,30 @@
3535
"prettier.fix": "prettier \"**/*.ts\" --write"
3636
},
3737
"peerDependencies": {
38-
"@angular/core": ">=14.0.0",
39-
"@angular/platform-server": ">=14.0.0",
38+
"@angular/core": ">=16.0.0",
39+
"@angular/platform-server": ">=16.0.0",
4040
"rxjs": ">=7.5.0",
41-
"zone.js": ">=0.11.0"
41+
"zone.js": ">=0.13.0"
4242
},
4343
"devDependencies": {
44-
"@angular-eslint/eslint-plugin": "^14.0.0",
45-
"@angular/animations": "^14.0.0",
46-
"@angular/common": "^14.0.0",
47-
"@angular/compiler": "^14.0.0",
48-
"@angular/compiler-cli": "^14.0.0",
49-
"@angular/core": "^14.0.0",
50-
"@angular/platform-browser": "^14.0.0",
51-
"@angular/platform-browser-dynamic": "^14.0.0",
52-
"@angular/platform-server": "^14.0.0",
44+
"@angular-eslint/eslint-plugin": "^16.0.0",
45+
"@angular/animations": "^16.0.0",
46+
"@angular/common": "^16.0.0",
47+
"@angular/compiler": "^16.0.0",
48+
"@angular/compiler-cli": "^16.0.0",
49+
"@angular/core": "^16.0.0",
50+
"@angular/platform-browser": "^16.0.0",
51+
"@angular/platform-browser-dynamic": "^16.0.0",
52+
"@angular/platform-server": "^16.0.0",
5353
"@ionic/eslint-config": "^0.3.0",
5454
"@ionic/prettier-config": "^2.0.0",
5555
"@typescript-eslint/eslint-plugin": "^5.2.0",
5656
"eslint": "^7.32.0",
5757
"eslint-plugin-import": "^2.25.2",
58-
"ng-packagr": "^14.0.0",
58+
"ng-packagr": "^16.0.0",
5959
"prettier": "^2.4.1",
6060
"rxjs": "^7.8.0",
61-
"typescript": "~4.7.2"
61+
"typescript": "~4.9.3"
6262
},
6363
"prettier": "@ionic/prettier-config",
6464
"dependencies": {

packages/angular/common/src/directives/navigation/back-button.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { HostListener, Input, Optional, ElementRef, NgZone, ChangeDetectorRef, Directive } from '@angular/core';
1+
import { HostListener, Optional, ElementRef, NgZone, ChangeDetectorRef, Directive } from '@angular/core';
22
import type { Components } from '@ionic/core';
3-
import type { AnimationBuilder } from '@ionic/core/components';
43

54
import { Config } from '../../providers/config';
65
import { NavController } from '../../providers/nav-controller';
@@ -22,12 +21,6 @@ export declare interface IonBackButton extends Components.IonBackButton {}
2221
})
2322
// eslint-disable-next-line @angular-eslint/directive-class-suffix
2423
export class IonBackButton {
25-
@Input()
26-
defaultHref: string | undefined;
27-
28-
@Input()
29-
routerAnimation: AnimationBuilder | undefined;
30-
3124
protected el: HTMLElement;
3225

3326
constructor(

packages/angular/common/src/directives/navigation/router-outlet.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ import { RouteView, StackDidChangeEvent, StackWillChangeEvent, getUrl, isTabSwit
4242
inputs: ['animated', 'animation', 'mode', 'swipeGesture'],
4343
})
4444
// eslint-disable-next-line @angular-eslint/directive-class-suffix
45-
export class IonRouterOutlet implements OnDestroy, OnInit {
45+
export abstract class IonRouterOutlet implements OnDestroy, OnInit {
46+
abstract outletContent: any;
47+
4648
nativeEl: HTMLIonRouterOutletElement;
4749
activatedView: RouteView | null = null;
4850
tabsPrefix: string | undefined;
@@ -116,7 +118,6 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
116118
router: Router,
117119
zone: NgZone,
118120
activatedRoute: ActivatedRoute,
119-
protected outletContent: ViewContainerRef,
120121
@SkipSelf() @Optional() readonly parentOutlet?: IonRouterOutlet
121122
) {
122123
this.nativeEl = elementRef.nativeElement;
@@ -296,7 +297,13 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
296297

297298
// Calling `markForCheck` to make sure we will run the change detection when the
298299
// `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.
299-
enteringView = this.stackCtrl.createView(this.activated, activatedRoute);
300+
301+
/**
302+
* At this point this.activated has been set earlier
303+
* in this function, so it is guaranteed to be non-null.
304+
*/
305+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
306+
enteringView = this.stackCtrl.createView(this.activated!, activatedRoute);
300307

301308
// Store references to the proxy by component
302309
this.proxyMap.set(cmpRef.instance, activatedRouteProxy);

packages/angular/common/src/directives/navigation/tabs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import { StackDidChangeEvent, StackWillChangeEvent } from './stack-utils';
1717
selector: 'ion-tabs',
1818
})
1919
// eslint-disable-next-line @angular-eslint/directive-class-suffix
20-
export class IonTabs implements AfterContentInit, AfterContentChecked {
20+
export abstract class IonTabs implements AfterContentInit, AfterContentChecked {
2121
/**
2222
* Note: These must be redeclared on each child class since it needs
2323
* access to generated components such as IonRouterOutlet and IonTabBar.
2424
*/
25-
outlet: any;
26-
tabBar: any;
27-
tabBars: any;
25+
abstract outlet: any;
26+
abstract tabBar: any;
27+
abstract tabBars: any;
2828

2929
@ViewChild('tabsInner', { read: ElementRef, static: true }) tabsInner: ElementRef<HTMLDivElement>;
3030

0 commit comments

Comments
 (0)