VKCOM / icons

Набор SVG иконок, представленный в виде React компонентов.
https://vkcom.github.io/icons/
MIT License
131 stars 69 forks source link

feat(icons-scripts): isolationDeclarations #930

Closed SevereCloud closed 3 weeks ago

SevereCloud commented 4 months ago

Используем isolationDeclarations, ускоряем сборку иконок в полтора раза

cd packages/icons && hyperfine \
  --prepare 'git checkout master' \
    'yarn node scripts/build-icons.js # typescript' \
  --prepare 'git checkout SevereCloud/feat/isolationDeclarations' \
    'yarn node scripts/build-icons.js # swc isolationDeclarations'
Benchmark 1: yarn node scripts/build-icons.js # typescript
  Time (mean ± σ):     11.367 s ±  1.261 s    [User: 15.089 s, System: 4.191 s]
  Range (min … max):   10.223 s … 14.099 s    10 runs

Benchmark 2: yarn node scripts/build-icons.js # swc isolationDeclarations
  Time (mean ± σ):      6.771 s ±  0.780 s    [User: 7.585 s, System: 4.873 s]
  Range (min … max):    5.879 s …  8.501 s    10 runs

Summary
  yarn node scripts/build-icons.js # swc isolationDeclarations ran
    1.68 ± 0.27 times faster than yarn node scripts/build-icons.js # typescript

Изменения

Удалили из зависимостей typescript, заменили сборку *.d.ts на swc

github-actions[bot] commented 4 months ago

👀 Docs deployed

See the docs for this PR at https://vkcom.github.io/icons/pull/930/

github-actions[bot] commented 4 months ago

size-limit report 📦

Path Size
JS 3.97 MB (0%)
JS (gzip) 979.61 KB (0%)
JS (brotli) 703.14 KB (0%)
JS ES6 with Icon16Add only import (tree shaking) 5.67 KB (0%)
SVG 3.81 MB (0%)