Skip to content

Commit 5812e3a

Browse files
authored
perf: convert all images to avif (#1151)
1 parent ff3a3c1 commit 5812e3a

File tree

174 files changed

+518
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+518
-100
lines changed

app/routes/TryRoute.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ let default = () => {
5555
let data = ReactRouter.useLoaderData()
5656
<>
5757
<Meta
58-
title="ReScript Playground" description="Try ReScript in the browser" ogImage="/og/try.png"
58+
title="ReScript Playground" description="Try ReScript in the browser" ogImage="/og/try.avif"
5959
/>
6060

6161
{switch data {

image-converter.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
dir: "public", // Directory to scan for images
3+
converted: "*.{png,jpg,jpeg}", // Glob pattern for source image files to convert
4+
format: "avif", // Output image format: 'webp' or 'avif'
5+
quality: 80, // Quality of output images (0–100)
6+
recursive: true, // Whether to search subdirectories recursively
7+
removeOriginal: true, // Delete original files after successful conversion
8+
ignoreOnStart: false, // If true, ignore existing files on watcher startup
9+
};

markdown-pages/blog/archived/bucklescript-release-3-1-0.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ A picture's worth a thousand words:
2020
**Before:**
2121

2222
<img
23-
src="https://bucklescript.github.io/img/debugger-before.png"
23+
src="https://bucklescript.github.io/img/debugger-before.avif"
2424
alt="debugger before"
2525
/>
2626

2727
**After:**
2828

2929
<img
30-
src="https://bucklescript.github.io/img/debugger-after.png"
30+
src="https://bucklescript.github.io/img/debugger-after.avif"
3131
alt="debugger after"
3232
/>
3333

markdown-pages/blog/archived/bucklescript-release-4-0-17.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A picture is worth a thousand words, below is a large monorepo which contains
1717
4096 modules, changing the root node which has more than 3000 dependents, it
1818
finished building within 400ms.
1919

20-
<img src="https://bucklescript.github.io/img/incremental.png" />
20+
<img src="https://bucklescript.github.io/img/incremental.avif" />
2121

2222
We will write a dedicated article explaining how we achieve this incredible
2323
build performance.

markdown-pages/blog/archived/bucklescript-release-5-1-0.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ can be loaded into chrome via `chrome://tracing`.
8080

8181
Below is a profile image that shows the tracing graph for a large project:
8282

83-
<img src="https://bucklescript.github.io/img/profile-1.png" />
83+
<img src="https://bucklescript.github.io/img/profile-1.avif" />
8484

8585
And you can zoom-in to see more details:
8686

87-
<img src="https://bucklescript.github.io/img/profile-2.png" />
87+
<img src="https://bucklescript.github.io/img/profile-2.avif" />
8888

8989
## Support of ppx with arguments
9090

@@ -128,10 +128,10 @@ using `bstracing` to show a comparison of clean building a large project around
128128

129129
Version 5.0.6 (around 4.8s)
130130

131-
<img src="https://bucklescript.github.io/img/profile-5.png" />
131+
<img src="https://bucklescript.github.io/img/profile-5.avif" />
132132

133133
Version 5.1.0 (around 4.2s)
134134

135-
<img src="https://bucklescript.github.io/img/profile-4.png" />
135+
<img src="https://bucklescript.github.io/img/profile-4.avif" />
136136

137137
Happy hacking!

markdown-pages/blog/archived/bucklescript-release-5-2-0.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ system more valuable to JS target.
3838

3939
Below is an image showing the diff in this release
4040

41-
<img src="https://bucklescript.github.io/img/functor.png" />
41+
<img src="https://bucklescript.github.io/img/functor.avif" />
4242

4343
As you can see, the `id` module changed from an array into an JS object.
4444

@@ -57,7 +57,7 @@ annotate the generated JS code with its names.
5757

5858
Below is an image showing the diff in this release
5959

60-
<img src="https://bucklescript.github.io/img/pattern-match.png" />
60+
<img src="https://bucklescript.github.io/img/pattern-match.avif" />
6161

6262
In the future, we will explore if we can produce such annotation in the runtime without losing efficiency.
6363

@@ -72,7 +72,7 @@ including lazy evaluation, if branches and pattern match.
7272
In particular, we added a data-flow pass to eliminate non-necessary staticfail
7373
case.
7474

75-
<img src="https://bucklescript.github.io/img/staticfail.png" />
75+
<img src="https://bucklescript.github.io/img/staticfail.avif" />
7676

7777
## Important bug fixes
7878

markdown-pages/blog/archived/generalize-uncurry.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ message leaks the underlying encoding -- now all those limitations are gone!
5353
**Previously:**
5454

5555
<img
56-
src="/blog/archive/poly-error.png"
56+
src="/blog/archive/poly-error.avif"
5757
className="my-4 mx-auto max-h-[500px]"
5858
/>
5959

6060
<img
61-
src="/blog/archive/label-error.png"
61+
src="/blog/archive/label-error.avif"
6262
className="my-4 mx-auto max-h-[500px]"
6363
/>
6464

6565
<img
66-
src="/blog/archive/recursive-error.png"
66+
src="/blog/archive/recursive-error.avif"
6767
className="my-4 mx-auto max-h-[500px]"
6868
/>
6969

@@ -72,11 +72,14 @@ The error messages above are cryptic and hard to understand. And the limitation
7272
Now those limitations are all gone, you can have polymorphic uncurried recursive functions and it support labels.
7373

7474
<img
75-
src="/blog/archive/uncurry-label.png"
75+
src="/blog/archive/uncurry-label.avif"
7676
className="my-4 mx-auto max-h-[500px]"
7777
/>
7878

79-
<img src="/blog/archive/recursive.png" className="my-4 mx-auto max-h-[500px]" />
79+
<img
80+
src="/blog/archive/recursive.avif"
81+
className="my-4 mx-auto max-h-[500px]"
82+
/>
8083

8184
The error message is also enhanced significantly
8285

markdown-pages/blog/archived/state-of-reasonml-org-2020-q2-pt1.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
author: ryyppy
33
date: "2020-05-06"
4-
previewImg: /blog/archive/state-of-reasonml-org-q2-2020.jpg
5-
articleImg: /blog/archive/state-of-reasonml-pt1-hero.jpg
4+
previewImg: /blog/archive/state-of-reasonml-org-q2-2020.avif
5+
articleImg: /blog/archive/state-of-reasonml-pt1-hero.avif
66
title: State of reasonml.org 2020-Q2 / Pt. 1
77
description: |
88
A report on recent achievements in the reasonml.org project and what
@@ -51,7 +51,7 @@ The initial work was mostly about understanding the information architecture, re
5151

5252
<Image
5353
withShadow={true}
54-
src="/blog/archive/reasonml-org-color-palette-retina.jpg"
54+
src="/blog/archive/reasonml-org-color-palette-retina.avif"
5555
caption="Current state of the reasonml.org color palette"
5656
/>
5757

@@ -75,7 +75,7 @@ Our goal is to have a properly curated, well structured and streamlined overview
7575

7676
<Image
7777
withShadow={true}
78-
src="/blog/archive/reasonml-org-structure-retina.jpg"
78+
src="/blog/archive/reasonml-org-structure-retina.avif"
7979
caption="First hand-sketches of the reasonml.org structure"
8080
/>
8181

markdown-pages/blog/archived/state-of-reasonml-org-2020-q2-pt2.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
author: ryyppy
33
date: "2020-05-11"
4-
previewImg: /blog/archive/state-of-reasonml-org-q2-2020.jpg
5-
articleImg: /blog/archive/state-of-reasonml-2020-q2-pt2-articleimg.jpg
4+
previewImg: /blog/archive/state-of-reasonml-org-q2-2020.avif
5+
articleImg: /blog/archive/state-of-reasonml-2020-q2-pt2-articleimg.avif
66
title: State of reasonml.org 2020-Q2 / Pt. 2
77
description: |
88
A report on recent achievements in the reasonml.org project. This part is all

markdown-pages/blog/archived/state-of-reasonml-org-2020-q2-pt3.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
author: ryyppy
33
date: "2020-05-12"
4-
previewImg: /blog/archive/state-of-reasonml-org-q2-2020.jpg
4+
previewImg: /blog/archive/state-of-reasonml-org-q2-2020.avif
55
title: State of reasonml.org 2020-Q2 / Pt. 3
66
description: |
77
A report on recent achievements in the reasonml.org project. In this part we
@@ -35,7 +35,7 @@ We don't have any **search functionality** yet, and this will take some more tim
3535
There were some solutions, but still, Algolia turned out to be the best candidate with its smallest pricing tier. We don't want to rely on the Algolia OSS webscraping API, since it doesn't give us enough control on manipulating the search results, and we need more control if we want to be able to design a custom search experience.
3636

3737
<Image
38-
src="/blog/archive/search-mockup.jpg"
38+
src="/blog/archive/search-mockup.avif"
3939
withShadow={true}
4040
caption="A unified search overlay mockup for prose & API content"
4141
/>
@@ -47,7 +47,7 @@ We did the ground work for our search feature and we will get into more detail a
4747
We also invested a lot of time into thinking about the future of the Reason playground from a UX perspective. Our most important goal is to make it possible to switch BuckleScript versions on demand. We also wanted the relevant Reason version to be part of the playground bundle.
4848

4949
<Image
50-
src="/blog/archive/playground-mockup.jpg"
50+
src="/blog/archive/playground-mockup.avif"
5151
withShadow={true}
5252
caption="UI mockup for the new playground (Desktop version)"
5353
/>

0 commit comments

Comments
 (0)