Skip to content

Modular Export Binary Size Analysis - WIP #3280

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

Closed
wants to merge 168 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
227941c
Initial submit of auth-next framework (#2851)
sam-gc Apr 3, 2020
372d7c0
Add mock fetch helper (#2878)
sam-gc Apr 7, 2020
b359033
Add core types & error map to auth-exp (#2890)
avolkovi Apr 10, 2020
e0bb970
Add signUp API method for auth-next (#2892)
avolkovi Apr 13, 2020
a852021
Add initial user object implementation (#2896)
sam-gc Apr 14, 2020
0ae5fa5
Consolidate mock auth object, add user object (#2906)
sam-gc Apr 14, 2020
19735c0
Add remaining API methods to auth-next (#2901)
avolkovi Apr 15, 2020
6044bbc
Add support for API timeouts to auth-next (#2915)
avolkovi Apr 16, 2020
22405fd
Add version helpers to auth-next (#2910)
avolkovi Apr 16, 2020
36632e9
Add persistence layer: index db, in memory, and browser{local, sessio…
sam-gc Apr 16, 2020
e6bfb6a
Add fetchSignInMethodsForEmail to auth-next (#2924)
avolkovi Apr 17, 2020
8a178d0
Add sendEmailVerification to auth-next (#2926)
avolkovi Apr 20, 2020
a3a7281
Add a persistence manager class (#2925)
sam-gc Apr 20, 2020
c5174ab
Added react native build target (#2947)
scottcrossen Apr 21, 2020
e43b2cf
Add password reset methods to auth-next (#2928)
avolkovi Apr 21, 2020
7aead1c
use queryString helper in auth-next (#2936)
avolkovi Apr 21, 2020
290d97d
Initial auth object implementation + initializeAuth() (#2932)
sam-gc Apr 22, 2020
1c4734b
use app-exp in the build:deps script
Feiyang1 Apr 22, 2020
6515d58
Add conditional delays to auth-next (#2934)
avolkovi Apr 23, 2020
9342be4
Add sendSignInWithEmail to auth-next (#2960)
avolkovi Apr 23, 2020
deab6e3
Add auth listener implementation, add user.reload() (#2961)
sam-gc Apr 23, 2020
e77959e
Standardize auth-next style (#2983)
avolkovi Apr 24, 2020
30b7dab
Add refresh token endpoint + implementation to token manager (#2975)
sam-gc May 4, 2020
c3a82f6
Add react native persistence class (#2955)
scottcrossen May 4, 2020
9b26963
Add getIdTokenResult implementation (#3014)
sam-gc May 5, 2020
12e7465
Update internal types to work with external types (#3075)
sam-gc May 15, 2020
b278cea
Further refactoring of auth types. Add public exports to src/index.ts…
sam-gc May 19, 2020
7b297c5
user.delete() implementation (#3072)
sam-gc May 19, 2020
e71513a
Use auth impl object instead of mock auth object (#3098)
sam-gc May 21, 2020
06847d8
Add signInWithCredential to auth-next (#2963)
avolkovi May 27, 2020
cb58a66
Refactor so every unit test gets its own Auth object (#3129)
sam-gc May 28, 2020
ab5b7d3
Add updateProfile, updateEmail, updatePassword (#3122)
sam-gc Jun 1, 2020
c21e817
Add recaptcha implementation (#3166)
sam-gc Jun 5, 2020
8452cf7
Add signInWithPhoneNumber implementation (#3191)
sam-gc Jun 9, 2020
2958818
Add signInAnonymously to auth-next (#2986)
avolkovi Jun 9, 2020
308e47d
Add signInWithCustomToken implementation (#3136)
sam-gc Jun 10, 2020
bbdde9b
add signInWithEmailAndPassword & signInWithEmailLink to auth-next (#3…
avolkovi Jun 12, 2020
b67ec5e
Add linkWithCredential(), linkWithPhoneNumber(), unlink() (#3213)
sam-gc Jun 15, 2020
097549b
Add createUserWithEmailAndPassword to auth-next (#3212)
avolkovi Jun 15, 2020
d6ecc8c
Cleanup public types in auth-next (#3217)
avolkovi Jun 16, 2020
964db88
Add a demo page to auth-exp using the new modular methods (#3197)
sam-gc Jun 16, 2020
5cf64f7
Add custom email flow methods to auth-next (#3223)
avolkovi Jun 16, 2020
60bdff0
Add reauthenticateWithCredential, reauthenticateWithPhoneNumber (#3225)
sam-gc Jun 16, 2020
a575f2d
Add link and reauth implementation to email credential (#3226)
sam-gc Jun 17, 2020
faf6583
set up project for size analysis
Feiyang1 Jun 23, 2020
11fe751
Size analysis (#3265)
XuechunHou Jun 23, 2020
8e17b73
move everything to new repo
XuechunHou Jun 23, 2020
4607bc2
allow json import
Feiyang1 Jun 23, 2020
d232313
Add AdditionalUserInfo class to auth-exp (#2979)
scottcrossen Jun 24, 2020
9c9a3b1
added tests for size-analysis tool
XuechunHou Jun 24, 2020
e422ba4
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 24, 2020
6c7f9dc
pulled from auth next, resolved conflict
XuechunHou Jun 24, 2020
9483a3d
fixed output file path
XuechunHou Jun 24, 2020
4999f13
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 24, 2020
564a6cd
removed console logs
XuechunHou Jun 24, 2020
65704f9
added command line options
XuechunHou Jun 25, 2020
538057f
removed console log
XuechunHou Jun 25, 2020
b36f740
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 25, 2020
1302b4e
added comments
XuechunHou Jun 25, 2020
72624cb
removed comments
XuechunHou Jun 25, 2020
b1180c3
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 25, 2020
0d8ca04
removed auth-exp module
XuechunHou Jun 25, 2020
e4c03c9
removed generated reports
XuechunHou Jun 25, 2020
e9f41d0
added command line flag for adhoc runs
XuechunHou Jun 25, 2020
4799495
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 25, 2020
bf2b03e
Create README.MD
XuechunHou Jun 25, 2020
b792cc8
Update README.MD
XuechunHou Jun 25, 2020
0344975
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 26, 2020
345c369
reverted firestore experimental changes
XuechunHou Jun 26, 2020
5ed163c
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
XuechunHou Jun 26, 2020
a4f2c87
added readme
XuechunHou Jun 26, 2020
e6661aa
fixed dummy-exp test
XuechunHou Jun 26, 2020
ef84415
fixed ci test
XuechunHou Jun 26, 2020
ae08741
fixed test cases for size-analysis
XuechunHou Jun 26, 2020
273f4f0
fixed ci test
XuechunHou Jun 26, 2020
d14b737
fixed test
XuechunHou Jun 26, 2020
3a2c4a8
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 29, 2020
06752e0
Delete README.MD
XuechunHou Jun 29, 2020
751769c
addressed feedback
XuechunHou Jun 29, 2020
71bcdc2
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 29, 2020
537beea
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
XuechunHou Jun 29, 2020
552090a
Update README.md
XuechunHou Jun 29, 2020
0a90582
Update README.md
XuechunHou Jun 29, 2020
bb58e09
trying to fix authomation pipeline for size-analysis
XuechunHou Jun 29, 2020
b6784cc
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
XuechunHou Jun 29, 2020
0eb6bee
pulled from master
XuechunHou Jun 30, 2020
944a874
trying to fix ci tests
XuechunHou Jun 30, 2020
43760a9
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 30, 2020
eef3d60
extended timeout for before hook
XuechunHou Jun 30, 2020
0ebe304
increased timeout
XuechunHou Jun 30, 2020
d440ca4
increased timeout
XuechunHou Jun 30, 2020
a532de2
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jun 30, 2020
22df43e
merged master
XuechunHou Jul 2, 2020
2572f97
added handle for BindingPattern. Also compressed repeated code block
XuechunHou Jul 2, 2020
139e00f
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 2, 2020
76a40cc
removed console logs
XuechunHou Jul 2, 2020
e8ac71f
fixed bugs
XuechunHou Jul 2, 2020
24c0cd9
added test cases
XuechunHou Jul 3, 2020
6919bed
fixed errors in dummy-exp
XuechunHou Jul 3, 2020
e11a963
added more test cases
XuechunHou Jul 3, 2020
97e0b04
fixed test cases
XuechunHou Jul 4, 2020
8a754c9
commit before switching brand
XuechunHou Jul 6, 2020
a235919
Update README.md
XuechunHou Jul 6, 2020
6c85e2b
modified command line flag help page
XuechunHou Jul 6, 2020
8002afe
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 7, 2020
21f0bf6
pulled from remote counterpart
XuechunHou Jul 7, 2020
c2dfb4e
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 7, 2020
5c876e5
seperated external firebase module dependencies from local
XuechunHou Jul 8, 2020
fd939c8
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 8, 2020
a9fb743
restructure report format
XuechunHou Jul 8, 2020
d6237f8
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 9, 2020
63b90b8
added command line flag for ci
XuechunHou Jul 9, 2020
2475a9b
Update README.md
XuechunHou Jul 9, 2020
7e3ac0a
reversed dummy package json
XuechunHou Jul 11, 2020
b1933a7
added handle for import then export, added bug fix for export without…
XuechunHou Jul 13, 2020
1ae6f83
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
XuechunHou Jul 13, 2020
f417158
revert unrealted files
XuechunHou Jul 13, 2020
92546da
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 17, 2020
3b931f8
removed dummy-exp.api.md file
XuechunHou Jul 17, 2020
f9888f6
removed dummy-exp module, addressed comments
XuechunHou Jul 18, 2020
877f3d8
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 18, 2020
9b6bb48
restored changelog-generator
XuechunHou Jul 18, 2020
eb90b42
removed generated reports, restored auth files
XuechunHou Jul 18, 2020
1db8674
removed dummy-exp module
XuechunHou Jul 18, 2020
79eb916
Update README.md
XuechunHou Jul 18, 2020
44a3ff9
Update README.md
XuechunHou Jul 18, 2020
3358775
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 21, 2020
1df0da3
changed double quote to single quote
XuechunHou Jul 21, 2020
82c3e06
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
XuechunHou Jul 21, 2020
dc92c39
retry change double quote to single quote
XuechunHou Jul 21, 2020
487e185
changed single quote all to double quote
XuechunHou Jul 21, 2020
bd25c94
changed double quote to single quote
XuechunHou Jul 21, 2020
4cdadb7
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 21, 2020
6eac6a6
addressed feedback
XuechunHou Jul 21, 2020
aa59f21
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 22, 2020
54203be
added handle for declare then exports
XuechunHou Jul 22, 2020
0eb6ff2
external dependencies import clause, retrieve original name if renamed
XuechunHou Jul 22, 2020
96b9154
removed console log
XuechunHou Jul 22, 2020
5659db0
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 22, 2020
25782a5
deleted rollup file, created a folder for dts file
XuechunHou Jul 23, 2020
3ed6871
merged test dts files
XuechunHou Jul 23, 2020
f257595
reverted whitespace changes
XuechunHou Jul 23, 2020
b5f9273
modified test dts file
XuechunHou Jul 23, 2020
3c2da96
removed timeout
XuechunHou Jul 23, 2020
2ab2ceb
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Jul 23, 2020
de485d3
addressed PR comments
XuechunHou Aug 1, 2020
ed7a034
addressed PR comments, replaced custom deepCopy function with that fr…
XuechunHou Aug 3, 2020
48178dd
reverted prettier changes
XuechunHou Aug 3, 2020
f0a75eb
reverted prettier changes
XuechunHou Aug 3, 2020
584fea3
addressed PR comments
XuechunHou Aug 3, 2020
79f9747
addressed PR comments
XuechunHou Aug 3, 2020
fb7a164
pulled from master
XuechunHou Aug 4, 2020
52ee009
update package.json
Feiyang1 Aug 5, 2020
457106c
changed rollup plugin import location
XuechunHou Aug 5, 2020
cd23a30
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
XuechunHou Aug 5, 2020
32548ce
modified handleExportStatementsWithoutFromClause function to not retu…
XuechunHou Aug 5, 2020
7105985
fixed rmDirSync issue
XuechunHou Aug 5, 2020
9fed25f
refactor testing
Feiyang1 Aug 6, 2020
18c120d
pulled from master
XuechunHou Aug 6, 2020
5334cf2
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
XuechunHou Aug 6, 2020
489e832
added tests on js bundle files
XuechunHou Aug 6, 2020
9370e09
removed unnecessary files
XuechunHou Aug 6, 2020
41ed6f2
Update test-changed workflow checkout step (#3580)
hsubox76 Aug 7, 2020
2c99c44
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk …
XuechunHou Aug 7, 2020
b600cd5
set longer timeout for testing
Feiyang1 Aug 7, 2020
a0e69d8
updated comments and error message
XuechunHou Aug 7, 2020
f968e0b
minor updates
Feiyang1 Aug 7, 2020
6625069
Merge branch 'size-analysis-repo' of https://github.com/firebase/fire…
Feiyang1 Aug 7, 2020
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
9 changes: 5 additions & 4 deletions .github/workflows/test-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (10)
uses: actions/setup-node@v1
with:
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"
}
}
}
}
187 changes: 185 additions & 2 deletions packages/firestore/scripts/build-bundle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";
'use strict';
/**
* @license
* Copyright 2020 Google LLC
Expand All @@ -14,4 +14,187 @@
* 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.
*/var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};var __generator=this&&this.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}};exports.__esModule=true;var yargs=require("yargs");var rollup_1=require("rollup");var typescriptPlugin=require("rollup-plugin-typescript2");var alias=require("@rollup/plugin-alias");var json=require("rollup-plugin-json");var util=require("../rollup.shared");var argv=yargs.options({input:{type:"string",demandOption:true,desc:"The location of the index.ts file"},output:{type:"string",demandOption:true,desc:"The location for the transpiled JavaScript bundle"}}).argv;function buildBundle(input,output){return __awaiter(this,void 0,void 0,(function(){var bundle;return __generator(this,(function(_a){switch(_a.label){case 0:return[4,rollup_1.rollup({input:input,plugins:[alias(util.generateAliasConfig("node")),typescriptPlugin({tsconfigOverride:{compilerOptions:{target:"es2017"}},transformers:[util.removeAssertTransformer]}),json({preferConst:true})],external:util.resolveNodeExterns})];case 1:bundle=_a.sent();return[4,bundle.write({file:output,format:"es"})];case 2:_a.sent();return[2]}}))}))}buildBundle(argv.input,argv.output);
*/ var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator['throw'](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done
? resolve(result.value)
: adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: []
},
f,
y,
t,
g;
return (
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
typeof Symbol === 'function' &&
(g[Symbol.iterator] = function () {
return this;
}),
g
);
function verb(n) {
return function (v) {
return step([n, v]);
};
}
function step(op) {
if (f) throw new TypeError('Generator is already executing.');
while (_)
try {
if (
((f = 1),
y &&
(t =
op[0] & 2
? y['return']
: op[0]
? y['throw'] || ((t = y['return']) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t;
if (((y = 0), t)) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
(op[0] === 6 || op[0] === 2)
) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
exports.__esModule = true;
var yargs = require('yargs');
var rollup_1 = require('rollup');
var typescriptPlugin = require('rollup-plugin-typescript2');
var alias = require('@rollup/plugin-alias');
var json = require('rollup-plugin-json');
var util = require('../rollup.shared');
var argv = yargs.options({
input: {
type: 'string',
demandOption: true,
desc: 'The location of the index.ts file'
},
output: {
type: 'string',
demandOption: true,
desc: 'The location for the transpiled JavaScript bundle'
}
}).argv;
function buildBundle(input, output) {
return __awaiter(this, void 0, void 0, function () {
var bundle;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
return [
4,
rollup_1.rollup({
input: input,
plugins: [
alias(util.generateAliasConfig('node')),
typescriptPlugin({
tsconfigOverride: { compilerOptions: { target: 'es2017' } },
transformers: [util.removeAssertTransformer]
}),
json({ preferConst: true })
],
external: util.resolveNodeExterns
})
];
case 1:
bundle = _a.sent();
return [4, bundle.write({ file: output, format: 'es' })];
case 2:
_a.sent();
return [2];
}
});
});
}
buildBundle(argv.input, argv.output);
49 changes: 47 additions & 2 deletions packages/firestore/scripts/run-tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";
'use strict';
/**
* @license
* Copyright 2020 Google LLC
Expand All @@ -14,4 +14,49 @@
* 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.
*/exports.__esModule=true;var yargs=require("yargs");var path_1=require("path");var child_process_promise_1=require("child-process-promise");var argv=yargs.options({main:{type:"string",demandOption:true},platform:{type:"string",default:"node"},emulator:{type:"boolean"},persistence:{type:"boolean"}}).argv;var nyc=path_1.resolve(__dirname,"../../../node_modules/.bin/nyc");var mocha=path_1.resolve(__dirname,"../../../node_modules/.bin/mocha");process.env.TS_NODE_CACHE="NO";process.env.TS_NODE_COMPILER_OPTIONS='{"module":"commonjs"}';process.env.TEST_PLATFORM=argv.platform;var args=[mocha,"--require","ts-node/register","--require",argv.main,"--config","../../config/mocharc.node.js"];if(argv.emulator){process.env.FIRESTORE_EMULATOR_PORT="8080";process.env.FIRESTORE_EMULATOR_PROJECT_ID="test-emulator"}if(argv.persistence){process.env.USE_MOCK_PERSISTENCE="YES";args.push("--require","test/util/node_persistence.ts")}args=args.concat(argv._);var childProcess=child_process_promise_1.spawn(nyc,args,{stdio:"inherit",cwd:process.cwd()}).childProcess;process.once("exit",(function(){return childProcess.kill()}));process.once("SIGINT",(function(){return childProcess.kill("SIGINT")}));process.once("SIGTERM",(function(){return childProcess.kill("SIGTERM")}));
*/ exports.__esModule = true;
var yargs = require('yargs');
var path_1 = require('path');
var child_process_promise_1 = require('child-process-promise');
var argv = yargs.options({
main: { type: 'string', demandOption: true },
platform: { type: 'string', default: 'node' },
emulator: { type: 'boolean' },
persistence: { type: 'boolean' }
}).argv;
var nyc = path_1.resolve(__dirname, '../../../node_modules/.bin/nyc');
var mocha = path_1.resolve(__dirname, '../../../node_modules/.bin/mocha');
process.env.TS_NODE_CACHE = 'NO';
process.env.TS_NODE_COMPILER_OPTIONS = '{"module":"commonjs"}';
process.env.TEST_PLATFORM = argv.platform;
var args = [
mocha,
'--require',
'ts-node/register',
'--require',
argv.main,
'--config',
'../../config/mocharc.node.js'
];
if (argv.emulator) {
process.env.FIRESTORE_EMULATOR_PORT = '8080';
process.env.FIRESTORE_EMULATOR_PROJECT_ID = 'test-emulator';
}
if (argv.persistence) {
process.env.USE_MOCK_PERSISTENCE = 'YES';
args.push('--require', 'test/util/node_persistence.ts');
}
args = args.concat(argv._);
var childProcess = child_process_promise_1.spawn(nyc, args, {
stdio: 'inherit',
cwd: process.cwd()
}).childProcess;
process.once('exit', function () {
return childProcess.kill();
});
process.once('SIGINT', function () {
return childProcess.kill('SIGINT');
});
process.once('SIGTERM', function () {
return childProcess.kill('SIGTERM');
});
4 changes: 2 additions & 2 deletions packages/firestore/src/local/indexeddb_persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ export class IndexedDbPersistence implements Persistence {
debugAssert(!this.started, 'IndexedDbPersistence double-started!');
debugAssert(this.window !== null, "Expected 'window' to be defined");

// NOTE: This is expected to fail sometimes (in the case of another tab
// already having the persistence lock), so it's the first thing we should
// NOTE: This is expected to fail sometimes (in the case of another tab
// already having the persistence lock), so it's the first thing we should
// do.
return this.updateClientMetadataAndTryBecomePrimary()
.then(() => {
Expand Down
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>`
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a section on how to use it programmatically ?



Loading