Skip to content

build: upgrade to angular 19 #78

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

Merged
merged 9 commits into from
Jun 23, 2025
Merged

Conversation

kshitij-k-osmosys
Copy link
Contributor

@kshitij-k-osmosys kshitij-k-osmosys commented Jun 17, 2025

Portal PR Checklist

Task Link

Osmosys Developers must include the Pinestem task link in the PR.

REST-1549

Pre-requisites

  • I have gone through the Contributing guidelines for Submitting a Pull Request (PR) and ensured that this is not a duplicate PR.
  • I have performed preliminary testing to ensure that any existing features are not impacted and any new features are working as expected.

PR Details

PR details have been updated as per the given format (see below)

  • PR title adheres to the format specified in guidelines (e.g., feat: add admin login page)
  • Description has been added
  • Related changes have been added (optional)
  • Screenshots have been added (optional)
  • Pending actions have been added (optional)
  • Any other additional notes have been added (optional)

Additional Information

  • Appropriate label(s) have been added (ready for review should be added if the PR is ready to be reviewed)
  • Assignee(s) and reviewer(s) have been added (optional)

Description:

Update osm-transcript-summarizer portal to angular 19

List of commands

rm -rf node_modules
npm install primeng @primeng/themes
npm i primeng@18.0.2
ng update @angular/core@19 @angular/cli@19
npm i apollo-angular@8.0.2 --force
npm i primeng@19.1.3 --force
npm audit fix
npm run lint:fix

Related changes:

  • Update primeng to v18.0.2 and use new format of setting themes
  • Update angular to v19
  • Test locally and on docker environment

Additional notes:

Saw build errors to exceed the preset limit build limit of 2mb.

The library file-saver is commonjs and not of es6 format.

So added temporary fix in commit 5d6a36c. This is temporary and working on a fix for it.

$ ng build
Initial chunk files   | Names                         |  Raw size | Estimated transfer size
main-4NAJWR4K.js      | main                          |   1.63 MB |               329.23 kB
styles-T4BKBFA5.css   | styles                        | 336.73 kB |                17.34 kB
polyfills-OYTHSGNX.js | polyfills                     |  35.10 kB |                11.54 kB
chunk-JTGFI4FN.js     | -                             |   3.00 kB |               950 bytes

                      | Initial total                 |   2.00 MB |               359.05 kB

Lazy chunk files      | Names                         |  Raw size | Estimated transfer size
chunk-YBDMFCR7.js     | BrowserPerformanceMeasurement |  84 bytes |                84 bytes

Application bundle generation failed. [7.138 seconds]

▲ [WARNING] bundle initial exceeded maximum budget. Budget 2.00 MB was not met by 3.91 kB with a total of 2.00 MB.


▲ [WARNING] Module 'file-saver' used by 'src/app/features/file-processor/file-processor.component.ts' is not ESM

  CommonJS or AMD dependencies can cause optimization bailouts.
  For more information see: https://angular.dev/tools/cli/build#configuring-commonjs-dependencies


✘ [ERROR] bundle initial exceeded maximum budget. Budget 2.00 MB was not met by 3.91 kB with a total of 2.00 MB.

Pending actions:

  1. Portal UI has changed because of updated primeng library
  2. Some primeng components are deprecated
Messages component is deprecated as of v18. Use Message component instead.

Screenshots:

npm install
image

Portal
image

Summary by CodeRabbit

  • New Features

    • PrimeNG theme now initializes automatically during app startup with the Lara Light Blue preset.
    • Updated global font to Arial for improved consistency.
  • Bug Fixes

    • Improved handling of PrimeNG theme and styles to ensure correct appearance.
  • Style

    • Minor CSS formatting adjustments for better readability.
  • Chores

    • Upgraded Angular, PrimeNG, Apollo, and related dependencies to latest stable versions.
    • Updated build configuration and budgets for improved compatibility.
    • Removed deprecated PrimeNG CSS files and replaced with PrimeFlex styles.
    • Explicitly marked key components as non-standalone to align with Angular module usage.

@kshitij-k-osmosys kshitij-k-osmosys self-assigned this Jun 17, 2025
Copy link
Contributor

coderabbitai bot commented Jun 17, 2025

Walkthrough

This update upgrades Angular, PrimeNG, and related dependencies to newer versions, modifies the Angular project configuration to use PrimeFlex styles instead of PrimeNG themes, and introduces explicit PrimeNG theme initialization in the app module. Several components are marked as non-standalone, and minor stylesheet and global style adjustments are made.

Changes

File(s) Summary
apps/portal/package.json Upgraded Angular, PrimeNG, Apollo, and related dependencies to latest stable versions.
apps/portal/angular.json Switched from PrimeNG theme/core CSS to PrimeFlex; increased initial bundle size budget slightly.
apps/portal/src/app/app.module.ts Added APP_INITIALIZER to set PrimeNG theme (LaraLightBlue) during app startup.
apps/portal/src/app/app.component.ts
apps/portal/src/app/features/file-processor/file-processor.component.ts
apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.ts
Marked components as non-standalone (standalone: false).
apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.scss Removed PrimeFlex import; minor formatting changes to class selectors.
apps/portal/src/styles.scss Set global font family for body to Arial, sans-serif.

Sequence Diagram(s)

sequenceDiagram
    participant Browser
    participant AppModule
    participant PrimeNG

    Browser->>AppModule: Application bootstrap
    AppModule->>PrimeNG: initializePrimeNG (set theme: LaraLightBlue, darkModeSelector: false)
    PrimeNG-->>AppModule: Theme configured
    AppModule-->>Browser: App initialization continues
Loading

Possibly related PRs

Suggested labels

Ready for review

Suggested reviewers

  • xixas

Poem

Hopping through fields of code so green,
Upgrading packages, keeping things clean.
PrimeNG and Angular, now shiny and new,
With themes and flex, the styles grew.
A bunny’s delight—fresh carrots for all,
As the portal app stands proud and tall! 🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d6a36c and 0682830.

⛔ Files ignored due to path filters (1)
  • apps/portal/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • apps/portal/angular.json (2 hunks)
  • apps/portal/package.json (1 hunks)
  • apps/portal/src/app/app.component.ts (1 hunks)
  • apps/portal/src/app/app.module.ts (4 hunks)
  • apps/portal/src/app/features/file-processor/file-processor.component.ts (1 hunks)
  • apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.scss (1 hunks)
  • apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.ts (1 hunks)
  • apps/portal/src/styles.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • apps/portal/src/styles.scss
  • apps/portal/src/app/features/file-processor/file-processor.component.ts
  • apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.ts
  • apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.scss
  • apps/portal/angular.json
  • apps/portal/src/app/app.component.ts
  • apps/portal/src/app/app.module.ts
  • apps/portal/package.json
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: Lint
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kshitij-k-osmosys kshitij-k-osmosys added the dependencies Pull requests that update a dependency file label Jun 17, 2025
@kshitij-k-osmosys kshitij-k-osmosys added the help wanted Extra attention is needed label Jun 18, 2025
@kshitij-k-osmosys kshitij-k-osmosys marked this pull request as ready for review June 18, 2025 08:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (4)
apps/portal/angular.json (1)

51-53: Temporary budget increase—consider long-term fix
Bumping "maximumError" to "2.01mb" suppresses the build failure, but the underlying bundle remains oversized. I recommend replacing the CommonJS file-saver import with an ES module or using dynamic imports to shave off that ~4 KB.

apps/portal/src/app/app.component.ts (1)

23-24: standalone: false is redundant noise

standalone defaults to false; adding it does not change behaviour and clutters every component decorator touched in this PR.
Unless you plan to toggle it dynamically, drop the property to keep the decorator lean.

-  styleUrls: ['./app.component.scss'],
-  standalone: false,
+  styleUrls: ['./app.component.scss'],
apps/portal/src/app/app.module.ts (1)

115-122: Provider ordering looks OK but consider tree-shaking

Adding PrimeNG to providers forces the whole library into the root bundle.
If you only need the theming API, inject it lazily inside the initializer instead of registering it globally to minimise bundle size.

apps/portal/package.json (1)

31-40: PrimeFlex 3.x + PrimeNG 19.x style mismatch

PrimeNG 19 ships with utilities expecting PrimeFlex 4.x.
Keeping primeflex": "^3.3.1" may cause layout classes (e.g. flex, gap-3) to behave differently. Upgrade to ^4 to stay aligned.

-    "primeflex": "^3.3.1",
+    "primeflex": "^4.3.0",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20c4b8b and 5d6a36c.

⛔ Files ignored due to path filters (1)
  • apps/portal/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • apps/portal/angular.json (2 hunks)
  • apps/portal/package.json (1 hunks)
  • apps/portal/src/app/app.component.ts (1 hunks)
  • apps/portal/src/app/app.module.ts (4 hunks)
  • apps/portal/src/app/features/file-processor/file-processor.component.ts (1 hunks)
  • apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.scss (1 hunks)
  • apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.ts (1 hunks)
  • apps/portal/src/styles.scss (1 hunks)
🔇 Additional comments (7)
apps/portal/src/styles.scss (1)

2-4: Global typography set correctly
Adding a base font-family ensures consistent typography after removing the PrimeNG theme CSS.

apps/portal/angular.json (1)

42-43: PrimeFlex imported in global styles
Integrating primeflex.css here aligns with the shift to utility-first styling. Confirm that no legacy PrimeNG theme files remain in the array.

apps/portal/src/app/features/file-processor/file-processor.component.ts (1)

18-18: Explicit non-standalone flag—consistent with project
Marking this component as standalone: false aligns with the updated schematics defaults and other components.

apps/portal/src/app/features/transcript-analyzer/transcript-analyzer.component.ts (1)

13-13: Explicit non-standalone flag—consistent with project
Adding standalone: false here maintains consistency with the other components and the updated schematics defaults.

apps/portal/src/app/app.module.ts (2)

1-9: APP_INITIALIZER import is fine – but guard against tree-shakability

Because APP_INITIALIZER is always executed eagerly, any heavy-weight code inside the initializer (e.g. dynamic theme parsing) will be bundled in the first chunk and may undo your efforts to keep the main chunk under 2 MB.
Keep initialiser logic minimal and lazy-load heavy artefacts if possible.


22-23: Verify theme preset import

The current import assumes a default export:

import LaraLightBlue from '@primeng/themes/lara';

In v19 the package exposes named presets:

import { LaraLightBlue } from '@primeng/themes/lara';

The default-import form yields undefined, so primeng.theme.set() will throw at runtime.
Double-check the package typings or run npm explore @primeng/themes -- ls to confirm.

apps/portal/package.json (1)

17-44: Zone.js version may break Ng19 change detection

zone.js@0.15 is currently only marked “next”. Angular 19 LTS still pegs to ~0.14.x. Mixing the two has previously caused runtime errors (e.g. ZoneDelegate.invokeTask undefined).
Pin to ~0.14.2 unless you have explicitly validated 0.15 with E2E tests.

-    "zone.js": "~0.15.1"
+    "zone.js": "~0.14.2"

@osm-vishnukyatannawar osm-vishnukyatannawar merged commit fbd727c into main Jun 23, 2025
6 checks passed
@osm-vishnukyatannawar osm-vishnukyatannawar deleted the build/angular-19 branch June 23, 2025 10:33
@coderabbitai coderabbitai bot mentioned this pull request Jun 26, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants