Skip to content

Size Analysis Tool - Phase 1 #3588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 11, 2020
Merged
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
4 changes: 3 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@firebase/app-types-exp",
"@firebase/functions-exp",
"@firebase/functions-types-exp",
"firebase-exp"
"firebase-exp",
"@firebase/changelog-generator",
"firebase-size-analysis"
],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true,
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"packages": [
"packages/*",
"packages-exp/*",
"integration/*"
"integration/*",
"repo-scripts/*"
],
"useWorkspaces": true
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"size-report": "node scripts/report_binary_size.js",
"api-report": "lerna run --scope @firebase/*-exp api-report",
"docgen:exp": "ts-node-script scripts/exp/docgen.ts",
"postinstall": "yarn --cwd repo-scripts/changelog-generator build"
"postinstall": "yarn --cwd repo-scripts/changelog-generator build",
"sa": "ts-node-script repo-scripts/size-analysis/analysis.ts"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -154,4 +155,4 @@
"pre-commit": "node tools/gitHooks/precommit.js"
}
}
}
}
26 changes: 26 additions & 0 deletions repo-scripts/size-analysis/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
extends: '../../config/.eslintrc.js',
parserOptions: {
project: 'tsconfig.json',
// to make vscode-eslint work with monorepo
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
tsconfigRootDir: __dirname
}
};
28 changes: 28 additions & 0 deletions repo-scripts/size-analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Modular Export Binary Size Calculator

## Command Line Option

- `--version` Show version number [boolean]
- `--inputModule, --im` The name of the module(s) to be analyzed. example: --inputModule "@firebase/functions-exp" "firebase/auth-exp" [array]
- `--inputDtsFile, --if` Support for adhoc analysis. requires a path to dts file [string]
- `--inputBundleFile, --ib` Support for adhoc analysis. requires a path to a bundle file [string]
- `--output, -o` The location where report(s) will be generated, a directory path if module(s) are analyzed; a file path if ad hoc analysis is to be performed [string]
- `--help ` Show help [boolean]



## Commands To Run The Tool

### Adhoc Support

$firebase-js-sdk/repo-scripts/size-analysis `ts-node-script analysis.ts --if <path to dts file> --ib <path to bundle file> -o <path to output FILE>`

### To Do Analysis On One to Many Firebase Modules

$firebase-js-sdk/repo-scripts/size-analysis `ts-node-script analysis.ts --im "@firebase/module1-exp" "@firebase/module2-exp" -o <path to output DIRECTORY>`

### To Do Analysis On All Firebase-Exp Modules

$firebase-js-sdk/repo-scripts/size-analysis `ts-node-script analysis.ts -o <path to output DIRECTORY>`


Loading