Merge remote-tracking branch 'origin/main' into mg/new_privacy_policy

This commit is contained in:
Matt Godbolt
2025-07-31 18:03:06 -05:00
27 changed files with 52 additions and 1192 deletions
+2 -2
View File
@@ -493,7 +493,7 @@ const definitions: Record<LanguageKey, LanguageDefinition> = {
monaco: 'hylo',
extensions: ['.hylo'],
alias: [],
logoFilename: 'hylo.svg',
logoFilename: 'hylo.png',
logoFilenameDark: null,
formatter: null,
previewFilter: null,
@@ -607,7 +607,7 @@ const definitions: Record<LanguageKey, LanguageDefinition> = {
monaco: 'nim',
extensions: ['.nim'],
alias: [],
logoFilename: 'nim.svg',
logoFilename: 'nim.png',
logoFilenameDark: null,
formatter: null,
previewFilter: null,
+44
View File
@@ -0,0 +1,44 @@
# Logo Optimization Guidelines
This directory contains logos for programming languages displayed in Compiler Explorer. To maintain fast loading times and reasonable bundle sizes, logos should be optimized before adding them.
## Size Guidelines
- **Target size**: Keep individual logos under 20KB when possible
- **Maximum dimensions**: 256×256 pixels (preserving aspect ratio)
- **File formats**: SVG preferred for simple graphics, PNG for complex images
## Optimization Tools & Commands
### PNG Images
```bash
# Resize and optimize (preserves aspect ratio)
convert input.png -resize 256x256> -quality 85 output.png
# Alternative with pngquant for better compression
pngquant --quality=65-80 --output output.png input.png
```
### SVG Images
```bash
# Optimize with SVGO (install with: npm install -g svgo)
npx svgo input.svg --output output.svg
# For SVGs with embedded raster data, convert to PNG instead
convert input.svg -resize 256x256 -quality 85 output.png
```
## Common Issues
- **Embedded Base64 data in SVGs**: These are usually very large (300KB+). Convert to PNG instead.
- **Oversized PNGs**: Images over 1000px wide/tall should be resized to 256×256 or smaller.
- **16-bit PNGs**: Convert to 8-bit with `convert input.png -depth 8 output.png`
## Recent Optimizations
Examples of successful optimizations:
- `hylo.svg` (321KB) → `hylo.png` (27KB) - 92% reduction
- `nim.svg` (126KB) → `nim.png` (13KB) - 90% reduction
- `scala.png` (79KB) → optimized (14KB) - 82% reduction
Always test that optimized logos look good at small icon sizes (16-32px) in the UI.
Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

+1 -117
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 692 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 320 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 126 KiB

+1 -513
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 27 KiB

+1 -307
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 35 KiB

+1 -136
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+1 -1
View File
@@ -54,7 +54,7 @@ const hasGit = fs.existsSync(path.resolve(__dirname, '.git'));
// Hack alert: due to a variety of issues, sometimes we need to change
// the name here. Mostly it's things like webpack changes that affect
// how minification is done, even though that's supposed not to matter.
const webpackJsHack = '.v60.';
const webpackJsHack = '.v61.';
const plugins: Webpack.WebpackPluginInstance[] = [
new MonacoEditorWebpackPlugin({
languages: [