Jhernandez has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/379822 )
Change subject: Perf: Preload CSS too before scripts, mark scripts async
......................................................................
Perf: Preload CSS too before scripts, mark scripts async
The CSS was being loaded after the preloads, so add it to the preload
tags to load as soon as possible.
Also mark the script tags as async so that the HTML renders without
caring about the scripts.
Change-Id: I98120c8193012f877d06972a94dbccfac5da5c6e
---
M src/server/components/html-page.tsx
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/22/379822/1
diff --git a/src/server/components/html-page.tsx
b/src/server/components/html-page.tsx
index 8d7f1be..6a5ec39 100644
--- a/src/server/components/html-page.tsx
+++ b/src/server/components/html-page.tsx
@@ -24,6 +24,8 @@
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{title ? `${title} - ` : ""}Marvin</title>
+ {/* Preload the stylesheet before the scripts */}
+ <link rel="preload" href={style(manifest)} {...{ as: "style" }} />
<link rel="stylesheet" href={style(manifest)} />
{assets.map(path => (
<link rel="preload" href={path} {...{ as: "script" }} />
@@ -31,7 +33,7 @@
</head>
<body>
<div id="root">{children}</div>
- {assets.map(path => <script type="text/javascript" src={path} />)}
+ {assets.map(path => <script type="text/javascript" src={path} async
/>)}
</body>
</html>
);
--
To view, visit https://gerrit.wikimedia.org/r/379822
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I98120c8193012f877d06972a94dbccfac5da5c6e
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits