Skip to content

chore: Bump deps & replace size-plugin-core#138

Merged
rschristian merged 6 commits intomasterfrom
chore/bump-deps2
Mar 28, 2026
Merged

chore: Bump deps & replace size-plugin-core#138
rschristian merged 6 commits intomasterfrom
chore/bump-deps2

Conversation

@rschristian
Copy link
Copy Markdown
Member

@rschristian rschristian commented Mar 6, 2026

Supersedes #125

Mainly switches to a fork of size-plugin-core to cut down on unneeded weight. That plugin inlines some hefty (& outdated) modules that we don't make use of. Helps if we own/control it going forward too.

Had to bump Microbundle & Babel to avoid parsing errors in the vaguely modern syntax used, then needed to bump Jest to support ESM -- props to them for finally fixing some of the ESM-related woes, worked w/ no issues after the bump. Finally, had to bump CI & target Node version as the fork uses fs.globSync which was added in Node 22. Node 22 however isn't available for actions, so to Node 24 we go. This seems fine, the action is pretty isolated & self-contained.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Size Change: 0 B 🆕

Total Size: 0 B

compressed-size-action

@rschristian
Copy link
Copy Markdown
Member Author

rschristian commented Mar 6, 2026

Er, what? 0B? CI reports otherwise:

Current:

  Build "compressed-size-action" to .:
        40.5 kB: index.js.gz
        35.3 kB: index.js.br

Base:

  Build "compressedSizeAction" to .:
        76.2 kB: index.js.gz
        65.7 kB: index.js.br

Perhaps I broke something, shall go digging.

@rschristian rschristian marked this pull request as draft March 6, 2026 04:51
@rschristian rschristian force-pushed the chore/bump-deps2 branch 2 times, most recently from 93ece0a to aebfdfe Compare March 6, 2026 16:30
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Size Change: -35.6 kB (-46.8%) 🎉

Total Size: 40.5 kB

📦 View Changed
Filename Size Change
index.js 40.5 kB -35.6 kB (-46.8%) 🎉

compressed-size-action

Comment thread src/index.js
Comment on lines +67 to -71
const newSizes = await plugin.readFromDisk(cwd);

// In case the build step alters a JSON-file, ....
await exec(`git reset --hard`);

const newSizes = await plugin.readFromDisk(cwd);

Copy link
Copy Markdown
Member Author

@rschristian rschristian Mar 6, 2026

Choose a reason for hiding this comment

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

Technically a separate issue, though our repo being used as a test bed here brought it to light and it's a bit hard to demonstrate elsewhere.

We commit index.js to this repo, so we're tracking the artifact our action reports on. However, becasue we were running git reset --hard before collecting the new sizes (2 lines up), we actually were collecting the sizes already committed to this repo -- there would never be a size difference reported here.

Now this is a very niche but legitimate issue in any repo using this action to track artifacts that are committed.

Comment thread action.yml
default: 'build'
compression:
description: 'The compression algorithm to use: "gzip" or "brotli"'
default: 'gzip'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We were previously relying on size-plugin-core picking a default but I think we should be explicitly passing an option in ourselves

@rschristian rschristian marked this pull request as ready for review March 6, 2026 17:09
@rschristian rschristian changed the title chore: Bump Deps 2, Electric Boogaloo chore: Bump deps & replace size-plugin-core Mar 8, 2026
Comment thread package.json
Comment on lines +14 to +21
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@rschristian/size-plugin": "^0.1.0",
"@types/jest": "^30.0.0",
"babel-jest": "^30.2.0",
"jest": "^30.2.0",
"microbundle": "^0.15.1",
"pretty-bytes": "^5.4.1"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All had to be upgraded in tandem I'm afraid

@rschristian rschristian merged commit 61479db into master Mar 28, 2026
2 checks passed
@rschristian rschristian deleted the chore/bump-deps2 branch March 28, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant