From 48537742a2e1026c64cc6e500a38feb19919121c Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 11 Oct 2024 02:11:08 +0800 Subject: [PATCH] Time to try fetchPriority=low --- src/components/avatar.jsx | 1 + src/components/custom-emoji.jsx | 1 + src/components/status.jsx | 2 ++ src/locales/en.po | 54 ++++++++++++++++----------------- src/utils/emojify-text.js | 2 +- 5 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/components/avatar.jsx b/src/components/avatar.jsx index a29a37af..d19fcd13 100644 --- a/src/components/avatar.jsx +++ b/src/components/avatar.jsx @@ -50,6 +50,7 @@ function Avatar({ url, size, alt = '', squircle, ...props }) { alt={alt} loading="lazy" decoding="async" + fetchPriority="low" crossOrigin={ alphaCache[url] === undefined && !isMissing ? 'anonymous' diff --git a/src/components/custom-emoji.jsx b/src/components/custom-emoji.jsx index 36b417b7..58a7eb95 100644 --- a/src/components/custom-emoji.jsx +++ b/src/components/custom-emoji.jsx @@ -13,6 +13,7 @@ export default function CustomEmoji({ staticUrl, alt, url }) { height="16" loading="lazy" decoding="async" + fetchPriority="low" /> ); diff --git a/src/components/status.jsx b/src/components/status.jsx index 64cc6517..aaa2f529 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -2788,6 +2788,8 @@ function Card({ card, selfReferential, selfAuthor, instance }) { width={width} height={height} loading="lazy" + decoding="async" + fetchPriority="low" alt={imageDescription || ''} onError={(e) => { try { diff --git a/src/locales/en.po b/src/locales/en.po index beef1c20..cd31af4a 100644 --- a/src/locales/en.po +++ b/src/locales/en.po @@ -289,7 +289,7 @@ msgstr "" #: src/components/account-info.jsx:1308 #: src/components/shortcuts-settings.jsx:1056 #: src/components/status.jsx:1152 -#: src/components/status.jsx:3217 +#: src/components/status.jsx:3219 msgid "Copy" msgstr "" @@ -417,9 +417,9 @@ msgstr "" #: src/components/shortcuts-settings.jsx:227 #: src/components/shortcuts-settings.jsx:580 #: src/components/shortcuts-settings.jsx:780 -#: src/components/status.jsx:2942 -#: src/components/status.jsx:3181 -#: src/components/status.jsx:3679 +#: src/components/status.jsx:2944 +#: src/components/status.jsx:3183 +#: src/components/status.jsx:3681 #: src/pages/accounts.jsx:36 #: src/pages/catchup.jsx:1581 #: src/pages/filters.jsx:224 @@ -1207,9 +1207,9 @@ msgid "Filtered: {filterTitleStr}" msgstr "" #: src/components/media-post.jsx:133 -#: src/components/status.jsx:3509 -#: src/components/status.jsx:3605 -#: src/components/status.jsx:3683 +#: src/components/status.jsx:3511 +#: src/components/status.jsx:3607 +#: src/components/status.jsx:3685 #: src/components/timeline.jsx:973 #: src/pages/catchup.jsx:75 #: src/pages/catchup.jsx:1876 @@ -2094,7 +2094,7 @@ msgid "Edited: {editedDateText}" msgstr "" #: src/components/status.jsx:1187 -#: src/components/status.jsx:3186 +#: src/components/status.jsx:3188 msgid "Embed post" msgstr "" @@ -2223,77 +2223,77 @@ msgstr "" msgid "More from <0/>" msgstr "More from <0/>" -#: src/components/status.jsx:2947 +#: src/components/status.jsx:2949 msgid "Edit History" msgstr "" -#: src/components/status.jsx:2951 +#: src/components/status.jsx:2953 msgid "Failed to load history" msgstr "" -#: src/components/status.jsx:2956 +#: src/components/status.jsx:2958 msgid "Loading…" msgstr "" -#: src/components/status.jsx:3191 +#: src/components/status.jsx:3193 msgid "HTML Code" msgstr "" -#: src/components/status.jsx:3208 +#: src/components/status.jsx:3210 msgid "HTML code copied" msgstr "" -#: src/components/status.jsx:3211 +#: src/components/status.jsx:3213 msgid "Unable to copy HTML code" msgstr "" -#: src/components/status.jsx:3223 +#: src/components/status.jsx:3225 msgid "Media attachments:" msgstr "" -#: src/components/status.jsx:3245 +#: src/components/status.jsx:3247 msgid "Account Emojis:" msgstr "" -#: src/components/status.jsx:3276 -#: src/components/status.jsx:3321 +#: src/components/status.jsx:3278 +#: src/components/status.jsx:3323 msgid "static URL" msgstr "" -#: src/components/status.jsx:3290 +#: src/components/status.jsx:3292 msgid "Emojis:" msgstr "" -#: src/components/status.jsx:3335 +#: src/components/status.jsx:3337 msgid "Notes:" msgstr "" -#: src/components/status.jsx:3339 +#: src/components/status.jsx:3341 msgid "This is static, unstyled and scriptless. You may need to apply your own styles and edit as needed." msgstr "" -#: src/components/status.jsx:3345 +#: src/components/status.jsx:3347 msgid "Polls are not interactive, becomes a list with vote counts." msgstr "" -#: src/components/status.jsx:3350 +#: src/components/status.jsx:3352 msgid "Media attachments can be images, videos, audios or any file types." msgstr "" -#: src/components/status.jsx:3356 +#: src/components/status.jsx:3358 msgid "Post could be edited or deleted later." msgstr "" -#: src/components/status.jsx:3362 +#: src/components/status.jsx:3364 msgid "Preview" msgstr "" -#: src/components/status.jsx:3371 +#: src/components/status.jsx:3373 msgid "Note: This preview is lightly styled." msgstr "" #. [Name] [Visibility icon] boosted -#: src/components/status.jsx:3613 +#: src/components/status.jsx:3615 msgid "<0/> <1/> boosted" msgstr "" diff --git a/src/utils/emojify-text.js b/src/utils/emojify-text.js index 757920fb..3c8cd43d 100644 --- a/src/utils/emojify-text.js +++ b/src/utils/emojify-text.js @@ -8,7 +8,7 @@ function emojifyText(text, emojis = []) { const { shortcode, staticUrl, url } = emoji; text = text.replace( new RegExp(`:${shortcode}:`, 'g'), - `:${shortcode}:`, + `:${shortcode}:`, ); }); // console.log(text, emojis);