Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 5
groups:
size-limit:
patterns:
- "size-limit"
- "@size-limit/*"


- package-ecosystem: "npm" # See documentation for possible values
Expand Down
26 changes: 13 additions & 13 deletions .size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,57 @@
{
"name": "es5-full",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "37.75 kb",
"limit": "55.5 kb",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot WHY are you increasing these values?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because size-limit 14 changes how these checks are measured. @size-limit/preset-small-lib moved to rolldown by default in v14, so the reported bundle sizes increased even though the library code did not. I raised only the limits that started failing so npm run size would pass with the new toolchain.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Why does rolldown cause the bundle size to be larger

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because @size-limit/preset-small-lib switched from esbuild in 13.1.1 to rolldown in 14.0.0. Different bundlers make different tree-shaking, interop, and minification choices, so the measured bundled output can change even when this repo’s source code does not. In this PR the increase looks like toolchain drift from that bundler swap, not a library code-size regression.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot my question is not a generic why, I want an analysis of what is not being tree-shaken

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dug into the actual saved size-limit bundles from 13.1.1 vs 14.0.0 for this repo. For the selective cases ({ getWindow } and the es5-env import set), I do not see an unrelated module/API staying live — both versions pull the same dependency closure around the lazy global lookup/cache helpers (safe, _getGlobalValue, _getGlobalConfig, cached-value wrapper, lazy accessor). The big difference is that the 14.0.0 rolldown output is much less aggressively collapsed/minified: es5-env goes from 1303B to 1690B, getWindow from 927B to 1126B, and the full bundle from 37657B to 55351B. So my current read is: this is not one obvious thing failing to tree-shake; it’s mostly a bundler/output-optimization difference in the new preset.

"brotli": false,
"running": false
},
{
"name": "es6-full",
"path": "lib/dist/es6/mod/ts-utils.js",
"limit": "36.5 kb",
"limit": "54.5 kb",
"brotli": false,
"running": false
},
{
"name": "es5-full-brotli",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "13 kb",
"limit": "15.25 kb",
"brotli": true,
"running": false
},
{
"name": "es6-full-brotli",
"path": "lib/dist/es6/mod/ts-utils.js",
"limit": "12.75 kb",
"limit": "15.25 kb",
"brotli": true,
"running": false
},
{
"name": "es5-zip",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "14.5 Kb",
"limit": "16.8 Kb",
"gzip": true,
"running": false
},
{
"name": "es6-zip",
"path": "lib/dist/es6/mod/ts-utils.js",
"limit": "14 Kb",
"limit": "16.7 Kb",
"gzip": true,
"running": false
},
{
"name": "es5-env",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "1.5 kb",
"limit": "1.7 kb",
"import": "{ getGlobal, getInst, hasDocument, getDocument, hasWindow, getWindow, hasNavigator, getNavigator, hasHistory, getHistory, isNode, isWebWorker }",
"brotli": false,
"running": false
},
{
"name": "es5-is",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "700b",
"limit": "1 kb",
"import": "{ isString, isFunction, isObject, isArray, isDate, isRegExp, isBoolean, isNumber, isNullOrUndefined, isUndefined }",
"brotli": false,
"running": false
Expand All @@ -68,7 +68,7 @@
{
"name": "es5-poly",
"path": "lib/bundle/es5/ts-polyfills-utils.js",
"limit": "12 kb",
"limit": "15.1 kb",
"brotli": false,
"running": false
},
Expand All @@ -83,7 +83,7 @@
{
"name": "es5-getWindow",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "500 b",
"limit": "510 b",
"import": "{ getWindow }",
"gzip": true,
"running": false
Expand All @@ -107,23 +107,23 @@
{
"name": "es5-scheduleMicrotask",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "1.75 kb",
"limit": "1.8 kb",
"import": "{ scheduleMicrotask }",
"gzip": true,
"running": false
},
{
"name": "es5-scheduleNextTick",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "2 kb",
"limit": "2.05 kb",
"import": "{ scheduleNextTick }",
"gzip": true,
"running": false
},
{
"name": "es5-scheduleNextTickAndMicrotask",
"path": "lib/dist/es5/mod/ts-utils.js",
"limit": "2 kb",
"limit": "2.05 kb",
"import": "{ scheduleNextTick, scheduleMicrotask }",
"gzip": true,
"running": false
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-strip": "^3.0.2",
"@rollup/plugin-typescript": "^12.1.0",
"@size-limit/esbuild-why": "^13.0.1",
"@size-limit/preset-small-lib": "^13.0.1",
"@size-limit/time": "^13.0.1",
"@size-limit/esbuild-why": "^14.0.0",
"@size-limit/preset-small-lib": "^14.0.0",
"@size-limit/time": "^14.0.0",
"@types/eslint": "^8.56.10",
"@types/estree": "^1.0.0",
"@types/mocha": "^10.0.1",
Expand Down Expand Up @@ -289,7 +289,7 @@
"rollup-plugin-minify-es": "^1.1.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"sinon": "^15.0.0",
"size-limit": "^13.0.1",
"size-limit": "^14.0.0",
"ts-mocha": "^11.1.0",
"tslib": "^2.6.0",
"typedoc": "^0.28.18",
Expand Down