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] Upgrade to version 18 #2028

Merged
merged 6 commits into from
Feb 5, 2025
Merged

[Angular] Upgrade to version 18 #2028

merged 6 commits into from
Feb 5, 2025

Conversation

illiakovalenko
Copy link
Contributor

@illiakovalenko illiakovalenko commented Feb 4, 2025

Description / Motivation

Upgraded Angular to version 18:

  • Support CanActivate RedirectCommand API
  • CanActivate and CanResolve now also accept router as a parameter, giving accessibility to router instance in function-based implementations

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@illiakovalenko illiakovalenko requested a review from a team February 4, 2025 14:38
Copy link
Contributor

@art-alexeyenko art-alexeyenko left a comment

Choose a reason for hiding this comment

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

Please check the UrlTree related changes from upgrade guide:

When a guard returns a UrlTree as a redirect, the redirecting navigation will now use replaceUrl if the initial navigation was also using the replaceUrl option. If you prefer the previous behavior, configure the redirect using the new NavigationBehaviorOptions by returning a RedirectCommand with the desired options instead of UrlTree.

and

Route guards and resolvers can now return a RedirectCommand object in addition to a UrlTree and boolean. Any code which reads Route objects directly and expects only boolean or UrlTree may need to update to account for RedirectCommand as well.

Client navigation fails currently for monorepo xmcloud setup, I think it may be related. And I also believe we need to accound for RedirectCommand in guard resolver.

@illiakovalenko
Copy link
Contributor Author

illiakovalenko commented Feb 5, 2025

Client navigation fails currently for monorepo xmcloud setup, I think it may be related. And I also believe we need to accound for RedirectCommand in guard resolver.

@art-alexeyenko How did you reproduce? I scaffolded angular, angular-xmcloud in monorepo and it works as expected and connected to Basic site on staging env. Tested both "connected" and "production" modes - works as expected

@illiakovalenko
Copy link
Contributor Author

illiakovalenko commented Feb 5, 2025

And I also believe we need to accound for RedirectCommand in guard resolver.

@art-alexeyenko I introduced support for RedirectCommand, however I consider it as a new feature rather than a required part of the upgrade. In any case I decided to introduce that

Copy link
Contributor

@art-alexeyenko art-alexeyenko left a comment

Choose a reason for hiding this comment

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

This looks great, thank you Illia

@illiakovalenko illiakovalenko merged commit f0f6e64 into dev Feb 5, 2025
1 check passed
@illiakovalenko illiakovalenko deleted the feature/JSS-4872 branch February 5, 2025 14:08
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.

2 participants