Skip to content

chore: upgrade Angular and related dependencies to version 15#1159

Open
TwoDCube wants to merge 4 commits into
masterfrom
zoltanszepesi/upgrade-15
Open

chore: upgrade Angular and related dependencies to version 15#1159
TwoDCube wants to merge 4 commits into
masterfrom
zoltanszepesi/upgrade-15

Conversation

@TwoDCube
Copy link
Copy Markdown
Member

@TwoDCube TwoDCube commented Jan 1, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Angular framework and related dependencies from version 14 to version 15. The upgrade includes necessary code changes to handle breaking changes in Angular 15, removal of deprecated features, and migration to updated APIs.

  • Upgraded all Angular core packages from 14.2.x to 15.2.x
  • Updated related dependencies including NgRx, Nx, and Apollo Angular to their Angular 15-compatible versions
  • Removed HMR (Hot Module Replacement) support which is deprecated in Angular 15
  • Updated Apollo Angular to version 4 with migration from deprecated updateQuery API to manual cache updates

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
package.json Updated Angular and related dependencies from version 14 to 15, including NgRx, Nx, TypeScript, and various dev dependencies
nx.json Migrated from deprecated implicitDependencies to new namedInputs configuration structure for Nx
libs/ui/src/lib/loaders/loaders.component.scss Removed tilde prefix from import path (no longer needed in Angular 15)
apps/frontend/src/polyfills.ts Updated zone.js import path to simplified version without /dist/zone
apps/frontend/src/main.ts Removed HMR bootstrap logic and simplified to standard Angular bootstrap
apps/frontend/src/hmr.ts Deleted HMR configuration file (no longer needed)
apps/frontend/src/app/modules/home/services/request.service.ts Migrated Apollo Angular from deprecated updateQuery to manual cache updates using writeQuery
apps/frontend/src/app/app.module.ts Added explicit ApolloModule import and removed deprecated NxModule
angular.json Added Angular ESLint schematics configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment on lines +57 to +61
"@ngx-loading-bar/core": "6",
"@ngx-loading-bar/http-client": "6",
"@ngx-loading-bar/router": "6",
"@nrwl/angular": "15.9.7",
"apollo-angular": "4",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The version specification "6" is missing minor and patch versions (e.g., "6.0.0" or "6.1.2"). While npm can handle this, it's better practice to specify the full semantic version for consistency with other dependencies in the project, or use a range specifier like "^6.0.0" if you want to allow updates within the major version.

Suggested change
"@ngx-loading-bar/core": "6",
"@ngx-loading-bar/http-client": "6",
"@ngx-loading-bar/router": "6",
"@nrwl/angular": "15.9.7",
"apollo-angular": "4",
"@ngx-loading-bar/core": "^6.0.0",
"@ngx-loading-bar/http-client": "^6.0.0",
"@ngx-loading-bar/router": "^6.0.0",
"@nrwl/angular": "15.9.7",
"apollo-angular": "^4.0.0",

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"@ngx-loading-bar/http-client": "6",
"@ngx-loading-bar/router": "6",
"@nrwl/angular": "15.9.7",
"apollo-angular": "4",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The version specification "4" is missing minor and patch versions (e.g., "4.0.0" or "4.1.0"). While npm can handle this, it's better practice to specify the full semantic version for consistency with other dependencies in the project, or use a range specifier like "^4.0.0" if you want to allow updates within the major version.

Suggested change
"apollo-angular": "4",
"apollo-angular": "^4.0.0",

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"@nrwl/cli": "14.8.9",
"@nrwl/workspace": "14.8.9",
"@schematics/angular": "14.2.9",
"@angular-builders/custom-webpack": "15",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The version specification "15" is missing minor and patch versions (e.g., "15.0.0" or "15.1.0"). While npm can handle this, it's better practice to specify the full semantic version for consistency with other dependencies in the project, or use a range specifier like "^15.0.0" if you want to allow updates within the major version.

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"@types/node": "16.10.2",
"@typescript-eslint/eslint-plugin": "5.3.0",
"@typescript-eslint/parser": "5.3.0",
"@types/node": "18",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The version specification "18" is missing minor and patch versions (e.g., "18.0.0" or "18.16.0"). While npm can handle this, it's better practice to specify the full semantic version for consistency with other dependencies in the project, or use a range specifier like "^18.0.0" if you want to allow updates within the major version.

Suggested change
"@types/node": "18",
"@types/node": "^18.0.0",

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"loaders.css": "0.1.2",
"ng-in-viewport": "13.0.1",
"nx": "14.8.9",
"ng-in-viewport": "15",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The version specification "15" is missing minor and patch versions (e.g., "15.0.0" or "15.1.0"). While npm can handle this, it's better practice to specify the full semantic version for consistency with other dependencies in the project, or use a range specifier like "^15.0.0" if you want to allow updates within the major version.

Suggested change
"ng-in-viewport": "15",
"ng-in-viewport": "^15.0.0",

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
Comment on lines +81 to +82
"@angular-devkit/core": "14.2.12",
"@angular-devkit/schematics": "14.2.12",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

These packages are still on version 14.2.12 while the rest of the Angular dependencies have been upgraded to version 15. The @angular-devkit/core and @angular-devkit/schematics packages should be upgraded to match the other Angular 15 packages (version 15.2.x) to maintain consistency and avoid potential compatibility issues.

Suggested change
"@angular-devkit/core": "14.2.12",
"@angular-devkit/schematics": "14.2.12",
"@angular-devkit/core": "15.2.11",
"@angular-devkit/schematics": "15.2.11",

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"@angular/service-worker": "15.2.10",
"@apollo/client": "3.5.7",
"@fortawesome/angular-fontawesome": "0.11.0",
"@fortawesome/angular-fontawesome": "0.12",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The version specification "0.12" is missing a patch version (e.g., "0.12.0" or "0.12.1"). While npm can handle this, it's better practice to specify the full semantic version for consistency with other dependencies in the project, or use a range specifier like "^0.12.0" if you want to allow patch updates.

Suggested change
"@fortawesome/angular-fontawesome": "0.12",
"@fortawesome/angular-fontawesome": "0.12.0",

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +99 to +112
this.gql.client.cache.writeQuery({
query: QUERY,
variables: {
featured: false,
last: 20,
},
data: {
posts: {
__typename: 'PostConnection',
edges: [...prev.posts.edges, ...result.data.posts.edges],
pageInfo: result.data.posts.pageInfo,
},
},
})
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The manual cache update in the fetchMore implementation uses hardcoded variables that may not match the current query state. The query was initialized with last: 20 and featured: false, but after calling fetchMore, the cache is being written with these same hardcoded values rather than preserving the actual query variables. This could lead to cache inconsistencies if the query variables are different. Consider using the original query's variables or ensuring the cache write matches the actual query state.

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
@@ -75,35 +75,37 @@
"zone.js": "0.11.4"
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The zone.js version remains at 0.11.4, which is the version for Angular 14. Angular 15 requires zone.js version 0.12.x or later. This should be upgraded to ensure compatibility with Angular 15.

Suggested change
"zone.js": "0.11.4"
"zone.js": "0.12.0"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

variables: {
last: 20,
before: this.pageInfo.endCursor
before: this.pageInfo.endCursor,
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The fetchMore method accesses this.pageInfo.endCursor without checking if this.pageInfo is defined. If fetchMore is called before the initial subscription in the constructor completes, this will throw a runtime error. Consider adding a null check or ensuring pageInfo is initialized before allowing fetchMore to be called.

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"@angular-eslint/eslint-plugin-template": "15.2.1",
"@angular-eslint/schematics": "15.2.1",
"@angular-eslint/template-parser": "15.2.1",
"@angular/cli": "~15.2.0",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The @angular/cli version is set to "~15.2.0" while related @Angular-devkit packages are at "15.2.11". For better consistency and to avoid potential compatibility issues, consider updating @angular/cli to "~15.2.11" to match the devkit packages version.

Suggested change
"@angular/cli": "~15.2.0",
"@angular/cli": "~15.2.11",

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"@typescript-eslint/parser": "^5.43.0",
"ajv-formats": "2.1.1",
"autoprefixer": "10.3.7",
"caniuse-lite": "^1.0.30001762",
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The caniuse-lite version "^1.0.30001762" appears unusual. The caniuse-lite package typically uses versions like "1.0.30001XXX" without the caret (^) prefix for such a specific version number. The caret prefix would allow updates to any 1.x version, which might not be the intended behavior. Consider using the exact version without the caret if you want to lock to a specific version, or verify this version exists.

Suggested change
"caniuse-lite": "^1.0.30001762",
"caniuse-lite": "1.0.30001762",

Copilot uses AI. Check for mistakes.
@TwoDCube
Copy link
Copy Markdown
Member Author

TwoDCube commented Jan 1, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown

Copilot AI commented Jan 1, 2026

@TwoDCube I've opened a new pull request, #1160, to work on those changes. Once the pull request is ready, I'll request review from you.

- Update @angular/cli from ~15.2.0 to ~15.2.11
- Remove caret from caniuse-lite version for deterministic builds
- Add null check for pageInfo in fetchMore method
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +103 to +116
this.gql.client.cache.writeQuery({
query: QUERY,
variables: {
featured: false,
last: 20,
},
data: {
posts: {
__typename: 'PostConnection',
edges: [...prev.posts.edges, ...result.data.posts.edges],
pageInfo: result.data.posts.pageInfo,
},
},
})
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The cache update in fetchMore uses hardcoded variables (featured: false, last: 20) that may not match the actual query variables. If the query was initiated with different variables, this cache write could create inconsistencies. Consider extracting the original query variables and reusing them, or use the listQuery.options.variables property to ensure consistency between the query and cache write operations.

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +116
if (result.data) {
this.pageInfo = result.data.posts.pageInfo
this.pageInfo$.next(this.pageInfo)

// Update cache with merged results
const prev = this.listQuery.getCurrentResult().data
if (prev) {
this.gql.client.cache.writeQuery({
query: QUERY,
variables: {
featured: false,
last: 20,
},
data: {
posts: {
__typename: 'PostConnection',
edges: [...prev.posts.edges, ...result.data.posts.edges],
pageInfo: result.data.posts.pageInfo,
},
},
})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you use the relayStylePagination() field policy from @apollo/client?

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.

4 participants