Skip to content

Commit

Permalink
perf: add dynamically loaded cache-dependencies module
Browse files Browse the repository at this point in the history
This reduces the main bundle size by ⚠️  1.1 MB minified! This bundle is loaded only when caching is enabled.

The reason for this huge reduction is that caching dependencies uses the `@actions/cache` package, which is an extremely large package with big dependencies.

`setup-python` is used in `setup-cpp` as a library. This optimization reduces the bundle size for that package as well.
  • Loading branch information
aminya committed Sep 20, 2024
1 parent 70dcb22 commit 63858ce
Show file tree
Hide file tree
Showing 6 changed files with 88,269 additions and 111,402 deletions.
2 changes: 1 addition & 1 deletion __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import path from 'path';
import {
validateVersion,
validatePythonVersionFormatForPyPy,
isCacheFeatureAvailable,
getVersionInputFromFile,
getVersionInputFromPlainFile,
getVersionInputFromTomlFile,
getNextPageUrl,
IS_WINDOWS,
getDownloadFileName
} from '../src/utils';
import {isCacheFeatureAvailable} from '../src/cache-dependencies';

jest.mock('@actions/cache');
jest.mock('@actions/core');
Expand Down
Loading

0 comments on commit 63858ce

Please sign in to comment.