Compare commits

..

1 Commits

Author SHA1 Message Date
lebaudantoine 443e0f9f7f ⚡️(frontend) serve illustrations as WebP with a PNG fallback
The three intro slider illustrations were the heaviest part of the
homepage. On a cold load of the production homepage (cache disabled),
the browser transferred 2.67 MB in total, of which 2.00 MB was these
three PNG files: 75% of the page weight, and about 3.5 times all the
JavaScript combined (579 kB).

HTTP compression cannot help here, PNG being already compressed. The
files are heavy because of the grain texture applied on the
illustrations, which a lossless format has to store pixel by pixel.

Encoded as WebP at quality 90, which preserves the grain, the three
slides go from 2.00 MB to 182 kB (-91%). The homepage cold load drops
from 2.67 MB to about 0.86 MB (-68%), and the illustrations now
account for about 21% of the transfer instead of 75%.

The fourth illustration, used on the recording screens, gets the same
treatment (721 kB to 84 kB).

We checked in PostHog that most of our users are on browser versions
supporting WebP. For the remaining ones, a new Picture primitive
renders a <picture> element with the WebP file as a source and the
original PNG as the <img> fallback, so nobody loses the illustrations.

Add webp to the nginx static assets location, otherwise the new files
would be served without the 30 days cache headers.
2026-11-16 00:56:03 +01:00
21 changed files with 126 additions and 40 deletions
+1 -3
View File
@@ -29,6 +29,7 @@ and this project adheres to
- 🍱(frontend) add Portuguese glyphs to Marianne subsetted fonts
- 🚸(frontend) bring new speakers to the top of the carousel
- 🚸(frontend) bring raised hands into view in the carousel
- ⚡️(frontend) serve illustrations as WebP with a PNG fallback
### Fixed
@@ -46,9 +47,6 @@ and this project adheres to
- 🐛(backend) allow muting when everyone_can_mute is stored as null #1942
- 🐛(frontend) apply the sans font token on every page
- 🐛(frontend) promote the active speaker in the carousel layout
- ♿️(frontend) show the focus ring on connection test detail cards
- ♿️(frontend) use a heading for every connection test card title
- ♿️(frontend) put the ProConnect link label inside the link
## [1.37.0] - 2026-11-01
-2
View File
@@ -61,8 +61,6 @@ La Suite Meet is fully self-hostable and released under the MIT License, ensurin
We’re continuously adding new features to enhance your experience, with the latest updates coming soon!
⭐ **Find La Suite Meet useful?** Click the Star button at the top right of this page. It helps other people and public organisations discover the project.
### 🚀 Major roll out to all French public servants
On the 29th of January 2026, Prime Minister Sébastien Lecornu, announced the full deployment of Visio—the French government’s dedicated Meet platform—to all public servants. ([Source in English](https://www.nytimes.com/2026/01/29/world/europe/france-zoom-alternative-visio.html))
+21
View File
@@ -16,6 +16,27 @@ the following command inside your docker container:
## [Unreleased]
### Illustrations served as WebP with a PNG fallback
The illustrations in `assets/intro-slider/` are now served as WebP, the PNG files being kept as a fallback for browsers
that do not support WebP.
> [!WARNING]
> If you override these illustrations, as described in [docs/theming.md](docs/theming.md), you must now provide a
> `.webp` file next to each `.png` one. Otherwise, your users see the default illustrations instead of yours, or broken
> images if the `.webp` files are missing from your mount.
Generate the WebP files from your PNG ones with [cwebp](https://developers.google.com/speed/webp/docs/cwebp), using the
same settings as the default illustrations:
```bash
for file in assets/intro-slider/*.png; do
cwebp -q 90 -m 6 "$file" -o "${file%.png}.webp"
done
```
If you maintain your own nginx configuration, add `webp` to the extensions of the `location ~* ^/assets/` block, as in
`src/frontend/default.conf`, so that the new files are served with the cache headers.
### Room access tokens moved to POST /join/
+1 -1
View File
@@ -33,7 +33,7 @@ server {
}
# Serve static files with caching
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|webp|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
}
+1 -1
View File
@@ -72,7 +72,7 @@ server {
}
# Serve static files with caching
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|webp|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
}
+16 -1
View File
@@ -80,9 +80,24 @@ For example, to replace the images used in the landing page carousel, provide yo
/usr/share/nginx/html/
└── assets/intro-slider/
├── 1.png
├── 1.webp
├── 2.png
├── 2.webp
├── 3.png
└── 4.png
├── 3.webp
├── 4.png
└── 4.webp
```
> [!WARNING]
> Each illustration must be provided in **both formats**. Browsers supporting WebP load the `.webp` file, the `.png`
> one is only a fallback for the others. If you override a `.png` without its `.webp` counterpart, most of your users
> keep seeing the default illustration, or a broken image if the `.webp` file is missing from your mount.
You can generate the WebP version of an illustration with [cwebp](https://developers.google.com/speed/webp/docs/cwebp):
```bash
cwebp -q 90 -m 6 1.png -o 1.webp
```
+1 -1
View File
@@ -11,7 +11,7 @@ server {
}
# Serve static files with caching
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|webp|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

@@ -4,7 +4,6 @@ import { cva } from '@/styled-system/css'
import { useTranslation } from 'react-i18next'
import { VStack } from '@/styled-system/jsx'
import { Link } from '@/primitives'
import { srOnly } from '@/styles/a11y'
// Styles per their documentation https://github.com/numerique-gouv/agentconnect-documentation/blob/main/doc_fs/bouton_proconnect.md
const proConnectButtonRecipe = cva({
@@ -36,11 +35,7 @@ export const ProConnectButton = ({ hint = true }: ProConnectButtonProps) => {
aria-label={t('proconnectButtonLabel')}
href={authUrl()}
data-attr="login"
>
{/* The label must sit between <a> and </a> (RGAA 6.2.1): the
visible wording only exists in the CSS background image. */}
<span className={srOnly}>{t('proconnectButtonLabel')}</span>
</RALink>
/>
{hint && (
<Link
to="https://agentconnect.gouv.fr/"
@@ -50,7 +50,7 @@ const triggerClass = css({
_hover: { backgroundColor: 'greyscale.50' },
'&[data-focus-visible]': {
outline: '2px solid {colors.focusRing}',
outlineOffset: '-2px!',
outlineOffset: '-2px',
},
})
@@ -139,12 +139,10 @@ export const ConnectionTestStepRow = ({
if (!hasLogs) {
return (
<div className={cardClass}>
<Heading level={3} className={cx(headingResetClass, rowClass)}>
<StepRowContent step={step} />
{/* Empty chevron column keeps non-expandable rows aligned. */}
<span />
</Heading>
<div className={cx(cardClass, rowClass)}>
<StepRowContent step={step} />
{/* Empty chevron column keeps non-expandable rows aligned. */}
<span />
</div>
)
}
@@ -1,6 +1,6 @@
import { styled } from '@/styled-system/jsx'
import { css } from '@/styled-system/css'
import { Button } from '@/primitives'
import { Button, Picture } from '@/primitives'
import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
@@ -30,12 +30,10 @@ const Body = styled('p', {
},
})
const Image = styled('img', {
base: {
maxHeight: '362px',
height: '100%',
width: 'fit-content',
},
const image = css({
maxHeight: '362px',
height: '100%',
width: 'fit-content',
})
const Dot = styled('div', {
@@ -165,7 +163,6 @@ const carouselNavButton = css({
},
})
// todo - optimize how images are imported
const SLIDES: Slide[] = [
{
key: 'slide1',
@@ -251,7 +248,13 @@ export const IntroSlider = () => {
visible={index === slideIndex}
key={index}
>
<Image src={slide.src} alt="" role="presentation" />
<Picture
src={slide.src}
webp
alt=""
role="presentation"
className={image}
/>
<TextAnimation visible={index == slideIndex}>
<Heading>{t(`${slide.key}.title`)}</Heading>
<Body>{t(`${slide.key}.body`)}</Body>
@@ -1,4 +1,4 @@
import { A, Div, H, Text } from '@/primitives'
import { A, Div, H, Picture, Text } from '@/primitives'
import { css } from '@/styled-system/css'
import { useTranslation } from 'react-i18next'
import { LoginPrompt } from './LoginPrompt'
@@ -45,8 +45,9 @@ export const NoAccessView = ({
flexDirection="column"
alignItems="center"
>
<img
<Picture
src={imagePath}
webp
alt=""
className={css({
minHeight: '250px',
@@ -1,4 +1,4 @@
import { Button, Div, Text } from '@/primitives'
import { Button, Div, Picture, Text } from '@/primitives'
import { css } from '@/styled-system/css'
import { useRoomId } from '@/features/rooms/livekit/hooks/useRoomId'
@@ -169,8 +169,9 @@ export const ScreenRecordingSidePanel = () => {
flexDirection="column"
alignItems="center"
>
<img
<Picture
src="/assets/intro-slider/4.png"
webp
alt=""
className={css({
minHeight: '250px',
@@ -1,4 +1,4 @@
import { A, Button, Div, Text } from '@/primitives'
import { A, Button, Div, Picture, Text } from '@/primitives'
import { css } from '@/styled-system/css'
import { useRoomId } from '@/features/rooms/livekit/hooks/useRoomId'
@@ -183,8 +183,9 @@ export const TranscriptSidePanel = () => {
flexDirection="column"
alignItems="center"
>
<img
<Picture
src="/assets/intro-slider/3.png"
webp
alt=""
className={css({
minHeight: '250px',
@@ -9,7 +9,7 @@ import { mediaUrl } from '@/api/mediaUrl'
import { useUser } from '@/features/auth/api/useUser'
import { UserAware } from '@/features/auth/components/UserAware'
import { Screen } from '@/layout/Screen'
import { H, LinkButton, Text } from '@/primitives'
import { H, LinkButton, Picture, Text } from '@/primitives'
import { formatDate } from '@/utils/formatDate'
import { ErrorScreen } from '@/components/ErrorScreen'
import { LoadingScreen } from '@/components/LoadingScreen'
@@ -118,8 +118,9 @@ const RecordingDownload = () => {
<Screen layout="centered" footer={false}>
<Center>
<VStack>
<img
<Picture
src="/assets/intro-slider/4.png"
webp
alt={''}
className={css({
maxHeight: '309px',
+53
View File
@@ -0,0 +1,53 @@
import {
type ComponentPropsWithoutRef,
type SyntheticEvent,
useState,
} from 'react'
import { css } from '@/styled-system/css'
const EXTENSION = /\.(png|jpe?g)$/i
export type PictureProps = Omit<ComponentPropsWithoutRef<'img'>, 'src'> & {
src: string
webp?: boolean
}
/**
* Renders an image. With `webp`, browsers supporting WebP load the WebP
* version of the image, `src` being the fallback for the others.
*
* A browser never falls back on its own when the WebP file fails to load, for
* instance when a deployment overrides an illustration without providing its
* WebP version. The WebP source is then dropped, so `src` gets loaded instead
* of leaving a broken image.
*
* The `<picture>` wrapper uses `display: contents`, so the `<img>` is laid out
* exactly as if it was rendered alone: style it through the usual props.
*/
export const Picture = ({
src,
webp = false,
alt,
onError,
...props
}: PictureProps) => {
const [failedWebpSrc, setFailedWebpSrc] = useState<string>()
const webpSrc =
webp && EXTENSION.test(src) ? src.replace(EXTENSION, '.webp') : undefined
const hasWebpSource = !!webpSrc && webpSrc !== failedWebpSrc
const handleError = (event: SyntheticEvent<HTMLImageElement, Event>) => {
if (hasWebpSource) {
setFailedWebpSrc(webpSrc)
return
}
onError?.(event)
}
return (
<picture className={css({ display: 'contents' })}>
{hasWebpSource && <source srcSet={webpSrc} type="image/webp" />}
<img src={src} alt={alt} onError={handleError} {...props} />
</picture>
)
}
+1
View File
@@ -23,6 +23,7 @@ export { Link } from './Link'
export { Menu } from './Menu'
export { MenuList } from './MenuList'
export { P } from './P'
export { Picture } from './Picture'
export { Popover } from './Popover'
export { ScreenReaderAnnouncer } from './ScreenReaderAnnouncer'
export { Text } from './Text'
@@ -80,7 +80,7 @@ data:
}
# Serve static files with caching
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|webp|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
}