-
-
Notifications
You must be signed in to change notification settings - Fork 372
Imolorhe/angular upgrade #2903
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
Imolorhe/angular upgrade #2903
Conversation
Reviewer's GuideThis PR upgrades the Angular framework to v19, revises the build setup, standardizes component metadata, and applies broad code-style cleanups across templates, utilities, tests, and styles. Class diagram for standardized Angular component metadataclassDiagram
class AppComponent {
+standalone: false
}
class QueryCollectionItemComponent {
+standalone: false
}
class DocViewerComponent {
+standalone: false
}
class SchemaFormItemComponent {
+standalone: false
}
class ConfirmToastComponent {
+standalone: false
}
class DocViewerSearchResultsComponent {
+standalone: false
}
class DocViewerTypeComponent {
+standalone: false
}
class AddCollectionQueryDialogComponent {
+standalone: false
}
class FancyInputComponent {
+standalone: false
}
class TagComponent {
+standalone: false
}
%% ... and many more components
%% All components now have standalone: false in their metadata
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 56 files out of 163 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The Angular package updates currently bump core packages to v19 but leave @angular/cdk at v15; please align all Angular dependencies to the same major version to prevent compatibility issues.
- There are many manual formatting tweaks across templates and code; consider running the official Angular upgrade schematics and using Prettier/ESLint auto-formatting to ensure consistent styling and reduce manual overhead.
- You've added 'standalone: false' to almost every component; consider auditing these and migrating eligible components to standalone: true or removing redundant standalone flags to leverage Angular 19's standalone component feature.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The Angular package updates currently bump core packages to v19 but leave @angular/cdk at v15; please align all Angular dependencies to the same major version to prevent compatibility issues.
- There are many manual formatting tweaks across templates and code; consider running the official Angular upgrade schematics and using Prettier/ESLint auto-formatting to ensure consistent styling and reduce manual overhead.
- You've added 'standalone: false' to almost every component; consider auditing these and migrating eligible components to standalone: true or removing redundant standalone flags to leverage Angular 19's standalone component feature.
## Individual Comments
### Comment 1
<location> `packages/altair-app/src/app/modules/altair/services/gql/oldBuildClientSchema.ts:165-168` </location>
<code_context>
</code_context>
<issue_to_address>
**issue (code-quality):** Avoid function declarations, favouring function assignment expressions, inside blocks. ([`avoid-function-declarations-in-blocks`](https://docs.sourcery.ai/Reference/Rules-and-In-Line-Suggestions/TypeScript/Default-Rules/avoid-function-declarations-in-blocks))
<details><summary>Explanation</summary>Function declarations may be hoisted in Javascript, but the behaviour is inconsistent between browsers.
Hoisting is generally confusing and should be avoided. Rather than using function declarations inside blocks, you
should use function expressions, which create functions in-scope.
</details>
</issue_to_address>
### Comment 2
<location> `packages/altair-app/src/app/modules/altair/services/gql/oldBuildClientSchema.ts:353-355` </location>
<code_context>
!('onField' in directiveIntrospection && directiveIntrospection.onField)
? []
: [DirectiveLocation.FIELD],
</code_context>
<issue_to_address>
**suggestion (code-quality):** Invert ternary operator to remove negation ([`invert-ternary`](https://docs.sourcery.ai/Reference/Rules-and-In-Line-Suggestions/TypeScript/Default-Rules/invert-ternary))
```suggestion
'onField' in directiveIntrospection && directiveIntrospection.onField ? [DirectiveLocation.FIELD] : [],
```
<br/><details><summary>Explanation</summary>Negated conditions are more difficult to read than positive ones, so it is best
to avoid them where we can. By inverting the ternary condition and swapping the
expressions we can simplify the code.
</details>
</issue_to_address>
### Comment 3
<location> `packages/altair-app/src/app/modules/altair/store/async-storage-sync.ts:423-431` </location>
<code_context>
if (action.type === APP_INIT_ACTION) {
if (action.payload?.initialState) {
nextState = defaultMergeReducer(
nextState,
(action as AppInitAction).payload.initialState,
action
);
}
}
</code_context>
<issue_to_address>
**suggestion (code-quality):** Merge nested if conditions ([`merge-nested-ifs`](https://docs.sourcery.ai/Reference/Rules-and-In-Line-Suggestions/TypeScript/Default-Rules/merge-nested-ifs))
```suggestion
if (action.type === APP_INIT_ACTION && action.payload?.initialState) {
nextState = defaultMergeReducer(
nextState,
(action as AppInitAction).payload.initialState,
action
);
}
```
<br/><details><summary>Explanation</summary>Reading deeply nested conditional code is confusing, since you have to keep track of which
conditions relate to which levels. We therefore strive to reduce nesting where
possible, and the situation where two `if` conditions can be combined using
`and` is an easy win.
</details>
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
packages/altair-app/src/app/modules/altair/services/gql/oldBuildClientSchema.ts
Show resolved
Hide resolved
packages/altair-app/src/app/modules/altair/services/gql/oldBuildClientSchema.ts
Show resolved
Hide resolved
Summary of ChangesHello @imolorhe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on a significant upgrade of the application's core framework, Angular, from version 18 to 19. This upgrade necessitated updates to the Angular CLI build configuration, adjustments to how application initializers are provided, and explicit declarations for component standalone status. Additionally, several minor code formatting and testing setup improvements were made across various files, ensuring compatibility and adherence to modern Angular practices. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request aims to upgrade the application to Angular 19. While the core Angular packages have been updated from v18 to v19, a significant number of other dependencies that are tightly coupled with the Angular version have been missed. This includes critical packages that are still on versions compatible with older Angular versions.
Here are some of the outdated packages I found:
@angular/cdk:15.2.9(should be~19.2.x)@ngrx/*packages:15.4.0(should be~19.x)ng-zorro-antd:15.1.1(should be compatible with Angular 19)angular-split:^18.0.0(should be^19.0.0)ngx-toastr:^18.0.0(should be^19.0.0)@ngx-translate/*packages:^15.0.0(should be compatible with Angular 19)ngx-cookie-service:14.0.1(should be compatible with Angular 19)ngx-markdown:^14.0.1(should be compatible with Angular 19)
These version mismatches are highly likely to cause build failures or severe runtime issues. The upgrade cannot be considered complete or safe without addressing these dependencies. I have added one specific comment for @angular/cdk as it was visible in the diff context. A thorough dependency audit of package.json is required before this PR can be merged.
|
Visit the preview URL for this PR (updated for commit 75af6bd): https://altair-gql--pr2903-imolorhe-angular-upg-qw74q4f7.web.app (expires Wed, 15 Oct 2025 10:31:18 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 02d6323d75a99e532a38922862e269d63351a6cf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New security issues found
Fixes
Checks
yarn test-buildChanges proposed in this pull request:
Summary by Sourcery
Upgrade the Angular application to v19, update build configuration and initialization, add explicit standalone flags, and apply consistent code formatting across the codebase.
Enhancements:
Build: