Olddevs UI4.14.0

Import cost

Import size

The package ships its source, and unused code is dropped by tree shaking: only what the consumer imported ends up in its bundle. Measured with npm run size on 2026-12-04 for version 4.14.0. The figures are the contribution of the package itself; React and the kit's third-party libraries are treated as external, and the metric is gzip:

What the consumer importsgzip
cn and tableStateToParams0.6 kB
one Button1.7 kB
DataTable9.9 kB
the whole kit (import *)79.7 kB
RichTextEditor from @olddevs/ui/editor, without the engine, "start"99.9 kB
RichTextEditor with the Tiptap engine, "start" (static graph, basic)332.8 kB
RichTextEditor with the Tiptap engine, "full" (with all lazy chunks, full)511.4 kB
RichTextView from @olddevs/ui/editor, Tiptap engine included in the measurement16.4 kB
sanitizeRichText and richTextSanitizeConfig from @olddevs/ui/editor/schema, Tiptap engine included7.0 kB
highlightCodeBlocks from @olddevs/ui/editor/highlight, with lowlight32.0 kB
highlightCodeNodes from @olddevs/ui/editor/highlight, with lowlight32.0 kB

The last seven rows are separate Editor entry points with their own budgets (ADR-0050). The Editor has three rows, and two of them are scenarios (ADR-0058, item 11.7): "start" is the static graph, what ships immediately and what the basic Preset costs; "full" is the same plus all the lazy chunks of the entry point, what full ends up loading. The code Block and the table (absent from basic, and their Extensions weigh more than 10 kB) load lazily; until they arrive, an Editor that includes them shows a Skeleton. npm run size checks that their modules are not in "start". The kit's own code is measured at "start".

In the scenarios the engine is included in the measurement on purpose: the consumer installs Tiptap, but the kit chooses the set of its extensions. With code Block highlighting, lowlight and fourteen highlight.js grammars are included too (ADR-0051). The figures in the table come from the same pipeline as the others (vite in library mode, where whitespace stays during minification); an app bundler with full minification produced about 133 kB (measured before the Toolbar).

For RichTextView, Tiptap and lowlight are included in the measurement as a check. Its row contains only typography, the Island of the "Copy" button on code Blocks (the kit's button and tooltip, the message catalog) and the search for formulas and video in the HTML with the loaders of their Islands; KaTeX and the player themselves are in lazy chunks that a page without formulas or video does not load. The measurement proves that its graph contains neither the engine nor a highlighter. The lightweight @olddevs/ui/editor/schema entry point is measured the same way (7.0 kB): the Schema, richTextSchema, the sanitizeRichText sanitizer with hooks for DOMPurify, including for the rules of custom Tools, and markRange.

Server-side highlighting in @olddevs/ui/editor/highlight (32.0 kB — almost entirely the highlight.js core and grammars) costs only an app that imports it, and usually only on the server. The highlightCodeNodes helper for CodeView weighs the same: React is not in the measurement (ADR-0052). An app that does not import the @olddevs/ui/editor entry point pays for neither the engine nor the Editor code; only the Editor's English labels in the shared message catalog reach the main entry point, about 1 kB gzip (ADR-0050, item 5).

The Editor's custom color Popover (ColorPicker and the color subsystem of react-aria-components, about 51 kB gzip) loads lazily on the first "Custom color…": it is not in "start", and "full" includes only the kit's own code, since react-aria is not in the measurement. The script does not drop the lazy chunks silently: it prints their weight on top of "start" next to each row. The chunks can be preloaded ahead of time: the consumer sets modulepreload on them.

The numbers are enforced in CI and checked against this table: npm run size measures the package's contribution and fails if the documentation has drifted from the measurement, and npm run check:consumer measures the First Load JS of a consumer app page. The budgets for both are in scripts/bundle-size.budgets.mjs.

If a component grew for a good reason, the budget goes up — in a separate line in the merge request, with an explanation of what exactly grew. A budget that is moved along with a component change stops enforcing anything within a couple of releases.

What is in the package

Details of the decision — ADR-0042.

Besides dist and styles.css, the sources (src, without stories) and their source maps are published. This does not affect the consumer's bundle by a single byte: only the imported code from dist goes to the browser, while the sources and maps are for tools — the debugger and the editor. The price is install size: on 3.47.3 the package weighs about 9.2 MB unpacked (the tarball is about 2.4 MB), of which the sources are about 2.7 MB (npm pack --dry-run).

What they buy is working debugging. Without src, the maps sat in the package as dead weight: they refer to the source by a relative path, the file was not there, and the debugger quietly showed compiled code. Now a breakpoint inside the kit opens the real .tsx — with comments that explain why the component is built the way it is — and "go to definition" leads there too, rather than to .d.ts.

This does not widen the public entry points: exports is a closed map, and import "@olddevs/ui/src/components/content/Link.tsx" is rejected by Node and by any exports-respecting bundler with ERR_PACKAGE_PATH_NOT_EXPORTED. The sources in the package are material for tools, not a second way to import the kit.

Since 3.8.0 the Reference ships next to them — the whole of docs/ and the llms.txt index at the package root (ADR-0044). The same trade as with the sources: not a single byte goes to the browser, and the install size grows by 2.5 MB unpacked (on 3.47.3). The point is the reader: a comment in the code explains why a component is built the way it is, while a Reference page answers what to pick and when, and before 3.8.0 the second question had no answer in the package at all.

Open the Reference straight from node_modules/@olddevs/ui/: start with llms.txt — the index of all the Reference pages — then follow the links. The Reference cannot be imported, any more than the sources: import "@olddevs/ui/docs/index.md" is rejected with the same ERR_PACKAGE_PATH_NOT_EXPORTED.

On this page