Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@imolorhe
Copy link
Collaborator

@imolorhe imolorhe commented Oct 7, 2025

Fixes

Checks

  • Ran yarn test-build
  • Updated relevant documentations
  • Updated matching config options in altair-static

Changes 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:

  • Bump Angular packages (core, CLI, compiler, forms, router) and zone.js to v19.2.x
  • Revise angular.json to use the new application builder, structured outputPath, polyfills array, browser entry point, and remove deprecated options
  • Replace APP_INITIALIZER provider with provideAppInitializer and add standalone:false to components, directives, and pipes
  • Standardize code formatting (trailing commas, brace placement, function signatures, and template indentation) across TS, HTML, and SCSS files

Build:

  • Update @angular-devkit/build-angular version

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 7, 2025

Reviewer's Guide

This 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 metadata

classDiagram
  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
Loading

File-Level Changes

Change Details Files
Upgrade Angular dependencies and build configuration
  • Bump Angular packages (animations, core, forms, router, cli) to v19 and update zone.js
  • Switch builder in angular.json to @angular-devkit/build-angular:application
  • Restructure angular.json options (polyfills array, outputPath format, browser entry)
packages/altair-app/package.json
packages/altair-app/angular.json
Standardize component metadata and initialization
  • Add standalone: false to @component and @directive metadata across the application
  • Replace explicit APP_INITIALIZER provider block with the provideAppInitializer helper
packages/altair-app/src/app/modules/altair/altair.module.ts
packages/altair-app/src/app/modules/altair/components/**/*.component.ts
packages/altair-app/src/app/modules/altair/directives/**/*.directive.ts
Refactor utility functions for concise syntax
  • Collapse multi-line arrow functions and object literal maps into single-line expressions
  • Ensure consistent trailing commas, parentheses, and brace placement in TS utilities
packages/altair-app/src/app/modules/altair/store/async-storage-sync.ts
packages/altair-app/src/app/modules/altair/services/gql/helpers.ts
packages/altair-app/src/app/modules/altair/components/query-editor/run-widget.ts
Harmonize test file setup and formatting
  • Convert waitForAsync setups to single-line arrow closures
  • Align mock return indentations and remove redundant nextTick calls
packages/altair-app/src/app/modules/altair/components/**/*.spec.ts
Cleanup SCSS and theme definitions
  • Merge selector/property declarations into single-line blocks
  • Compress color and font-var definitions for compact syntax
packages/altair-app/src/theme.less
packages/altair-app/src/scss/components/_loader.scss
packages/altair-app/src/scss/components/_upgrade-dialog.scss

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Important

Review skipped

More 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 reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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 docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch imolorhe/angular-upgrade

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a 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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Angular Framework Upgrade: The core Angular framework and its associated dependencies have been upgraded from version 18 to version 19, bringing the application up to date with the latest features and improvements.
  • Angular CLI Build System Update: The Angular CLI build process has been modernized, transitioning from the @angular-devkit/build-angular:browser builder to the @angular-devkit/build-angular:application builder. This change includes adjustments to build options such as outputPath, main, and polyfills to align with the new application builder.
  • Standalone Component Preparation: Many components across the application have been explicitly marked with standalone: false in their @Component decorators. This indicates a strategic move towards or preparation for Angular's standalone components feature, ensuring clarity in component definition.
  • Modernized Application Initializer: The application initializer (APP_INITIALIZER) in altair.module.ts has been refactored to utilize the provideAppInitializer and inject functions, adopting a more modern and functional approach for application bootstrapping.
  • Code Formatting and Linting Enhancements: Minor code formatting adjustments, including trailing commas and simplified expressions, have been applied across numerous TypeScript and HTML files. This improves code consistency and readability, likely adhering to updated linting rules.
  • Testing Infrastructure Refinements: Several test files (*.spec.ts) have seen simplifications in their TestBed.configureTestingModule setups, such as the removal of redundant compileComponents() calls and waitForAsync wrappers, streamlining the testing process.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

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

sourcery-ai[bot]
sourcery-ai bot previously requested changes Oct 7, 2025
Copy link

@sourcery-ai sourcery-ai bot left a 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

@imolorhe imolorhe added this pull request to the merge queue Oct 8, 2025
Merged via the queue into master with commit e7d14ec Oct 8, 2025
21 checks passed
@imolorhe imolorhe deleted the imolorhe/angular-upgrade branch October 8, 2025 10:56
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.

1 participant