Niedzielski has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/391899 )
Change subject: Chore: load wordmark as a separate request
......................................................................
Chore: load wordmark as a separate request
Instead of inlining the Wikipedia logo SVG, make a separate image
request. This improves bundle sizes and cache longevity at the expense
of an additional HTTP request. This patch also fixes the server-side
render of the wordmark.
Bug: T180623
Change-Id: I571d45760170e3e7cbb3ef989f621a792d1d3e7a
---
M package.json
M src/common/components/wordmark/wordmark.tsx
R src/public/wordmark-en.svg
3 files changed, 2 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/99/391899/1
diff --git a/package.json b/package.json
index 8f120d0..bfbcc26 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,7 @@
"bundlesize": [
{
"path": "dist/public/index.*.js",
- "maxSize": "5.3KB"
+ "maxSize": "2.8KB"
},
{
"path": "dist/public/runtime.*.js",
diff --git a/src/common/components/wordmark/wordmark.tsx
b/src/common/components/wordmark/wordmark.tsx
index 2ffa909..c7a3ec5 100644
--- a/src/common/components/wordmark/wordmark.tsx
+++ b/src/common/components/wordmark/wordmark.tsx
@@ -1,12 +1,6 @@
import { h } from "preact";
import "./wordmark.css";
-import wordmarkEn from "./wordmark-en.svg";
export default function Wordmark(): JSX.Element {
- return (
- <div
- className="Wordmark"
- dangerouslySetInnerHTML={{ __html: wordmarkEn }}
- />
- );
+ return <img className="Wordmark" src="/public/wordmark-en.svg" />;
}
diff --git a/src/common/components/wordmark/wordmark-en.svg
b/src/public/wordmark-en.svg
similarity index 100%
rename from src/common/components/wordmark/wordmark-en.svg
rename to src/public/wordmark-en.svg
--
To view, visit https://gerrit.wikimedia.org/r/391899
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I571d45760170e3e7cbb3ef989f621a792d1d3e7a
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits