refactor(router): Make a few adjustments to createUrlTree for clarity #45306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
treefunction now accepts the old root rather than the oldUrlTree. TheurlTreeargument was only used to get theroot.This change makes it more clear what that pararmeter is used for and
what's actually being used
oldRoot(previouslyurlTree) to be the first argument oftree.This change now mirrors the argument order for
replaceSegmentandcan be read from left to right more easily "in this root,
replace this old segment group with this new segment group".
newRootto a variable. This just makes it more clear what'sgoing on at the end rather than combining a bunch of operations into
one.
These changes are being made so that hopefully a future refactor can be
done which does not rely on the
urlTreeargument at all in thecreateUrlTreefunction. These refactorings will make it easier to see1:1 functionlity in these various places.