Skip to content

Commit b1057f6

Browse files
committed
add tsdoc
1 parent e9c4b79 commit b1057f6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

repo-scripts/size-analysis/analyze-all-bundles.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@ import * as tmp from 'tmp';
2222
import { Bundler, Mode, run as runBundleAnalysis } from './bundle-analysis';
2323
import { Report } from '../../scripts/size_report/report_binary_size';
2424

25+
/**
26+
* Runs bundle analysis for all bundle definition files under:
27+
*
28+
* `firebase-js-sdk/repo-scripts/size-analysis/bundle-definitions`
29+
*
30+
* The method accepts an optional parameter `version`:
31+
* 1. when presented (for example, `version` = '9.0.0'), this method measures the bundle size by
32+
* building test bundles with dependencies at that specific version downloaded from npm
33+
* 2. when omitted (in this case, `version` = null), this method measures the bundle size by
34+
* building test bundles with dependencies from local artifacts (e.g. produced by `yarn build`)
35+
*
36+
* #1 is intended only for manual runs for the purpose of back-filling historical size data. #2 is
37+
* intended for CI runs that measure size for the current commit.
38+
*
39+
* More details on how a test bundle is built can be found in `bundle-analysis.ts`.
40+
*
41+
* @param {string} [version] - If present, the SDK version to run measurement against
42+
* @returns {Promise<Report[]>} A list of bundle size measurements
43+
*/
2544
export async function generateReportForBundles(version?: string) {
2645
const definitionDir = `${__dirname}/bundle-definitions`;
2746
const outputDir = tmp.dirSync().name;

0 commit comments

Comments
 (0)