Merge remote-tracking branch 'origin/main' into mg/new_privacy_policy
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 692 B |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -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: [
|
||||
|
||||