refactor(router): Update RouterLink href to use host binding and signals (#60875)

This commit updates the method of setting the href attribute on
`RouterLink` to use built in host binding rather than custom attribute
setting and sanitization. The advantage here would be automatic handling
of the sanitization and avoiding of writing the same value to the DOM
that we had before.

This change does mean that we _always_ write to the href attribute where
before we only wrote to it when the elemnt was known to support `href`.
That said, the implementation attempts to retain behavior that is as
close as possible: the original value of `href` is used and never updated.

PR Close #60875
This commit is contained in:
Andrew Scott
2025-04-15 12:34:10 -07:00
committed by Andrew Kushnir
parent a1bf58e32e
commit c53310ee81
3 changed files with 33 additions and 26 deletions
@@ -84,6 +84,7 @@
"GuardsCheckEnd",
"GuardsCheckStart",
"HistoryStateManager",
"HostAttributeToken",
"INITIAL_NAVIGATION",
"INITIAL_VALUE",
"INJECTOR",
@@ -633,6 +634,7 @@
"producerNotifyConsumers",
"producerRemoveLiveConsumerAtIndex",
"producerUpdateValueVersion",
"producerUpdatesAllowed",
"profiler",
"profilerCallbacks",
"readableStreamLikeToAsyncGenerator",
@@ -689,6 +691,9 @@
"shimStylesContent",
"shouldAddViewToDom",
"shouldSearchParent",
"signal",
"signalAsReadonlyFn",
"signalSetFn",
"split",
"squashSegmentGroup",
"standardizeConfig",
@@ -711,6 +716,7 @@
"throwCyclicDependencyError",
"throwError2",
"throwIfEmpty",
"throwInvalidWriteToSignalError",
"throwInvalidWriteToSignalErrorFn",
"throwProviderNotFoundError",
"timeoutProvider",
@@ -748,9 +754,11 @@
"ɵɵelementStart",
"ɵɵgetInheritedFactory",
"ɵɵinject",
"ɵɵinjectAttribute",
"ɵɵlistener",
"ɵɵsanitizeResourceUrl",
"ɵɵsanitizeUrl",
"ɵɵsanitizeUrlOrResourceUrl",
"ɵɵtext",
"ɵɵtextInterpolate1"
]