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

Angular 18 upgrade (squashed) #500

Merged
merged 11 commits into from
Nov 28, 2024
Merged

Angular 18 upgrade (squashed) #500

merged 11 commits into from
Nov 28, 2024

Conversation

lukestanley
Copy link
Member

@lukestanley lukestanley commented Nov 11, 2024

Introduces Angular 18 compatibility, compatible Monaco Editor, Ag Grid issues, adds identifiers for Cypress tests to find, UI compatibility refactoring, styling and code clean-up, built on top of Gio's and J Black's work.

There were over 70 commits built on an old base branch, so to avoid introducing unintended regressions and to make sensible review process more possible, I rebuilt it as 6 commits, that merge diff patches from key commits. Many unneeded linting changes were removed. About half as many lines are used, and a lot less files are changed too.

I removed unrelated documentation changes and based it on develop so it will merge.

  • Angular & Dependency Upgrades

    • Angular 18
    • Angular Material (Removes legacy Material components)
      • Replaced deprecated MatLegacy* imports with current Mat* components
      • Updated class names (e.g., .mat-menu-item to .mat-mdc-menu-item)
      • Set appearance="outlined" for Material input fields
    • CDK
    • ESLint
    • PWA dependencies with service worker integration in main.ts
  • Monaco Editor

    • Changes Monaco Editor packages
    • New loading and configuration code for Angular 18 compatibility
  • Ag Grid UI fixes

    • Resolved compatibility issues with Angular 18
  • Component and UI Refactoring

    • Material UI template updates
    • Added mat-label for accessibility
    • Updated Map Block dependencies (Leaflet and MarkerCluster)
    • Replaced angular2-text-mask with maskito for input masking
    • Updated Formly validation property naming (e.g., minlength to minLength)
  • Testing

    • Added data-cy attributes for more reliable Cypress selection
    • Improved Cypress intercept aliasing
    • Enabled esModuleInterop
    • Fix test file errors
    • A test is disabled!
  • Styling & Code Clean-up

    • Adjusted text and title alignment
    • Added TypeScript types to address compile errors/warnings
    • Updated Material theming and style variables
    • Refined component-specific styles
    • Removed unused CSS
    • Messy: I had to undo a lot of deletion, might have missed readding some things correctly!

Risk Areas to Review

  • Material UI Refactoring: Check consistency of styling and class name updates across components
  • Angular & Ag Grid Compatibility: Watch for potential reactivity regressions with Angular 18
  • Form Validation & Input Masking: Verify Formly and maskito input masking reliability
  • Cypress Testing: Ensure accuracy of data-cy attributes and overall test stability

A more complete history may be helpful context, there are 117 commits in angular-18-upgrade-rebase: https://github.com/kendraio/kendraio-app/pull/496/commits (draft PR for easier reference that has filtering features the tree comparison view does not).

It builds, and tests are passing!

I noticed warnings, during build, that match the warnings in Gio's pull request so they are not a regression upon that.

I am not sure how to best include tasks and reference information that is on #487 backing up the existing angular-upgrade-18 branch and force merging this would help, and I am open to other ideas to ensure we don't loose the insights there. Discuss!

We are still on the look out for possible reactivity regressions. If we can get this (or something based on this) on production we can test it in a more realistic setting than the Vercel build.

The Vercel build is here.

Please review carefully, especially test changes, and there was a lot of manual work merging style changes, so there is greater risk of error there.

Copy link

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kendraio-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 2:15pm

@lukestanley lukestanley marked this pull request as ready for review November 12, 2024 10:38
@lukestanley lukestanley changed the title Angular 18 squashed Angular 18 upgrade (squashed) Nov 12, 2024
Copy link
Collaborator

@CodeKrakken CodeKrakken left a comment

Choose a reason for hiding this comment

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

This all looks good. No comments - surprising for such a large PR. Good work!

@gsambrotta
Copy link
Collaborator

Nice work 👍
I left some minor comments.
And then looking at vercel preview, some style is missing:

image

image

image

Seems to me that the main problem is with Grid. It might be a style inclusion problem (see the comment I left for the style theme)
or maybe something with the AG Grid module.

@CodeKrakken
Copy link
Collaborator

I have noticed that when tests hang, they tend to be related to AG Grid. They don't fail, but they hang. Presumably the issues @gsambrotta found on the Vercel preview are not covered by our current tests - I suggest we remedy this.

@lukestanley
Copy link
Member Author

Thanks both, good finds, I was adding to the description about the changes with the grid version upgrade and key patterns in the file changes of this when you added this!
I was unsure about some of the style changes, I can now check the Flow list and the schema list flows in the other versions.
@gsambrotta @CodeKrakken

…efect visible on the Flow at workflowCloud/listWorkflows which has a grid used that had wrongly overlapping text.
@gsambrotta
Copy link
Collaborator

Looks good now @lukestanley
Please let me know when you address my other comments, so I can review it again

@lukestanley
Copy link
Member Author

Looks good now @lukestanley Please let me know when you address my other comments, so I can review it again

image
If you have other comments, maybe you need to submit them!
I only see your 2 comments from in this main thread.
@gsambrotta

Copy link
Collaborator

@gsambrotta gsambrotta left a comment

Choose a reason for hiding this comment

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

Sorry, you are right, I did not commit the other comments. Here they are

cypress/e2e/spec.ts Outdated Show resolved Hide resolved
cypress/e2e/spec.ts Outdated Show resolved Hide resolved
src/app/_shared/services/uphold_service.ts Outdated Show resolved Hide resolved
src/app/app.component.html Outdated Show resolved Hide resolved
src/styles.scss Outdated Show resolved Hide resolved
…es it

-Adds waiting assertions to ensure test starts in correct state
-Simplified logic, used constants for readability and robustness.
Copy link
Collaborator

@CodeKrakken CodeKrakken left a comment

Choose a reason for hiding this comment

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

All tests passing, no comments. Good stuff - approved!

@gsambrotta
Copy link
Collaborator

Looks good to me now.
All comments have been address and the preview looks good too.
Let's merge it 🚀 🌟

@lukestanley lukestanley merged commit c50db24 into develop Nov 28, 2024
3 checks passed
@lukestanley lukestanley mentioned this pull request Nov 28, 2024
5 tasks
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