Skip to content

Commit 0d85a78

Browse files
committed
feat: add support for Angular 21
1 parent fa62998 commit 0d85a78

File tree

18 files changed

+7225
-33
lines changed

18 files changed

+7225
-33
lines changed

.circleci/src/pipeline/@pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ commands:
121121
name: Set environment variable to determine whether or not to persist artifacts
122122
command: |
123123
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
124-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "fix/angular_dep_resolution_windows" ]]; then
124+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "feat/support_angular_21" ]]; then
125125
export SHOULD_PERSIST_ARTIFACTS=true
126126
fi' >> "$BASH_ENV"
127127
# You must run `setup_should_persist_artifacts` command and be using bash before running this command

.circleci/src/pipeline/workflows/@main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ linux-x64:
44
- equal: [ develop, << pipeline.git.branch >> ]
55
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
66
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
7-
- equal: [ 'fix/angular_dep_resolution_windows', << pipeline.git.branch >> ]
7+
- equal: [ 'feat/support_angular_21', << pipeline.git.branch >> ]
88
- matches:
99
pattern: /^release\/\d+\.\d+\.\d+$/
1010
value: << pipeline.git.branch >>

cli/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ _Released 12/2/2025 (PENDING)_
77

88
- Improved performance when viewing command snapshots in the Command Log. Element highlighting is now significantly faster, especially when highlighting multiple elements or complex pages. This is achieved by reducing redundant style calculations and batching DOM operations to minimize browser reflows. Addressed in [#32951](https://github.com/cypress-io/cypress/pull/32951).
99

10+
**Features:**
11+
12+
- `Angular` version 21 is now supported within component testing. Addressed in [#33004](https://github.com/cypress-io/cypress/pull/33004).
13+
1014
## 15.7.0
1115

1216
_Released 11/19/2025_

npm/cypress-schematic/src/ct.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const copyAngularMount = async (projectPath: string) => {
2424

2525
const cypressSchematicPackagePath = path.join(__dirname, '..')
2626

27-
const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-19', 'angular-20']
27+
const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-20', 'angular-21']
2828

2929
const timeout = 1000 * 60 * 5
3030

npm/cypress-schematic/src/e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const runCommandInProject = (command: string, projectPath: string) => {
2525

2626
const cypressSchematicPackagePath = path.join(__dirname, '..')
2727

28-
const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-19', 'angular-20']
28+
const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-20', 'angular-21']
2929

3030
describe('ng add @cypress/schematic / only e2e', { timeout: 1000 * 60 * 5 }, function () {
3131
for (const project of ANGULAR_PROJECTS) {

npm/webpack-dev-server/cypress/e2e/angular.cy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const WEBPACK_ANGULAR: ProjectFixtureDir[] = [
66
'angular-18',
77
'angular-19',
88
'angular-20',
9+
'angular-21',
910
]
1011

1112
// Add to this list to focus on a particular permutation

npm/webpack-dev-server/test/handlers/angularHandler.spec.ts

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
import { scaffoldMigrationProject } from '../test-helpers/scaffoldProject'
1818

1919
describe('angularHandler', { timeout: 60000 }, function () {
20-
it('sources the config from angular-19', async () => {
21-
const projectRoot = await scaffoldMigrationProject('angular-19')
20+
it('sources the config from angular-20', async () => {
21+
const projectRoot = await scaffoldMigrationProject('angular-20')
2222

2323
process.chdir(projectRoot)
2424
const devServerConfig = {
@@ -33,39 +33,34 @@ describe('angularHandler', { timeout: 60000 }, function () {
3333
expect(webpackConfig).toBeDefined()
3434
expect((webpackConfig?.entry as any).main).toBeUndefined()
3535
expect(sourceWebpackModulesResult.framework?.importPath).toContain(path.join('@angular-devkit', 'build-angular'))
36-
expect(webpackConfig.stats).toEqual('errors-only')
3736
const projectConfig = await getProjectConfig(projectRoot)
3837

3938
expect(projectConfig).toEqual({
4039
root: '',
4140
sourceRoot: 'src',
4241
buildOptions: {
43-
outputPath: 'dist/angular',
44-
index: 'src/index.html',
45-
main: 'src/main.ts',
46-
polyfills: 'src/polyfills.ts',
42+
browser: 'src/main.ts',
43+
// because of the way the main fixtures are configured in the system-test projects, we need to run as a zone.js application
44+
polyfills: [
45+
'zone.js',
46+
],
4747
tsConfig: 'tsconfig.app.json',
48-
inlineStyleLanguage: 'scss',
4948
assets: ['src/favicon.ico', 'src/assets'],
5049
styles: ['src/styles.scss'],
51-
scripts: [],
52-
buildOptimizer: false,
5350
optimization: false,
54-
vendorChunk: true,
5551
extractLicenses: false,
5652
sourceMap: true,
57-
namedChunks: true,
5853
},
5954
})
6055

6156
await expectLoadsAngularJson(projectRoot)
6257
await expectLoadsAngularCLiModules(projectRoot)
63-
await expectGeneratesTsConfig(devServerConfig, projectConfig.buildOptions, true)
58+
await expectGeneratesTsConfig(devServerConfig, projectConfig.buildOptions, false)
6459
expectLoadsAngularBuildOptions(projectConfig.buildOptions)
6560
})
6661

67-
it('sources the config from angular-20', async () => {
68-
const projectRoot = await scaffoldMigrationProject('angular-20')
62+
it('sources the config from angular-21', async () => {
63+
const projectRoot = await scaffoldMigrationProject('angular-21')
6964

7065
process.chdir(projectRoot)
7166
const devServerConfig = {
@@ -87,10 +82,6 @@ describe('angularHandler', { timeout: 60000 }, function () {
8782
sourceRoot: 'src',
8883
buildOptions: {
8984
browser: 'src/main.ts',
90-
// because of the way the main fixtures are configured in the system-test projects, we need to run as a zone.js application
91-
polyfills: [
92-
'zone.js',
93-
],
9485
tsConfig: 'tsconfig.app.json',
9586
assets: ['src/favicon.ico', 'src/assets'],
9687
styles: ['src/styles.scss'],

packages/app/cypress/e2e/runner/reporter-ct-mount-hover.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { fixtureDirs } from '@tooling/system-tests'
33
type ProjectDirs = typeof fixtureDirs
44

55
const PROJECTS: {projectName: ProjectDirs[number], test: string}[] = [
6-
{ projectName: 'angular-20', test: 'app.component' },
6+
{ projectName: 'angular-21', test: 'app.component' },
77
{ projectName: 'react-vite-ts-configured', test: 'App.cy' },
88
{ projectName: 'react18', test: 'App.cy' },
99
{ projectName: 'next-14', test: 'index.cy' },

packages/scaffold-config/src/dependencies.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const WIZARD_DEPENDENCY_ANGULAR_CLI = {
7070
package: '@angular/cli',
7171
installer: '@angular/cli',
7272
description: 'CLI tool that you use to initialize, develop, scaffold, and maintain Angular applications.',
73-
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0',
73+
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0',
7474
} as const
7575

7676
export const WIZARD_DEPENDENCY_ANGULAR_DEVKIT_BUILD_ANGULAR = {
@@ -79,7 +79,7 @@ export const WIZARD_DEPENDENCY_ANGULAR_DEVKIT_BUILD_ANGULAR = {
7979
package: '@angular-devkit/build-angular',
8080
installer: '@angular-devkit/build-angular',
8181
description: 'Angular Webpack build facade',
82-
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0',
82+
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0',
8383
} as const
8484

8585
export const WIZARD_DEPENDENCY_ANGULAR_CORE = {
@@ -88,7 +88,7 @@ export const WIZARD_DEPENDENCY_ANGULAR_CORE = {
8888
package: '@angular/core',
8989
installer: '@angular/core',
9090
description: 'The core of the Angular framework',
91-
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0',
91+
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0',
9292
} as const
9393

9494
export const WIZARD_DEPENDENCY_ANGULAR_COMMON = {
@@ -97,7 +97,7 @@ export const WIZARD_DEPENDENCY_ANGULAR_COMMON = {
9797
package: '@angular/common',
9898
installer: '@angular/common',
9999
description: 'Commonly needed Angular directives and services',
100-
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0',
100+
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0',
101101
} as const
102102

103103
export const WIZARD_DEPENDENCY_ANGULAR_PLATFORM_BROWSER_DYNAMIC = {
@@ -106,7 +106,7 @@ export const WIZARD_DEPENDENCY_ANGULAR_PLATFORM_BROWSER_DYNAMIC = {
106106
package: '@angular/platform-browser-dynamic',
107107
installer: '@angular/platform-browser-dynamic',
108108
description: 'Library for using Angular in a web browser with JIT compilation',
109-
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0',
109+
minVersion: '^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0',
110110
} as const
111111

112112
export const WIZARD_DEPENDENCY_SVELTE: Cypress.CypressComponentDependency = {

packages/scaffold-config/test/detect.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('detectFramework', () => {
8585
})
8686
})
8787

88-
;['18.2.0', '19.2.9'].forEach((v) => {
88+
;['20.1.0', '21.0.0'].forEach((v) => {
8989
it(`Angular CLI v${v}`, async () => {
9090
const projectPath = await scaffoldMigrationProject('angular-cli-unconfigured')
9191

0 commit comments

Comments
 (0)