Skip to content

Commit b651365

Browse files
committed
Merge remote-tracking branch 'origin/master' into fz/storage-list
2 parents 21759f7 + 3635f53 commit b651365

File tree

252 files changed

+13229
-4072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+13229
-4072
lines changed

.github/CODEOWNERS

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# Used for approving minor changes, large-scale refactorings, and emergency situations.
1414
# (secret team to avoid review requests)
1515
#
16-
# - @Feiyang1
17-
# - @hiranya911
18-
# - @mikelehen
16+
# - @Feiyang1
17+
# - @hiranya911
18+
# - @mikelehen
1919
# - @bojeil-google
2020
# - @depoll
2121
# - @hsubox76
@@ -27,9 +27,9 @@
2727
# Used for approving firestore changes.
2828
# (secret team to avoid review requests)
2929
#
30-
# - @mikelehen
31-
# - @schmidt-sebastian
32-
# - @wilhuff
30+
# - @mikelehen
31+
# - @schmidt-sebastian
32+
# - @wilhuff
3333
# - @gsoltis
3434
# - @var-const
3535
# - @rsgowman
@@ -63,7 +63,15 @@ packages/auth @bojeil-google @wti806 @firebase/jssdk-global-approvers
6363
packages/auth-types @bojeil-google @wti806 @firebase/jssdk-global-approvers
6464

6565
# Testing Code
66-
packages/testing @tonymeng @ryanpbrewster @firebase/jssdk-global-approvers
66+
packages/testing @ryanpbrewster @scottcrossen @yuchenshi @firebase/jssdk-global-approvers
6767

6868
# RxFire Code
6969
packages/rxfire @davideast @jamesdaniels @firebase/jssdk-global-approvers
70+
71+
# Installations
72+
packages/installations @mmermerkaya @dwoffinden @andirayo @firebase/jssdk-global-approvers
73+
packages/installations-types @mmermerkaya @dwoffinden @andirayo @firebase/jssdk-global-approvers
74+
75+
# Performance Code
76+
packages/performance @alikn @zijianjoy @firebase/jssdk-global-approvers
77+
packages/performance-types @alikn @zijianjoy @firebase/jssdk-global-approvers

.travis.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ env:
88
global:
99
- CXX=g++-4.8
1010
before_install:
11-
# Yarn defaults to an old version, make sure we
12-
# get an up to date version
13-
- npm install -g [email protected]
11+
# Yarn defaults to an old version, make sure we get an up to date version
12+
- npm install -g [email protected]
1413
- '[ "${NPM_TOKEN+x}" ] && echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > $HOME/.npmrc || echo "Skipping .npmrc creation";'
15-
14+
install:
15+
# --frozen-lockfile doesn’t generate a yarn.lock lockfile and should fail if an update is needed.
16+
# This will make sure that yarn.lock file in the PR is consistent with package.json.
17+
#
18+
# Due to a yarn issue (https://github.com/yarnpkg/yarn/issues/5840), --frozen-lockfile doesn't
19+
# actually fail if an update is required, but integrity check from tools/pretest.js will catch
20+
# the issue, so it still works as expected.
21+
- yarn install --frozen-lockfile
1622
before_script:
1723
- cp config/ci.config.json config/project.json
1824
- yarn build
@@ -21,6 +27,7 @@ before_script:
2127
dist: trusty
2228
sudo: required
2329
addons:
30+
firefox: "66.0"
2431
apt:
2532
sources:
2633
- google-chrome
@@ -35,20 +42,15 @@ matrix:
3542
jobs:
3643
allow_failures:
3744
- script: yarn test:saucelabs
38-
- script: yarn test:saucelabs --database-firestore-only
3945
include:
4046
- name: Node.js and Browser (Chrome) Test
4147
stage: test
4248
script: xvfb-run yarn test
4349
after_success: yarn test:coverage
44-
- name: Cross Browser Test for SDKs except Database and Firestore
50+
- name: Cross Browser Test for SDKs
4551
stage: test
4652
script: yarn test:saucelabs
4753
if: type = push
48-
- name: Cross Browser Test for Database and Firestore SDK
49-
stage: test
50-
script: yarn test:saucelabs --database-firestore-only
51-
if: type = push
5254
- stage: deploy
5355
script: skip
5456
# NPM Canary Build Config

ENVIRONMENTS.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- BADGES -->
44
[![Build Status](https://travis-ci.org/firebase/firebase-js-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-js-sdk)
55
[![Build Status](https://saucelabs.com/buildstatus/firebase-oss)](https://saucelabs.com/u/firebase-oss)
6+
[![Version](https://img.shields.io/npm/v/firebase.svg?label=version)](https://www.npmjs.com/package/firebase)
67
<!-- END BADGES -->
78

89
The Firebase JavaScript SDK implements the client-side libraries used by
@@ -15,7 +16,10 @@ applications using Firebase services. This SDK is distributed via:
1516
To get started using Firebase, see
1617
[Add Firebase to your JavaScript Project](https://firebase.google.com/docs/web/setup).
1718

18-
Current [Release Notes](https://firebase.google.com/support/release-notes/js)
19+
[![Release Notes](https://img.shields.io/npm/v/firebase.svg?style=flat-square&label=Release%20Notes%20for&labelColor=039be5&color=666)](https://firebase.google.com/support/release-notes/js)
20+
21+
## Supported Environments
22+
Please see [Environment Support](https://firebase.google.com/support/guides/environments_js-sdk).
1923

2024
## SDK Dev Workflow
2125

config/functions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"description": "Cloud Functions for Firebase",
44
"dependencies": {
55
"cors": "2.8.5",
6-
"firebase-admin": "7.2.0",
7-
"firebase-functions": "2.2.1"
6+
"firebase-admin": "7.3.0",
7+
"firebase-functions": "2.3.0"
88
},
99
"private": true
1010
}

config/karma.saucelabs.js

Lines changed: 98 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,98 @@
1616
*/
1717

1818
const argv = require('yargs').argv;
19-
const glob = require('glob');
20-
const karma = require('karma');
2119
const path = require('path');
2220
const karmaBase = require('./karma.base');
2321

22+
// karma.conf.js test configuration file to run.
23+
const testConfigFile = argv['testConfigFile'];
24+
if (!testConfigFile) {
25+
console.error('No test file path provided.');
26+
process.exit(1);
27+
}
28+
29+
/**
30+
* Custom SauceLabs Launchers
31+
*/
32+
const browserMap = {
33+
// Desktop
34+
Chrome_Windows: seleniumLauncher('chrome', 'Windows 10', 'latest'),
35+
Firefox_Windows: seleniumLauncher('firefox', 'Windows 10', 'latest'),
36+
Safari_macOS: seleniumLauncher('safari', 'macOS 10.13', 'latest'),
37+
Edge_Windows: seleniumLauncher('MicrosoftEdge', 'Windows 10', 'latest'),
38+
IE_Windows: seleniumLauncher('internet explorer', 'Windows 10', 'latest')
39+
40+
// Mobile
41+
// Safari_iOS: appiumLauncher('Safari', 'iPhone Simulator', 'iOS', '11.2'),
42+
// Chrome_Android: appiumLauncher('Chrome', 'Android Emulator', 'Android', '6.0')
43+
};
44+
45+
/**
46+
* Any special options per package.
47+
*/
48+
const packageConfigs = {
49+
messaging: {
50+
// Messaging currently only supports these browsers.
51+
browsers: ['Chrome_Windows', 'Firefox_Windows', 'Edge_Windows']
52+
}
53+
};
54+
55+
/**
56+
* Gets the browser/launcher map for this package.
57+
*
58+
* @param {string} packageName Name of package being tested (e.g., "firestore")
59+
*/
60+
function getSauceLabsBrowsers(packageName) {
61+
if (packageConfigs[packageName]) {
62+
const filteredBrowserMap = {};
63+
for (const browserKey in browserMap) {
64+
if (packageConfigs[packageName].browsers.includes(browserKey)) {
65+
filteredBrowserMap[browserKey] = browserMap[browserKey];
66+
}
67+
}
68+
return filteredBrowserMap;
69+
} else {
70+
return browserMap;
71+
}
72+
}
73+
74+
/**
75+
* Get package name from package path command line arg.
76+
*/
77+
function getPackageLabels() {
78+
const match = testConfigFile.match(
79+
/([a-zA-Z]+)\/([a-zA-Z]+)\/karma\.conf\.js/
80+
);
81+
return {
82+
type: match[1],
83+
name: match[2]
84+
};
85+
}
86+
2487
/**
2588
* Gets a list of file patterns for test, defined individually
2689
* in karma.conf.js in each package under worksapce packages or
2790
* integration.
2891
*/
2992
function getTestFiles() {
3093
let root = path.resolve(__dirname, '..');
31-
configs = argv['database-firestore-only']
32-
? glob.sync('packages/{database,firestore}/karma.conf.js')
33-
: glob.sync('{packages,integration}/*/karma.conf.js', {
34-
// Excluded due to flakiness or long run time.
35-
ignore: [
36-
'packages/database/*',
37-
'packages/firestore/*',
38-
'integration/firestore/*',
39-
'integration/messaging/*'
40-
]
41-
});
42-
files = configs.map(x => {
43-
let patterns = require(path.join(root, x)).files;
44-
let dirname = path.dirname(x);
45-
return patterns.map(p => path.join(dirname, p));
46-
});
47-
return [].concat(...files);
94+
const { name: packageName } = getPackageLabels();
95+
let patterns = require(path.join(root, testConfigFile)).files;
96+
let dirname = path.dirname(testConfigFile);
97+
return { packageName, files: patterns.map(p => path.join(dirname, p)) };
4898
}
4999

50100
function seleniumLauncher(browserName, platform, version) {
101+
const { name, type } = getPackageLabels();
102+
const testName =
103+
type === 'integration'
104+
? `${type}-${name}-${browserName}`
105+
: `${name}-${browserName}`;
51106
return {
52107
base: 'SauceLabs',
53108
browserName: browserName,
54109
extendedDebugging: 'true',
110+
name: testName,
55111
recordLogs: 'true',
56112
recordVideo: 'true',
57113
recordScreenshots: 'true',
@@ -81,27 +137,32 @@ function appiumLauncher(
81137
};
82138
}
83139

84-
/**
85-
* Custom SauceLabs Launchers
86-
*/
87-
const sauceLabsBrowsers = {
88-
// Desktop
89-
Chrome_Windows: seleniumLauncher('chrome', 'Windows 10', 'latest'),
90-
Firefox_Windows: seleniumLauncher('firefox', 'Windows 10', 'latest'),
91-
Safari_macOS: seleniumLauncher('safari', 'macOS 10.13', 'latest'),
92-
Edge_Windows: seleniumLauncher('MicrosoftEdge', 'Windows 10', 'latest'),
93-
IE_Windows: seleniumLauncher('internet explorer', 'Windows 10', 'latest')
94-
95-
// Mobile
96-
// Safari_iOS: appiumLauncher('Safari', 'iPhone Simulator', 'iOS', '11.2'),
97-
// Chrome_Android: appiumLauncher('Chrome', 'Android Emulator', 'Android', '6.0')
98-
};
99-
100140
module.exports = function(config) {
141+
const { packageName, files: testFiles } = getTestFiles();
142+
const sauceLabsBrowsers = getSauceLabsBrowsers(packageName);
143+
144+
const sauceLabsConfig = {
145+
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER + '-' + packageName,
146+
build: process.env.TRAVIS_BUILD_NUMBER || argv['buildNumber'],
147+
username: process.env.SAUCE_USERNAME,
148+
accessKey: process.env.SAUCE_ACCESS_KEY,
149+
startConnect: true,
150+
connectOptions: {
151+
// Realtime Database uses WebSockets to connect to firebaseio.com
152+
// so we have to set noSslBumpDomains. Theoretically SSL Bumping
153+
// only needs to be disabled for 'firebaseio.com'. However, we are
154+
// seeing much longer test time with that configuration, so leave
155+
// it as 'all' for now.
156+
// See https://wiki.saucelabs.com/display/DOCS/Troubleshooting+Sauce+Connect
157+
// for more details.
158+
noSslBumpDomains: 'all'
159+
}
160+
};
161+
101162
const karmaConfig = Object.assign({}, karmaBase, {
102163
basePath: '../',
103164

104-
files: ['packages/polyfill/index.ts', ...getTestFiles()],
165+
files: ['packages/polyfill/index.ts', ...testFiles],
105166

106167
logLevel: config.LOG_INFO,
107168

@@ -151,22 +212,7 @@ module.exports = function(config) {
151212
overviewColumn: false
152213
},
153214

154-
sauceLabs: {
155-
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
156-
username: process.env.SAUCE_USERNAME,
157-
accessKey: process.env.SAUCE_ACCESS_KEY,
158-
startConnect: true,
159-
connectOptions: {
160-
// Realtime Database uses WebSockets to connect to firebaseio.com
161-
// so we have to set noSslBumpDomains. Theoretically SSL Bumping
162-
// only needs to be disabled for 'firebaseio.com'. However, we are
163-
// seeing much longer test time with that configuration, so leave
164-
// it as 'all' for now.
165-
// See https://wiki.saucelabs.com/display/DOCS/Troubleshooting+Sauce+Connect
166-
// for more details.
167-
noSslBumpDomains: 'all'
168-
}
169-
}
215+
sauceLabs: sauceLabsConfig
170216
});
171217

172218
config.set(karmaConfig);

config/webpack.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module.exports = {
3030
loader: 'ts-loader',
3131
options: {
3232
compilerOptions: {
33-
module: 'commonjs'
33+
module: 'commonjs',
34+
downlevelIteration: true
3435
}
3536
}
3637
}

integration/browserify/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
"test": "karma start --single-run"
88
},
99
"dependencies": {
10-
"firebase": "5.9.4"
10+
"firebase": "6.0.2"
1111
},
1212
"devDependencies": {
13-
"@babel/core": "7.4.3",
14-
"@babel/preset-env": "7.4.3",
13+
"@babel/core": "7.4.4",
14+
"@babel/preset-env": "7.4.4",
1515
"browserify": "16.2.3",
1616
"chai": "4.2.0",
17-
"karma": "4.0.1",
17+
"karma": "4.1.0",
1818
"karma-babel-preprocessor": "8.0.0",
1919
"karma-chrome-launcher": "2.2.0",
2020
"karma-firefox-launcher": "1.1.0",
2121
"karma-mocha": "1.3.0",
2222
"karma-sauce-launcher": "1.2.0",
2323
"karma-spec-reporter": "0.0.32",
2424
"mkdirp": "0.5.1",
25-
"mocha": "6.1.3"
25+
"mocha": "6.1.4"
2626
}
2727
}

integration/firebase-typings/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"test": "tsc index.ts --outDir dist"
77
},
88
"dependencies": {
9-
"firebase": "5.9.4"
9+
"firebase": "6.0.2"
1010
},
1111
"devDependencies": {
12-
"typescript": "3.4.3"
12+
"typescript": "3.4.5"
1313
}
1414
}

0 commit comments

Comments
 (0)