This page records how we measure @gurezo/web-serial-rxjs size and tree-shaking, and publishes a library-only snapshot. It is for adoption decisions. Numbers are reproducible snapshots — not a CI size budget or a guarantee that every app bundler will match these bytes.
Parent: #555 · Issue: #563 · Related: Bundler and framework compatibility · Version support
| Term | Meaning |
|---|---|
| Library-only | Size of this package’s code with rxjs external. The RxJS peer dependency is not included in primary numbers |
| npm pack tarball / unpacked | Footprint of the published package (runtime, types, README, LICENSE, icon, …) |
| Published artifact | dist/index.mjs as shipped (unminified ESM; rxjs already external at build time) |
| Consumer fixture | A tiny app entry that imports named exports and is bundled with esbuild for measurement |
| Tree-shaking | Unused named exports from this package are omitted from the consumer bundle |
| Metric | Why |
|---|---|
| npm pack tarball + unpacked | Adopt / cache cost of the published package |
dist/index.mjs raw / minified / gzip / brotli |
Runtime artifact without app code |
Minimal import (isWebSerialSupported only) |
Lower bound when most of the API is unused |
Session import (createSerialSession + isWebSerialSupported) |
Typical “use the session” surface |
| Tree-shake probe | Confirm unused exports (for example createTerminalBuffer) are absent from the minimal minified bundle |
rxjs separately; see Bundler and framework compatibilityScript (canonical): tools/bundle-size/ (README).
From the repository root:
pnpm --filter @gurezo/web-serial-rxjs build
node tools/bundle-size/measure.mjs
Conditions fixed by the script:
| Condition | Value |
|---|---|
| Bundler | workspace esbuild (version printed in the report) |
| Consumer resolve | symlink tools/bundle-size/.out/node_modules/@gurezo/web-serial-rxjs → package root (exports + sideEffects apply) |
| Peer handling | rxjs is always external |
| Minify | esbuild minify: true where labeled minified |
| gzip | Node zlib level 9 |
| brotli | Node brotli quality 11 |
| Output | stdout summary + tools/bundle-size/.out/report.json |
Recorded from node tools/bundle-size/measure.mjs after build.
| Field | Value |
|---|---|
| Package | @gurezo/web-serial-rxjs@4.0.3 |
| Measured at (UTC) | 2026-08-08T06:06:08.377Z |
| Node | v24.16.0 |
| esbuild | 0.28.1 |
package.json sideEffects |
false |
| Metric | Bytes |
|---|---|
| Tarball | 212,301 |
| Unpacked | 442,307 |
| Files | 65 |
Includes types, READMEs, LICENSE, icon, and dist/ — not a substitute for runtime-only size.
dist/index.mjs, library-only)| Form | raw | gzip | brotli |
|---|---|---|---|
| As published (unminified) | 45,138 | 10,200 | 8,862 |
| Minified (esbuild, measurement only) | 16,497 | 5,527 | 5,005 |
The npm artifact itself is not minified; the minified row is for adopters comparing compressed transfer sizes.
rxjs external)| Fixture | Form | raw | gzip | brotli |
|---|---|---|---|---|
isWebSerialSupported only |
raw | 13,416 | 3,836 | 3,180 |
isWebSerialSupported only |
minified | 3,501 | 1,244 | 1,090 |
createSerialSession + isWebSerialSupported |
raw | 43,688 | 9,876 | 8,579 |
createSerialSession + isWebSerialSupported |
minified | 16,206 | 5,448 | 4,942 |
sideEffects"sideEffects": false so bundlers that honor the field can treat the ESM entry as free of import-time side effects.createTerminalBuffer, DEFAULT_TERMINAL_BUFFER_OPTIONS, and SerialErrorCode.Re-run the script after API or build changes; update this page when publishing a new baseline.
tools/bundle-size/package.json (exports, sideEffects, peerDependencies)