Skip to content

Commit

Permalink
prefetch-dns -> dns-prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Oct 21, 2022
1 parent 9f7339a commit 8d26e62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ export function resourcesFromLink(props: Props): boolean {
resources.headsMap.set(key, resource);
switch (rel) {
case 'preconnect':
case 'prefetch-dns': {
case 'dns-prefetch': {
resources.preconnects.add(resource);
break;
}
Expand Down
10 changes: 5 additions & 5 deletions packages/react-dom/src/__tests__/ReactDOMFloat-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ describe('ReactDOMFloat', () => {
<link rel="preload" href="bar" as="style" />
<link rel="stylesheet" href="bar" precedence="default" />
<link rel="preconnect" href="bar" />
<link rel="prefetch-dns" href="bar" />
<link rel="dns-prefetch" href="bar" />
<link rel="icon" href="bar" />
<link rel="icon" href="bar" sizes="1x1" />
<link rel="icon" href="bar" media="foo" />
Expand All @@ -965,15 +965,15 @@ describe('ReactDOMFloat', () => {
);
pipe(writable);
});
// "preconnect" and "prefetch-dns" get hoisted to the front.
// "preconnect" and "dns-prefetch" get hoisted to the front.
// All other generic links (not styles, or typed preloads)
// get emitted after styles and other higher priority Resources
// Sizes and Media are part of generic link keys
expect(getMeaningfulChildren(document)).toEqual(
<html>
<head>
<link rel="preconnect" href="bar" />
<link rel="prefetch-dns" href="bar" />
<link rel="dns-prefetch" href="bar" />
<link rel="stylesheet" href="bar" data-precedence="default" />
<link rel="foo" href="bar" />
<link rel="preload" href="bar" />
Expand Down Expand Up @@ -1001,7 +1001,7 @@ describe('ReactDOMFloat', () => {
<link rel="preload" href="bar" as="style" />
<link rel="stylesheet" href="bar" precedence="default" />
<link rel="preconnect" href="bar" />
<link rel="prefetch-dns" href="bar" />
<link rel="dns-prefetch" href="bar" />
<link rel="icon" href="bar" />
<link rel="icon" href="bar" sizes="1x1" />
<link rel="icon" href="bar" media="foo" />
Expand All @@ -1014,7 +1014,7 @@ describe('ReactDOMFloat', () => {
<html>
<head>
<link rel="preconnect" href="bar" />
<link rel="prefetch-dns" href="bar" />
<link rel="dns-prefetch" href="bar" />
<link rel="stylesheet" href="bar" data-precedence="default" />
<link rel="foo" href="bar" />
<link rel="preload" href="bar" />
Expand Down

0 comments on commit 8d26e62

Please sign in to comment.