Skip to content

chore(angular): upgrade test apps to latest #30517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/angular/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Ionic Framework supports multiple versions of Angular. As a result, we need to v

## Syncing Local Changes

The Angular test app supports syncing your locally built changes for validation.
The Angular test app supports syncing your locally built changes for validation. This allows you to test local changes like `core` without having to publish a new version of the package.

1. Build the `core` directory.
2. Navigate to `packages/angular` and run `npm run sync`.
Expand All @@ -16,6 +16,12 @@ The Angular test app supports syncing your locally built changes for validation.

From here you can either build the application or start a local dev server. When re-syncing changes, you will need to [wipe or disable the application cache](#application-cache).

> [!NOTE]
> Syncing is required to verify that the minimal supported Angular version is still compatible with the latest Ionic Framework changes.
> For example, Ionic Framework 8 supports Angular 16, but the latest version of Ionic Framework may not be compatible with Angular 16. Syncing allows you to verify that the latest changes are still compatible with the minimal supported version.
>
> Support for the minimal version and maximum version can be found on the [Support page](https://ionicframework.com/docs/reference/support#ionic-angular) of the Ionic Framework documentation.
## Application Cache

Angular CLI creates a cache of several files on disk by default in the `.angular` directory. This decreases the time taken to build the test application. However, the cache makes it difficult to quickly sync and check local changes of Ionic. As a result, the `.angular` cache is disabled by default in the test app projects.
Expand Down
Copy link
Contributor Author

@thetaPC thetaPC Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this was considered a rename when I manually deleted the file from ng19 and added a new file within ng16. The same applies for the other renames.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git doesn't have a way to identify when a file was deleted or renamed, so if a file is removed and another one is added and they're similar enough it just considers it a rename. If a file just disappears then it considers it deleted. Sometimes it has false positives like this haha

Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"buildTarget": "test-app:build"
"browserTarget": "test-app:build"
},
"configurations": {
"production": {
"buildTarget": "test-app:build:production"
"browserTarget": "test-app:build:production"
},
"development": {
"buildTarget": "test-app:build:development"
"browserTarget": "test-app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "test-app:build"
"browserTarget": "test-app:build"
}
},
"lint": {
Expand Down Expand Up @@ -124,7 +124,7 @@
}
},
"serve-ssr": {
"builder": "@angular-devkit/build-angular:ssr-dev-server",
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "test-app:build",
"serverTarget": "test-app:server"
Expand All @@ -137,7 +137,7 @@
}
},
"prerender": {
"builder": "@angular-devkit/build-angular:prerender",
"builder": "@nguniversal/builders:prerender",
"options": {
"browserTarget": "test-app:build:production",
"serverTarget": "test-app:server:production",
Expand Down
20 changes: 20 additions & 0 deletions packages/angular/test/apps/ng16/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictMetadataEmit" : true
},
"extends": "../tsconfig.json",
"include": [
"src/**spec.ts",
"../cypress/support/index.d.ts"
],
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"cypress",
"node"
]
}
}
10 changes: 0 additions & 10 deletions packages/angular/test/apps/ng16/src/app/app-routing.module.ts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ import { enableProdMode } from '@angular/core';

import { environment } from './environments/environment';

import { AppServerModule } from './app/app.server.module';

if (environment.production) {
enableProdMode();
}

export { AppServerModule } from './app/app.server.module';
export { renderModule } from '@angular/platform-server';

// Add a default export
export default AppServerModule;
export { renderModule, renderModuleFactory } from '@angular/platform-server';
12 changes: 12 additions & 0 deletions packages/angular/test/apps/ng16/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app"
},
"files": [
"src/main.ts",
"src/polyfills.ts",
"src/zone-flags.ts"
],
"include": ["src/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.app.json",
"compilerOptions": {
"outDir": "./out-tsc/app-server",
"target": "ES2016",
"module": "commonjs",
"types": ["node"]
"target": "es2016",
"types": [
"node"
]
},
"files": [
"src/main.server.ts",
"src/server.ts"
],
"include": [
"src/**/*.d.ts"
"server.ts"
],
"angularCompilerOptions": {
"entryModule": "./src/app/app.server.module#AppServerModule"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"module": "commonjs",
"types": ["jasmine", "node"]
"types": [
"node"
]
},
"files": [
"src/test.ts",
"src/zone-flags.ts",
"src/polyfills.ts"
],
"include": [
Expand Down
Empty file.
20 changes: 20 additions & 0 deletions packages/angular/test/apps/ng17/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictMetadataEmit" : true
},
"extends": "../tsconfig.json",
"include": [
"src/**spec.ts",
"../cypress/support/index.d.ts"
],
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"cypress",
"node"
]
}
}
10 changes: 0 additions & 10 deletions packages/angular/test/apps/ng17/src/app/app-routing.module.ts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ import { enableProdMode } from '@angular/core';

import { environment } from './environments/environment';

import { AppServerModule } from './app/app.server.module';

if (environment.production) {
enableProdMode();
}

export { AppServerModule } from './app/app.server.module';
export { renderModule } from '@angular/platform-server';

// Add a default export
export default AppServerModule;
export { renderModule, renderModuleFactory } from '@angular/platform-server';
12 changes: 12 additions & 0 deletions packages/angular/test/apps/ng17/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app"
},
"files": [
"src/main.ts",
"src/polyfills.ts",
"src/zone-flags.ts"
],
"include": ["src/**/*.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.app.json",
"compilerOptions": {
"outDir": "./out-tsc/app-server",
"target": "ES2016",
"module": "commonjs",
"types": ["node"]
"target": "es2016",
"types": [
"node"
]
},
"files": [
"src/main.server.ts",
"src/server.ts"
],
"include": [
"src/**/*.d.ts"
"server.ts"
],
"angularCompilerOptions": {
"entryModule": "./src/app/app.server.module#AppServerModule"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"module": "commonjs",
"types": ["jasmine", "node"]
"types": [
"node"
]
},
"files": [
"src/test.ts",
"src/zone-flags.ts",
"src/polyfills.ts"
],
"include": [
Expand Down
Empty file.
20 changes: 20 additions & 0 deletions packages/angular/test/apps/ng18/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictMetadataEmit" : true
},
"extends": "../tsconfig.json",
"include": [
"src/**spec.ts",
"../cypress/support/index.d.ts"
],
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"cypress",
"node"
]
}
}
10 changes: 0 additions & 10 deletions packages/angular/test/apps/ng18/src/app/app-routing.module.ts

This file was deleted.

This file was deleted.

10 changes: 10 additions & 0 deletions packages/angular/test/apps/ng18/src/main.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { enableProdMode } from '@angular/core';

import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

export { AppServerModule } from './app/app.server.module';
export { renderModule, renderModuleFactory } from '@angular/platform-server';
Loading
Loading