Repository navigation
perf: shrink published package by ~3% (216.5 kB to 209.3 kB) - #322
Merged
Merged
Conversation
- Turn JSDoc on internal CSSNode/Lexer/arena/parser members into line comments so they no longer ship in dist - Share scan_matching_paren between AtRulePreludeParser and ConditionParser - Condense if() node type docs - Condense README API section (10.8 kB to 6.5 kB) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Keep the paren-matching dedupe out of the size-trimming work; it can land separately. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
🎉 Package Size Decrease
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.19.0 grew from 0.18.4 mostly because of new features (
if()support viaparse-condition.ts, a biggervalue-node-parser, nested@supports/style()groups) and the newnode-types,string-utilsandtoken-typessubpath entry points. This PR trims what can be trimmed without minifying and without touching hot paths.distsize (unpacked,pnpm build): 216.5 kB → 209.3 kB (about -3.3%), plus about 4 kB less README.Changes
/** */) on internalCSSNode,LexerandCSSDataArenamembers to//comments. JSDoc survives the build and was shipping in both the.jsand.d.tsfiles; line comments are stripped. Same idea as perf: make comments terser #273 and Convert JSDoc comments to line comments for internal APIs #298.CloneOptionsand other public types keep their JSDoc.IfConditionandIfBranchinnode-types.ts.Not included
stripInternalfor the.d.tsfiles. The dts build fails because public types referenceCSSDataArena.scan_matching_paren(identical inAtRulePreludeParserandConditionParser). It saves only about 0.4 kB, so it can land separately. An earlier commit on this branch did it and a later one reverts it.Test plan
pnpm exec vitest run(1496 tests pass)pnpm run checkpnpm run lintpnpm knippnpm run build(publint passes)pnpm run test-buildfinds no test files intest/build, with and without this changeGenerated by Claude Code