Add a subpath for every component, and fix a webpack build that dragged the library in.
def4b18Shipping a file per module in 1.2.0 fixed Turbopack — one <Button/> went from +77.3 kB gzip to +9.8 kB — but it moved the problem onto webpack, where the same page went the other way: +10.4 kB to +76.5 kB, framer-motion back in the bundle, Select.js and Calendar.js in a page that renders neither.
The barrel is the reason. Without a directive of its own it is a server module that imports twenty-six client modules, and Next's webpack builder turns every "use client" module it finds in the server graph into a client entry whether the export is used or not. Turbopack does not do this.
Putting "use client" back on the barrel fixes webpack and costs 67 kB gzip on Turbopack, where the barrel then becomes one client entry carrying all seventy-five exports — the 1.1.0 failure again. Measured, not assumed. So the barrel keeps no directive, and there are two ways past it instead:
- `kipui/button`, `kipui/table`, `kipui/radio-group` — every component now has its own subpath, named in kebab-case after the component. Importing one reaches one file and never touches the barrel, which fixes webpack with no configuration at all: 795.7 kB raw down to 574.2 kB, identical to what the barrel directive bought, with no cost under Turbopack.
- `experimental.optimizePackageImports: ["kipui"]` — for anyone who would rather keep importing from the root. It could not work in 1.1.0, when
distwas one pre-bundled file with no re-exports to rewrite; now that the barrel is a real barrel, it does, to the same number.
The root import stays the recommended one, and is unchanged for Turbopack users. typesVersions maps the subpaths for projects still on TypeScript's legacy node resolution, which cannot see an exports map. publint and @arethetypeswrong/cli are clean across all twenty-nine entry points.
Also moved Tooltip's "use client" above the eslint-disable comment it sat under. It worked — a directive may follow comments — but it depended on that staying true through every build step, and nothing would have failed loudly if it stopped.
The installation docs now cover all of this, including narrowing @source to the components you use, which cuts the generated CSS from about 98 kB to 42 kB in exchange for a line to maintain per component.