File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/Components/Web.JS/src/Rendering/DomMerging Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,11 @@ function domNodeComparer(a: Node, b: Node): UpdateCost {
308
308
return UpdateCost . Infinite ;
309
309
}
310
310
311
+ // Always treat "preloads" as new elements.
312
+ if ( isPreloadElement ( a as Element ) || isPreloadElement ( b as Element ) ) {
313
+ return UpdateCost . Infinite ;
314
+ }
315
+
311
316
return UpdateCost . None ;
312
317
case Node . DOCUMENT_TYPE_NODE :
313
318
// It's invalid to insert or delete doctype, and we have no use case for doing that. So just skip such
@@ -319,6 +324,10 @@ function domNodeComparer(a: Node, b: Node): UpdateCost {
319
324
}
320
325
}
321
326
327
+ function isPreloadElement ( el : Element ) : boolean {
328
+ return el . tagName === 'LINK' && el . attributes . getNamedItem ( 'rel' ) ?. value === 'preload' ;
329
+ }
330
+
322
331
function upgradeComponentCommentsToLogicalRootComments ( root : Node ) : ComponentDescriptor [ ] {
323
332
const serverDescriptors = discoverComponents ( root , 'server' ) as ServerComponentDescriptor [ ] ;
324
333
const webAssemblyDescriptors = discoverComponents ( root , 'webassembly' ) as WebAssemblyComponentDescriptor [ ] ;
You can’t perform that action at this time.
0 commit comments