actions / actions/toolkit

Shrink package sizes

Open
#1,893 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Thank you 🙇‍♀ for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.

If your issue is relevant to this repository, please include the information below:

Describe the enhancement
When pulling in @actions/glob (an 89KB package), it pulls in @actions/core (91KB package), fair enough. But... @actions/core depends on @actions/http-client, which has a 1.4MB install size due to pulling in Undici—which is already bundled in Node (but not all of it's exposed, so you do need the duplicate)!
I think it'd be reasonable to move getIDToken() to an @actions/oidc package to cut down on the size by 1.4MB, a >13x improvement (and switching to picomatch would also shave another 155B (~3x difference in size between the two), though it be might be too breaking?).
In comparison, tinyglobby (and all dependencies) is only 155KB, ~11x smaller than @actions/glob (and dependencies).

To both improve startup speed and the actions development experience, I'd say it'd make sense to shuffle some of this around.

Code Snippet
n/a

Additional information
Related: #1770 should allow tree shaking away these dependencies, although plenty of packages directly include node_modules (no build step) and the development install would still be large.
Node.js might expose ProxyAgent soon, allowing droppage of undici, once actions is bumped to 24 or whenever: nodejs/node#43187.
Codecov PR: codecov/codecov-action#1524 (I used tinyglobby instead, but they ended up switching to bash)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the dependency paths from @actions/glob through @actions/core and @actions/http-client, focusing on the getIDToken() entry point. Read related issue #1770 and compare the package-size concerns described here. Done means a reviewed dependency-splitting approach with its compatibility and size impact established.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
developer-experience, performance, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.