File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/Components/Web.JS/src/Rendering/DomMerging Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ function domNodeComparer(a: Node, b: Node): UpdateCost {
309309 }
310310
311311 // Always treat "preloads" as new elements.
312- if ( ( b as Element ) . tagName === 'LINK' && ( b as Element ) . attributes . getNamedItem ( 'rel' ) ?. value === 'preload' ) {
312+ if ( isPreloadElement ( a as Element ) || isPreloadElement ( b as Element ) ) {
313313 return UpdateCost . Infinite ;
314314 }
315315
@@ -324,6 +324,10 @@ function domNodeComparer(a: Node, b: Node): UpdateCost {
324324 }
325325}
326326
327+ function isPreloadElement ( el : Element ) : bool {
328+ return el . tagName === 'LINK' && el . attributes . getNamedItem ( 'rel' ) ?. value === 'preload' ;
329+ }
330+
327331function upgradeComponentCommentsToLogicalRootComments ( root : Node ) : ComponentDescriptor [ ] {
328332 const serverDescriptors = discoverComponents ( root , 'server' ) as ServerComponentDescriptor [ ] ;
329333 const webAssemblyDescriptors = discoverComponents ( root , 'webassembly' ) as WebAssemblyComponentDescriptor [ ] ;
You can’t perform that action at this time.
0 commit comments