Preload Inter font to avoid FOIT on slow connections - #17039
Conversation
jryans
left a comment
There was a problem hiding this comment.
Looks reasonable overall, thanks for the update as well. 😄
| }), | ||
|
|
||
| new HtmlWebpackInjectPreload({ | ||
| files: [{ match: /.*\.(woff2?|ttf|eot)$/ }], |
There was a problem hiding this comment.
Hmm, perhaps you could add Inter to the match expression as well, and then skip the conditional in the template? Right now we seem to have half the path in one place, and half in another.
There was a problem hiding this comment.
No doubt that the logic is a bit scattered currently.
However even if I was to change the files that HtmlWebpackInjectPreload matches I would still have to do some filtering.
HtmlWebpackPlugin is designed at first to create a bunch of tags to inject in the <head> of right before the </body>.
However if we look at the plugin definition for src/vector/index.html we can read
{
// ...
// we inject the links ourselves via the template, because
// HtmlWebpackPlugin will screw up our formatting like the names
// of the themes and which chunks we actually care about.
inject: false
}Changing how the entry point is fundamentally generated seems out of scope for this task but I agree with you, would probably need some attention in the future
Changes in [1.7.29](https://github.com/vector-im/element-web/releases/tag/v1.7.29) (2021-05-24) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.29-rc.1...v1.7.29) ## Security notice Element Web 1.7.29 fixes (by upgrading to olm 3.2.3) an issue in code used for decrypting server-side stored secrets. The issue could potentially allow a malicious homeserver to cause a stack buffer overflow in the affected function and to control that function's local variables. ## All changes * Upgrade to React SDK 3.22.0 and JS SDK 11.1.0 * [Release] Bump libolm dependency, and update package name [\#17456](element-hq/element-web#17456) Changes in [1.7.29-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.29-rc.1) (2021-05-19) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.28...v1.7.29-rc.1) * Upgrade to React SDK 3.22.0-rc.1 and JS SDK 11.1.0-rc.1 * Translations update from Weblate [\#17384](element-hq/element-web#17384) * Prevent minification of `.html` files [\#17349](element-hq/element-web#17349) * Update matrix-widget-api/react-sdk dependency reference [\#17346](element-hq/element-web#17346) * Add `yarn start:https` [\#16989](element-hq/element-web#16989) * Translations update from Weblate [\#17239](element-hq/element-web#17239) * Remove "in development" flag from voice messages labs documentation [\#17204](element-hq/element-web#17204) * Add required webpack+jest config to load Safari support modules [\#17193](element-hq/element-web#17193) Changes in [1.7.28](https://github.com/vector-im/element-web/releases/tag/v1.7.28) (2021-05-17) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.28-rc.1...v1.7.28) ## Security notice Element Web 1.7.28 fixes (by upgrading to matrix-react-sdk 3.21.0) a low severity issue (GHSA-8796-gc9j-63rv) related to file upload. When uploading a file, the local file preview can lead to execution of scripts embedded in the uploaded file, but only after several user interactions to open the preview in a separate tab. This only impacts the local user while in the process of uploading. It cannot be exploited remotely or by other users. Thanks to [Muhammad Zaid Ghifari](https://github.com/MR-ZHEEV) for responsibly disclosing this via Matrix's Security Disclosure Policy. ## All changes * Upgrade to React SDK 3.21.0 and JS SDK 11.0.0 Changes in [1.7.28-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.28-rc.1) (2021-05-11) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.27...v1.7.28-rc.1) * Upgrade to React SDK 3.21.0-rc.1 and JS SDK 11.0.0-rc.1 * Switch back to release version of `sanitize-html` [\#17231](element-hq/element-web#17231) * Bump url-parse from 1.4.7 to 1.5.1 [\#17199](element-hq/element-web#17199) * Bump lodash from 4.17.20 to 4.17.21 [\#17205](element-hq/element-web#17205) * Bump hosted-git-info from 2.8.8 to 2.8.9 [\#17219](element-hq/element-web#17219) * Disable host checking on the webpack dev server [\#17194](element-hq/element-web#17194) * Bump ua-parser-js from 0.7.23 to 0.7.24 [\#17190](element-hq/element-web#17190) Changes in [1.7.27](https://github.com/vector-im/element-web/releases/tag/v1.7.27) (2021-05-10) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.27-rc.1...v1.7.27) * Upgrade to React SDK 3.20.0 and JS SDK 10.1.0 Changes in [1.7.27-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.27-rc.1) (2021-05-04) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.26...v1.7.27-rc.1) * Upgrade to React SDK 3.20.0-rc.1 and JS SDK 10.1.0-rc.1 * Translations update from Weblate [\#17160](element-hq/element-web#17160) * Document option for obeying asserted identity [\#17008](element-hq/element-web#17008) * Implement IPC call to Electron to set language [\#17052](element-hq/element-web#17052) * Convert Vector skin react components to Typescript [\#17061](element-hq/element-web#17061) * Add code quality review policy [\#16980](element-hq/element-web#16980) * Register RecorderWorklet from react-sdk [\#17013](element-hq/element-web#17013) * Preload Inter font to avoid FOIT on slow connections [\#17039](element-hq/element-web#17039) * Disable `postcss-calc`'s noisy `warnWhenCannotResolve` option [\#17041](element-hq/element-web#17041)
Changes in [1.7.29](https://github.com/vector-im/element-web/releases/tag/v1.7.29) (2021-05-24) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.29-rc.1...v1.7.29) ## Security notice Element Web 1.7.29 fixes (by upgrading to olm 3.2.3) an issue in code used for decrypting server-side stored secrets. The issue could potentially allow a malicious homeserver to cause a stack buffer overflow in the affected function and to control that function's local variables. ## All changes * Upgrade to React SDK 3.22.0 and JS SDK 11.1.0 * [Release] Bump libolm dependency, and update package name [\#17456](element-hq/element-web#17456) Changes in [1.7.29-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.29-rc.1) (2021-05-19) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.28...v1.7.29-rc.1) * Upgrade to React SDK 3.22.0-rc.1 and JS SDK 11.1.0-rc.1 * Translations update from Weblate [\#17384](element-hq/element-web#17384) * Prevent minification of `.html` files [\#17349](element-hq/element-web#17349) * Update matrix-widget-api/react-sdk dependency reference [\#17346](element-hq/element-web#17346) * Add `yarn start:https` [\#16989](element-hq/element-web#16989) * Translations update from Weblate [\#17239](element-hq/element-web#17239) * Remove "in development" flag from voice messages labs documentation [\#17204](element-hq/element-web#17204) * Add required webpack+jest config to load Safari support modules [\#17193](element-hq/element-web#17193) Changes in [1.7.28](https://github.com/vector-im/element-web/releases/tag/v1.7.28) (2021-05-17) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.28-rc.1...v1.7.28) ## Security notice Element Web 1.7.28 fixes (by upgrading to matrix-react-sdk 3.21.0) a low severity issue (GHSA-8796-gc9j-63rv) related to file upload. When uploading a file, the local file preview can lead to execution of scripts embedded in the uploaded file, but only after several user interactions to open the preview in a separate tab. This only impacts the local user while in the process of uploading. It cannot be exploited remotely or by other users. Thanks to [Muhammad Zaid Ghifari](https://github.com/MR-ZHEEV) for responsibly disclosing this via Matrix's Security Disclosure Policy. ## All changes * Upgrade to React SDK 3.21.0 and JS SDK 11.0.0 Changes in [1.7.28-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.28-rc.1) (2021-05-11) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.27...v1.7.28-rc.1) * Upgrade to React SDK 3.21.0-rc.1 and JS SDK 11.0.0-rc.1 * Switch back to release version of `sanitize-html` [\#17231](element-hq/element-web#17231) * Bump url-parse from 1.4.7 to 1.5.1 [\#17199](element-hq/element-web#17199) * Bump lodash from 4.17.20 to 4.17.21 [\#17205](element-hq/element-web#17205) * Bump hosted-git-info from 2.8.8 to 2.8.9 [\#17219](element-hq/element-web#17219) * Disable host checking on the webpack dev server [\#17194](element-hq/element-web#17194) * Bump ua-parser-js from 0.7.23 to 0.7.24 [\#17190](element-hq/element-web#17190) Changes in [1.7.27](https://github.com/vector-im/element-web/releases/tag/v1.7.27) (2021-05-10) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.27-rc.1...v1.7.27) * Upgrade to React SDK 3.20.0 and JS SDK 10.1.0 Changes in [1.7.27-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.27-rc.1) (2021-05-04) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.26...v1.7.27-rc.1) * Upgrade to React SDK 3.20.0-rc.1 and JS SDK 10.1.0-rc.1 * Translations update from Weblate [\#17160](element-hq/element-web#17160) * Document option for obeying asserted identity [\#17008](element-hq/element-web#17008) * Implement IPC call to Electron to set language [\#17052](element-hq/element-web#17052) * Convert Vector skin react components to Typescript [\#17061](element-hq/element-web#17061) * Add code quality review policy [\#16980](element-hq/element-web#16980) * Register RecorderWorklet from react-sdk [\#17013](element-hq/element-web#17013) * Preload Inter font to avoid FOIT on slow connections [\#17039](element-hq/element-web#17039) * Disable `postcss-calc`'s noisy `warnWhenCannotResolve` option [\#17041](element-hq/element-web#17041)
Changes in [1.7.29](https://github.com/vector-im/element-web/releases/tag/v1.7.29) (2021-05-24) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.29-rc.1...v1.7.29) ## Security notice Element Web 1.7.29 fixes (by upgrading to olm 3.2.3) an issue in code used for decrypting server-side stored secrets. The issue could potentially allow a malicious homeserver to cause a stack buffer overflow in the affected function and to control that function's local variables. ## All changes * Upgrade to React SDK 3.22.0 and JS SDK 11.1.0 * [Release] Bump libolm dependency, and update package name [\#17456](element-hq/element-web#17456) Changes in [1.7.29-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.29-rc.1) (2021-05-19) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.28...v1.7.29-rc.1) * Upgrade to React SDK 3.22.0-rc.1 and JS SDK 11.1.0-rc.1 * Translations update from Weblate [\#17384](element-hq/element-web#17384) * Prevent minification of `.html` files [\#17349](element-hq/element-web#17349) * Update matrix-widget-api/react-sdk dependency reference [\#17346](element-hq/element-web#17346) * Add `yarn start:https` [\#16989](element-hq/element-web#16989) * Translations update from Weblate [\#17239](element-hq/element-web#17239) * Remove "in development" flag from voice messages labs documentation [\#17204](element-hq/element-web#17204) * Add required webpack+jest config to load Safari support modules [\#17193](element-hq/element-web#17193) Changes in [1.7.28](https://github.com/vector-im/element-web/releases/tag/v1.7.28) (2021-05-17) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.28-rc.1...v1.7.28) ## Security notice Element Web 1.7.28 fixes (by upgrading to matrix-react-sdk 3.21.0) a low severity issue (GHSA-8796-gc9j-63rv) related to file upload. When uploading a file, the local file preview can lead to execution of scripts embedded in the uploaded file, but only after several user interactions to open the preview in a separate tab. This only impacts the local user while in the process of uploading. It cannot be exploited remotely or by other users. Thanks to [Muhammad Zaid Ghifari](https://github.com/MR-ZHEEV) for responsibly disclosing this via Matrix's Security Disclosure Policy. ## All changes * Upgrade to React SDK 3.21.0 and JS SDK 11.0.0 Changes in [1.7.28-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.28-rc.1) (2021-05-11) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.27...v1.7.28-rc.1) * Upgrade to React SDK 3.21.0-rc.1 and JS SDK 11.0.0-rc.1 * Switch back to release version of `sanitize-html` [\#17231](element-hq/element-web#17231) * Bump url-parse from 1.4.7 to 1.5.1 [\#17199](element-hq/element-web#17199) * Bump lodash from 4.17.20 to 4.17.21 [\#17205](element-hq/element-web#17205) * Bump hosted-git-info from 2.8.8 to 2.8.9 [\#17219](element-hq/element-web#17219) * Disable host checking on the webpack dev server [\#17194](element-hq/element-web#17194) * Bump ua-parser-js from 0.7.23 to 0.7.24 [\#17190](element-hq/element-web#17190) Changes in [1.7.27](https://github.com/vector-im/element-web/releases/tag/v1.7.27) (2021-05-10) =============================================================================================== [Full Changelog](element-hq/element-web@v1.7.27-rc.1...v1.7.27) * Upgrade to React SDK 3.20.0 and JS SDK 10.1.0 Changes in [1.7.27-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.27-rc.1) (2021-05-04) ========================================================================================================= [Full Changelog](element-hq/element-web@v1.7.26...v1.7.27-rc.1) * Upgrade to React SDK 3.20.0-rc.1 and JS SDK 10.1.0-rc.1 * Translations update from Weblate [\#17160](element-hq/element-web#17160) * Document option for obeying asserted identity [\#17008](element-hq/element-web#17008) * Implement IPC call to Electron to set language [\#17052](element-hq/element-web#17052) * Convert Vector skin react components to Typescript [\#17061](element-hq/element-web#17061) * Add code quality review policy [\#16980](element-hq/element-web#16980) * Register RecorderWorklet from react-sdk [\#17013](element-hq/element-web#17013) * Preload Inter font to avoid FOIT on slow connections [\#17039](element-hq/element-web#17039) * Disable `postcss-calc`'s noisy `warnWhenCannotResolve` option [\#17041](element-hq/element-web#17041)
Fixes #12114
This pull requests adds
<link rel="preload" />to avoid FOIT (Flash Of Invisible Text) on slow connections.html-webpack-pluginhas been upgraded tov4.5.2. The previous versionv3.2.0was marked as deprecated and not compatible with a lot of newer webpack plugins. You can check the4.0.0release blog post for a summary of the breaking changeshtml-webpack-inject-preloadwhich is a recommended plugin from thehtml-webpack-pluginREADMEBecause the
HtmlWebpackPluginis instanciated withinject: falsewe have to manually iterate through the entries and add the link tags.I decided to only preload the
Interfont onindex.htmlas the other pages will likely not suffer the same issue