Skip to content

Commit

Permalink
move resource hints up
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbenz committed Apr 6, 2021
1 parent 2efc49d commit d96effd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/optimizer/lib/transformers/ReorderHeadTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class HeadNodes {
this._metaCharset = null;
this._scriptAmpEngine = null;
this._metaOther = [];
this._resourceHintLinks = [];
this._scriptRenderDelayingExtensions = [];
this._scriptNonRenderDelayingExtensions = [];
this._resourceHintLinks = [];
this._linkIcons = [];
this._styleAmpCustom = null;
this._linkStylesheetsBeforeAmpCustom = [];
Expand Down Expand Up @@ -63,11 +63,11 @@ class HeadNodes {
appendChild(head, this._linkStyleAmpRuntime);
appendChild(head, this._styleAmpRuntime);
appendAll(head, this._metaOther);
appendAll(head, this._resourceHintLinks);
appendChild(head, this._scriptAmpEngine);
appendAll(head, this._scriptRenderDelayingExtensions);
appendAll(head, this._scriptNonRenderDelayingExtensions);
appendAll(head, this._linkIcons);
appendAll(head, this._resourceHintLinks);
appendAll(head, this._linkStylesheetsBeforeAmpCustom);
appendChild(head, this._styleAmpCustom);
appendAll(head, this._others);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html >
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-audio" src="https://cdn.ampproject.org/v0/amp-audio-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
<link href="https://example.com/favicon.ico" rel="icon">
<link rel="preload" href="/example.css">
<link rel="preconnect" href="/example.css">
<link rel="prefetch" href="/example.css">
<link rel="dns-prefetch" href="/example.css">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-audio" src="https://cdn.ampproject.org/v0/amp-audio-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
<link href="https://example.com/favicon.ico" rel="icon">
<link rel="prerender" href="/example.html">
</head>
<body></body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<html >
<head>
<link rel="stylesheet" href="https://cdn.ampproject.org/v0.css">
<link rel="preload" href="https://cdn.ampproject.org/v0.css" as="style">

This comment has been minimized.

Copy link
@westonruter

westonruter Apr 6, 2021

Member

The order here seems reversed. Why is the stylesheet before its preload link?

This comment has been minimized.

Copy link
@sebastianbenz

sebastianbenz Apr 6, 2021

Author Collaborator

🤦

<script async src="https://cdn.ampproject.org/v0.mjs" type="module" crossorigin="anonymous"></script>
<script async nomodule src="https://cdn.ampproject.org/v0/amp-experiment-0.1.js" custom-element="amp-experiment"></script>
<script async custom-element="amp-experiment" src="https://cdn.ampproject.org/v0/amp-experiment-0.1.mjs" type="module" crossorigin="anonymous"></script>
<script async nomodule src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js" custom-template="amp-mustache"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.mjs" type="module" crossorigin="anonymous"></script>
<link href="https://example.com/favicon.ico" rel="icon">
<link rel="preload" href="https://cdn.ampproject.org/v0.css" as="style">
<link href="https://fonts.googleapis.com/css?foobar" rel="stylesheet" type="text/css">
<link as="script" crossorigin="anonymous" href="https://cdn.ampproject.org/v0.mjs" rel="modulepreload">
</head>
Expand Down

0 comments on commit d96effd

Please sign in to comment.