Skip to content

v1.1.7 — Bundle size optimisations & refactoring

Choose a tag to compare

@Arindam200 Arindam200 released this 24 Mar 07:44

What's Changed

Performance

  • Tree-shaking — added "sideEffects": false to all four packages; bundlers can now safely drop unused modules
  • Component category sub-exports — 12 new granular entry points (termui/components/layout, /typography, /input, etc.) for importing only what you need
  • BigText font encoding — replaced verbose nested arrays with packed 3-bit row integers; font data is ~60% smaller before gzip

Build

  • tsconfig.build.json — new production tsconfig eliminating ~232 unnecessary .d.ts.map files from published dist
  • Adapter sourcemaps removed — corrected packages/adapters/tsup.config.ts to match the rest of the build
  • "files" field added to packages/core, packages/components, and packages/cli — npm now only publishes dist/ and README.md

Refactoring

  • QRCode encoder extracted to utility/qrEncoder.ts — ~420 lines of pure GF(256)/Reed-Solomon/matrix logic separated from the React component; GF lookup tables are now lazy-initialised
  • Shared chart utilitiesnormalize, clamp, padEnd, padStart extracted to charts/utils.ts; used by LineChart, Sparkline, Gauge, and BarChart
  • Shared time formattersformatElapsed and formatTime extracted to utility/formatters.ts; used by Stopwatch and Timer

Installation

npm install termui
# or
npx termui init

Full changelog: https://github.com/Arindam200/termui/blob/main/CHANGELOG.md