Skip to content
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

Upgrade to Angular 19 #19772

Merged
merged 44 commits into from
Jan 23, 2025
Merged

Upgrade to Angular 19 #19772

merged 44 commits into from
Jan 23, 2025

Conversation

pawelfras
Copy link
Contributor

@pawelfras pawelfras commented Dec 12, 2024

QA (done by author)

  • migration from SPA 6.x with SSR (Angular 15)
  • migration from the latest SPA 2211.x (Angular 17)
  • migration from the latest SPA 2211.x with SSR (Angular 17)
  • installation of SPA in fresh Angular 19 app
  • installation of SPA with SSR in fresh Angular 19 app

QA (done by reviewer)

  • migration from SPA 6.x with SSR (Angular 15)
  • migration from the latest SPA 2211.x (Angular 17)
  • migration from the SPA 2211.x with SSR (Angular 17)
  • installation of SPA in fresh Angular 19 app
  • installation of SPA with SSR in fresh Angular 19 app

@pawelfras pawelfras requested review from a team as code owners December 12, 2024 10:13
@github-actions github-actions bot marked this pull request as draft December 12, 2024 10:13
- ran `npx nx migrate latest` (bump most of libraries to the latest version) and `npx nx migrate --run-migration` (run packages' migration, all except angular's migration from initializer tokens to helper functions)
- bump '@angular/animations' to version '^19.0.3'
- bump '@angular/common' to version '^19.0.3'
- bump '@angular/compiler' to version '^19.0.3'
- bump '@angular/core' to version '^19.0.3'
- bump '@angular/forms' to version '^19.0.3'
- bump '@angular/platform-browser' to version '^19.0.3'
- bump '@angular/platform-browser-dynamic' to version '^19.0.3'
- bump '@angular/platform-server' to version '^19.0.3'
- bump '@angular/pwa' to version '^19.0.4'
- bump '@angular/router' to version '^19.0.3'
- bump '@angular/service-worker' to version '^19.0.3'
- bump '@angular/ssr' to version '^19.0.4'
- bump '@ng-select/ng-select' to version '^14.1.0'
- bump 'angular-oauth2-oidc' to version '19.0.0'
- bump 'ngx-infinite-scroll' to version '^19.0.0'
- bump 'zone.js' to version '0.15.0'
- bump '@angular-devkit/build-angular' to version '^19.0.4'
- bump '@angular-devkit/core' to version '^19.0.4'
- bump '@angular-devkit/schematics' to version '^19.0.4'
- bump '@angular-eslint/builder' to version '19.0.2'
- bump '@angular-eslint/eslint-plugin' to version '^19.0.2'
- bump '@angular-eslint/eslint-plugin-template' to version '^19.0.2'
- bump '@angular-eslint/schematics' to version '^19.0.2'
- bump '@angular-eslint/template-parser' to version '^19.0.2'
- bump '@angular-eslint/test-utils' to version '^19.0.2'
- bump '@angular-eslint/utils' to version '^19.0.2'
- bump '@angular/cli' to version '^19.0.4'
- bump '@angular/compiler-cli' to version '^19.0.3'
- bump '@angular/language-service' to version '^19.0.3'
- bump '@nx/angular' to version '^20.2.2'
- bump '@nx/devkit' to version '^20.2.2'
- bump '@nx/eslint-plugin' to version '^20.2.2'
- bump '@nx/jest' to version '^20.2.2'
- bump '@nx/workspace' to version '^20.2.2'
- bump '@schematics/angular' to version '^19.0.4'
- bump 'jest-preset-angular' to version '14.4.2'
- bump 'ng-packagr' to version '^19.0.1'
- bump 'nx' to version '^20.2.2'
- bump 'typescript' to version '^5.6.3'
- add `standalone: false` to all components, directives and pipes
  for more, see: angular/angular#57643
- add rule `"@angular-eslint/prefer-standalone": "off"` in eslint files
- remove deprecated `"angular-eslint/no-host-metadata-property"`
  for more, see: angular-eslint/angular-eslint#2113
- update '@angular/ssr' import paths to use the new '/node' entry point when 'CommonEngine' is detected
  for more, see: angular/angular-cli#28278
- change range specifier for typescript library to meet Angular's requirement (>=5.5.0 and <5.7.0)
- fix building libs and CSR by solvig type errors provided with TS 5.6
- this update is required for SSR to work, because previous version use Angualr 18 API which is no longer part of @angular/core in v19.
  for more, see: angular/angular#58891
- fix type issues
- use `takeUntil` with destroy subject in `trending-searches.service.ts` as a more reliable cleanup method to properly handle cleanup
- remove redundant 'declatartion: true' from 'tsconfig.schematics.json' files,
  that caused issues in unit tests due to type errors in '@schematics/angular' library
  'Buffer is not a generic type'. The issue appeared because '*.d.ts' files are taken into consideration when running tests, maybe unnecessary
  for more, see: https://github.com/angular/angular-cli/blob/4db4dd4315fd8c31872bbf1e82e3414eea15ffef/goldens/public-api/angular_devkit/schematics/index.api.md\?plain\=1\#L498
- update snapshots with new budget thresholds
  for more, see: angular/angular-cli#28255
- update snapshots with new packages versions
- update schematics and related tests with the new `server.ts` location
  for more, see: angular/angular-cli#28571
- adjust positions in utils tests to reflect the `standalone: false` in component decorators
- adjust SSR schematics to remove `withEventReplay()` that Angular installs by default
  for more, see:
- refactor tests for 2211.19 SSR migration to make them independent of Angular's schematics
  for more, see: angular/angular-cli#28469
- move `@angular-eslint/prefer-standalone` to global eslint rules
- add missing `OnDestroy` implementation in cds library
- remove `@angular-eslint/no-host-metadata-property` from the config as it is no longer part of the package
 for more, see: angular-eslint/angular-eslint#2113
- add missing comma to all files where 'standalone: false' was added
- upgrade to version that supports TS >= 5.6.3
- add `@typescript-eslint/rule-tester` which was missing peer dependency of `@angular-eslint/test-utils`
- adjust import-utils.ts to meet new typing
@pawelfras pawelfras marked this pull request as ready for review January 22, 2025 11:09
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft January 22, 2025 11:53
Platonn
Platonn previously approved these changes Jan 22, 2025
@pawelfras pawelfras marked this pull request as ready for review January 22, 2025 14:02
…ew apps via our installation schematics (#19878)

fixes https://jira.tools.sap/browse/CXSPA-9272

**QA steps:**
1. on this branch `npm run build:libs`
2. on this branch publish the built libs to verdaccio (e.g. via `npx ts-node schematics/testing.ts`)
4. in a separate folder create a fresh ng19 app `npx @angular/cli@19 new test-app --standalone=false`
5. enter the subfolder of the test-app and there install spartacus (with libs from verdaccio) `ng add @spartacus/[email protected]`
6. run the app `npm run start` and wait for the successful build
7. verify that the build output in the terminald doensn't contain warnings about Sass `@import` usage

BEFORE:
![image](https://github.com/user-attachments/assets/e456ce4e-05c8-404e-9670-c4178c09ef2f)

AFTER:
![image](https://github.com/user-attachments/assets/abd6fd77-2c35-4c8a-940a-39aafb54fc14)
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft January 22, 2025 14:10
@pawelfras pawelfras marked this pull request as ready for review January 22, 2025 14:16
Platonn
Platonn previously approved these changes Jan 22, 2025
- use 'develop' branch
- add comment to switch to Angular 19 when PR with Angualr 19 is ready
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft January 22, 2025 14:35
@pawelfras pawelfras marked this pull request as ready for review January 22, 2025 14:49
@github-actions github-actions bot marked this pull request as draft January 22, 2025 15:25
@pawelfras pawelfras marked this pull request as ready for review January 22, 2025 15:30
@pawelfras pawelfras merged commit 53674c5 into develop Jan 23, 2025
32 checks passed
@pawelfras pawelfras deleted the epic/upgrade-to-angular-19 branch January 23, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants