Ship smaller builds and stop publishing unplugin's test bundle - #92
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 4da16d4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe changes update package build output, package metadata, and Turbo task inputs. Generated JavaScript omits JSDoc comments, selected builds target ES2022, test entries are excluded, and release notes document smaller packages. ChangesBuild output and package metadata
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR reduces published package sizes by excluding the unplugin test bundle and removing JSDoc comments from JavaScript output while retaining declaration documentation.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code-triggered failures identified. The test exclusion retains every public unplugin adapter, the comment option affects JavaScript rather than declaration documentation, Turbo now tracks relevant configuration inputs, and the new side-effect metadata does not suppress any established module-evaluation requirement. Reviews (1): Last reviewed commit: "Ship smaller builds and stop publishing ..." | Re-trigger Greptile |
85b7af1 to
da9fc02
Compare
@saykit/config
@saykit/format-json
@saykit/format-po
saykit
@saykit/carbon
@saykit/react
babel-plugin-saykit
unplugin-saykit
@saykit/transform-js
@saykit/transform-jsx
commit: |
|
The preview build of |
Build settings and dependencies. The one source change is a Babel plugin reading
typesfrom the api object it is already handed.unplugin-saykitwas publishing its test suiteentry: ['src/index.ts', 'src/*.ts']matchedsrc/index.test.ts, sodist/index.test.mjs(538kb) and a bundledmagic-stringchunk shipped to npm. The glob now excludes tests: 574kb → 4kb.turbo never rebuilt on a config change
build.inputswas["src/**"], so edits totsdown.config.tsorpackage.jsonhit a stale cache and leftdistuntouched — the first rebuild after changing a config returned "7 cached" and stale output. Both are inputs now, along withtsconfig.json;checkgainedtsconfig.jsonandpackage.jsontoo.Doc comments move to the declarations
outputOptions: { comments: { jsdoc: false } }on every package. The comments a consumer reads in an editor come from the.d.mts/.d.cts, which keep every one of them. Nothing is minified — identifiers, formatting and//#regionmarkers survive, so a stack trace still points at readable code — and/* @__PURE__ */annotations are preserved for downstream tree-shaking.Two dependencies dropped
@babel/coreis now a peer ofbabel-plugin-saykit. It was a hard dependency for one runtime value,types, which Babel already passes to every plugin as its first argument. The import is now type-only. This is what everybabel-plugin-*does, it drops 1.1MB plus Babel's own tree from the install for anyone who already has Babel — which, for a plugin that only runs inside Babel, is everyone — and it removes any chance of the plugin running against a different copy of Babel than its host.vite-tsconfig-paths→ vitest's ownresolve.tsconfigPaths, which vitest 4 had started warning about.Also
saykitand@saykit/reacttarget ES2022 rather than ES2020. Below ES2022 a#privatefield is lowered to aWeakMapper field plus accessor helpers, which cost 2.8kb in the runtime alone."sideEffects": falseonsaykitand@saykit/carbon. Deliberately not on@saykit/react:src/runtime/server.tsopens withimport 'server-only', a bare side-effect import whose whole job is to throw when it reaches a client bundle, and declaring the package side-effect-free invites a bundler to drop exactly that guard.What was measured and rejected
js-sha256(125kb) looked like an easy swap fornode:crypto'screateHash, and the ids came out byte-identical, but the playground threw "[unenv] crypto.createHash is not implemented yet!" —unenvleaves that entry point unimplemented, so any Nitro or workerd build of a saykit plugin would break. It is now hashed in userland again, with a comment recording why, since the Web Crypto equivalent is async and an id is resolved from a synchronous extraction pass.minifyin any form, whole-comment stripping, tuned treeshake options,noExternal,platform: 'neutral'— each either bought nothing over what rolldown already does, or cost readability or@__PURE__annotations for under 100 bytes.Two source-level dedups in
saykitwere tried and reverted: foldingnumber()/datetime()invalues.tsinto one factory (−175 bytes minified, +7 gzipped) and collapsing the six macro stubs' repeated error string into a helper (−376 bytes minified, +6 gzipped). gzip already deduplicates both, so each traded free repetition for structure that is not free.Bundled size of
saykitwith its dependencies is unchanged at 20.5kb gzipped — a consumer's bundler was already stripping the comments, and the project's own code is only 3.4kb of that. Moving the number means addressing dependencies: the MF1 parser andmooare 5.0kb gzipped, the two skeleton parsers 5.3kb, andmessageformat7.2kb — the last of which is largelyDefaultFunctionsand the MF2 syntax parser, neither of which this runtime uses but neither of which can be tree-shaken through the public API.🤖 Generated with Claude Code