Skip to content

Commit fa6b7fc

Browse files
Merge branch 'master' into mrschmidt-nullability
2 parents caa91c8 + eccfbe2 commit fa6b7fc

File tree

840 files changed

+31473
-11355
lines changed

Some content is hidden

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

840 files changed

+31473
-11355
lines changed

.github/CODEOWNERS

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,69 @@
11
# Lines starting with '#' are comments.
22
# Each line is a file pattern followed by one or more owners.
33

4+
######################################################################################################
5+
#
6+
# Team structure and memberships
7+
#
8+
#######################################################################################################
9+
10+
# ===========================================================
11+
# @firebase/jssdk-global-approvers
12+
# ===========================================================
13+
# Used for approving minor changes, large-scale refactorings, and emergency situations.
14+
# (secret team to avoid review requests)
15+
#
16+
# - @Feiyang1
17+
# - @hiranya911
18+
# - @mikelehen
19+
# - @bojeil-google
20+
# - @depoll
21+
# - @hsubox76
22+
23+
24+
# ===========================================================
25+
# @firebase/firestore-js-team
26+
# ===========================================================
27+
# Used for approving firestore changes.
28+
# (secret team to avoid review requests)
29+
#
30+
# - @mikelehen
31+
# - @schmidt-sebastian
32+
# - @wilhuff
33+
# - @gsoltis
34+
# - @var-const
35+
# - @rsgowman
36+
# - @zxu123
37+
38+
439
# These owners will be the default owners for everything in the repo.
5-
* @jshcrowthe @hiranya911 @mikelehen @bojeil-google @depoll
40+
* @Feiyang1 @hiranya911 @hsubox76 @firebase/jssdk-global-approvers
641

742
# Database Code
8-
packages/database @mikelehen @schmidt-sebastian
9-
packages/database-types @mikelehen @schmidt-sebastian
43+
packages/database @mikelehen @schmidt-sebastian @jsdt @firebase/jssdk-global-approvers
44+
packages/database-types @mikelehen @schmidt-sebastian @jsdt @firebase/jssdk-global-approvers
1045

1146
# Firestore Code
12-
packages/firestore @mikelehen @schmidt-sebastian @wilhuff @gsoltis @var-const @rsgowman @zxu123
13-
packages/webchannel-wrapper @mikelehen @schmidt-sebastian @wilhuff @gsoltis @var-const @rsgowman @zxu123
14-
packages/firestore-types @mikelehen @schmidt-sebastian @wilhuff @gsoltis @var-const @rsgowman @zxu123
15-
integration/firestore @mikelehen @schmidt-sebastian @wilhuff @gsoltis @var-const @rsgowman @zxu123
47+
packages/firestore @firebase/firestore-js-team @firebase/jssdk-global-approvers
48+
packages/webchannel-wrapper @firebase/firestore-js-team @firebase/jssdk-global-approvers
49+
packages/firestore-types @firebase/firestore-js-team @firebase/jssdk-global-approvers
50+
integration/firestore @firebase/firestore-js-team @firebase/jssdk-global-approvers
1651

1752
# Storage Code
18-
packages/storage @sphippen
19-
packages/storage-types @sphippen
53+
packages/storage @schmidt-sebastian @firebase/jssdk-global-approvers
54+
packages/storage-types @schmidt-sebastian @firebase/jssdk-global-approvers
2055

2156
# Messaging Code
22-
packages/messaging @gauntface @pinarx @mmermerkaya @dwoffinden
23-
packages/messaging-types @gauntface @pinarx @mmermerkaya @dwoffinden
24-
integration/messaging @gauntface @pinarx @mmermerkaya @dwoffinden
57+
packages/messaging @pinarx @mmermerkaya @dwoffinden @firebase/jssdk-global-approvers
58+
packages/messaging-types @pinarx @mmermerkaya @dwoffinden @firebase/jssdk-global-approvers
59+
integration/messaging @pinarx @mmermerkaya @dwoffinden @firebase/jssdk-global-approvers
2560

2661
# Auth Code
27-
packages/auth @bojeil-google @wti806
28-
packages/auth-types @bojeil-google @wti806
62+
packages/auth @bojeil-google @wti806 @firebase/jssdk-global-approvers
63+
packages/auth-types @bojeil-google @wti806 @firebase/jssdk-global-approvers
2964

3065
# Testing Code
31-
packages/testing @tonymeng @ryanpbrewster
66+
packages/testing @tonymeng @ryanpbrewster @firebase/jssdk-global-approvers
3267

3368
# RxFire Code
34-
packages/rxfire @davideast
69+
packages/rxfire @davideast @jamesdaniels @firebase/jssdk-global-approvers

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
dist
44
.awcache
55
/config/project.json
6+
scripts/docgen/html
67

78
# OS Specific Files
89
.DS_Store

.travis.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ env:
1010
before_install:
1111
# Yarn defaults to an old version, make sure we
1212
# get an up to date version
13-
- npm install -g yarn
13+
- npm install -g yarn@1.13.0
1414
- '[ "${NPM_TOKEN+x}" ] && echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > $HOME/.npmrc || echo "Skipping .npmrc creation";'
15+
1516
before_script:
1617
- cp config/ci.config.json config/project.json
18+
- yarn build
1719

1820
# Misc Addons/Configs
1921
dist: trusty
@@ -35,17 +37,17 @@ jobs:
3537
- script: yarn test:saucelabs
3638
- script: yarn test:saucelabs --database-firestore-only
3739
include:
38-
- stage: test
40+
- name: Node.js and Browser (Chrome) Test
41+
stage: test
3942
script: xvfb-run yarn test
4043
after_success: yarn test:coverage
41-
env: '#= chrome headless test'
42-
- stage: test
44+
- name: Cross Browser Test for SDKs except Database and Firestore
45+
stage: test
4346
script: yarn test:saucelabs
44-
env: '#= cross browser test: all packages except database and firestore'
4547
if: type = push
46-
- stage: test
48+
- name: Cross Browser Test for Database and Firestore SDK
49+
stage: test
4750
script: yarn test:saucelabs --database-firestore-only
48-
env: '#= cross browser test: database and firestore (allow_failures)'
4951
if: type = push
5052
- stage: deploy
5153
script: skip

.vscode/launch.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"--exit"
1919
],
2020
"env": {
21-
"TS_NODE_CACHE": "NO"
21+
"TS_NODE_CACHE": "NO",
22+
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
2223
},
2324
"sourceMaps": true,
2425
"protocol": "inspector"
@@ -39,7 +40,8 @@
3940
],
4041
"env": {
4142
"USE_MOCK_PERSISTENCE": "YES",
42-
"TS_NODE_CACHE": "NO"
43+
"TS_NODE_CACHE": "NO",
44+
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
4345
},
4446
"sourceMaps": true,
4547
"protocol": "inspector"
@@ -58,7 +60,9 @@
5860
"--exit"
5961
],
6062
"env": {
61-
"TS_NODE_CACHE": "NO"
63+
"TS_NODE_CACHE": "NO",
64+
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
65+
6266
},
6367
"sourceMaps": true,
6468
"protocol": "inspector"
@@ -79,7 +83,9 @@
7983
],
8084
"env": {
8185
"USE_MOCK_PERSISTENCE": "YES",
82-
"TS_NODE_CACHE": "NO"
86+
"TS_NODE_CACHE": "NO",
87+
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
88+
8389
},
8490
"sourceMaps": true,
8591
"protocol": "inspector"

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// Ruler can't be specified via editorconfig
3-
"editor.rulers": [80],
3+
"editor.rulers": [100],
44

55
"search.exclude": {
66
// Exclude gulp build outputs from search results

CONTRIBUTING.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ We'd love for you to contribute to our source code and to help make the Firebase
77
- [Issues and Bugs](#issue)
88
- [Feature Requests](#feature)
99
- [Submission Guidelines](#submit)
10-
- [Coding Rules](#rules)
11-
- [Signing the CLA](#cla)
10+
- [Updating Documentation](#docs)
1211

1312
## <a name="coc"></a> Code of Conduct
1413

@@ -59,13 +58,13 @@ Also as a great rule of thumb:
5958

6059
### Submitting a Pull Request
6160

62-
### Before you contribute
61+
#### Before you contribute
6362

6463
Before we can use your code, you must sign the [Google Individual Contributor License Agreement][google-cla] (CLA), which you can do online. The CLA is necessary mainly because you own the copyright to your changes, even after your contribution becomes part of our codebase, so we need your permission to use and distribute your code. We also need to be sure of various other things, for instance, that you'll tell us if you know that your code infringes on other people's patents. You don't have to sign the CLA until after you've submitted your code for review and a member has approved it, but you must do it before we can put your code into our codebase. There is also a nifty CLA bot that will guide you through this process if you are going through it for the first time.
6564

6665
Before you start working on a larger contribution, you should get in touch with us first through the issue tracker with your idea so that we can help out and possibly guide you. Coordinating up front makes it much easier to avoid frustration later on. Some pull requests (large contributions, API additions/changes, etc) may be subject to additional internal review, we appreciate your patience as we fully validate your contribution.
6766

68-
### Pull Request Guidelines
67+
#### Pull Request Guidelines
6968

7069
* Search [GitHub](https://github.com/firebase/firebase-js-sdk/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.
7170
* Create an issue to discuss a change before submitting a PR. We'd hate to have to turn down your contributions because of something that could have been communicated early on.
@@ -102,6 +101,45 @@ Before you start working on a larger contribution, you should get in touch with
102101

103102
That's it! Thank you for your contribution!
104103
104+
## <a name="docs"></a> Updating Documentation
105+
106+
Reference docs for the Firebase [JS SDK](https://firebase.google.com/docs/reference/js/) and [Node (client) SDK](https://firebase.google.com/docs/reference/node/) are generated by [Typedoc](https://typedoc.org/).
107+
108+
Typedoc generates this documentation from the main [firebase index.d.ts type definition file](packages/firebase/index.d.ts). Any updates to documentation should be made in that file.
109+
110+
If any pages are added or removed by your change (by adding or removing a class or interface), the [js/toc.yaml](scripts/docgen/content-sources/js/toc.yaml) and/or [node/toc.yaml](scripts/docgen/content-sources/node/toc.yaml) need to be modified to reflect this.
111+
112+
### Generating Documentation HTML Files
113+
114+
In order to generate the HTML documentation files locally, go to the root of this repo, and run:
115+
116+
```
117+
yarn install
118+
yarn docgen
119+
```
120+
121+
This will generate both js and node (client) reference docs. To just generate js
122+
docs, replace the last line with:
123+
124+
```
125+
yarn docgen:js
126+
```
127+
128+
To just generate node docs, replace the last line with:
129+
130+
```
131+
yarn docgen:node
132+
```
133+
134+
Files will be written to `scripts/docgen/html` - js docs will go into the `/js`
135+
subdirectory and node docs into the `/node` subdirectory.
136+
137+
**NOTE:** These files are formatted to be inserted into Google's documentation site, which adds some styling and navigation, so the raw files will be missing navigation elements and may not look polished. However, it should be enough to preview the content.
138+
139+
This process will generate warnings for files that are generated but not listed in the `toc.yaml`, or files that are in the `toc.yaml` but were not generated (which means something is missing in `index.d.ts`). If this happens during the JS documentation generation, it probably means either the `toc.yaml` or `index.d.ts` is incorrect. But in the Node process, some generated files not being found in `toc.yaml` are to be expected, since Node documentation is a subset of the full JS documentation.
140+
141+
Follow the [PR submission guidelines](#submit) above to submit any documentation changes.
142+
105143
[archive]: https://github.com/firebase/firebase-js-sdk/issues?utf8=%E2%9C%93&q=is%3Aissue
106144
[file-an-issue]: https://github.com/firebase/firebase-js-sdk/issues/new
107145
[firebase-google-group]: https://groups.google.com/forum/#!forum/firebase-talk

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
The Firebase JavaScript SDK implements the client-side libraries used by
99
applications using Firebase services. This SDK is distributed via:
1010

11-
- CDN (`<script src="https://www.gstatic.com/firebasejs/4.0.0/firebase.js"></script>`)
11+
- CDN (`<script src="https://www.gstatic.com/firebasejs/5.5.3/firebase.js"></script>`)
1212
- [npm package](https://www.npmjs.com/package/firebase)
1313
- [Bower package](https://github.com/firebase/firebase-bower)
1414

@@ -24,7 +24,8 @@ Current [Release Notes](https://firebase.google.com/support/release-notes/js)
2424
#### Node.js
2525

2626
Before you can start working on the Firebase JS SDK, you need to have Node.js
27-
`8.0.0` or greater installed on your machine.
27+
installed on your machine. The currently supported versions are `8.0.0` or greater,
28+
but smaller than `10.0.0`.
2829

2930
To download Node.js visit https://nodejs.org/en/download/.
3031

@@ -35,7 +36,7 @@ or [`N`](https://github.com/tj/n) to install and manage multiple node versions_
3536

3637
In addition to Node.js we use `yarn` to facilitate multi package development.
3738

38-
To install `yarn` follow the instructions listed on their website:
39+
To install `yarn` follow the instructions listed on their website:
3940
https://yarnpkg.com/en/docs/install
4041

4142
#### Java
@@ -69,6 +70,13 @@ by running the following at the root of the SDK:
6970
$ yarn
7071
```
7172

73+
Once you have installed all the dependencies, you can build the entire SDK by
74+
running the following command the root of the SDK:
75+
76+
```bash
77+
$ yarn build
78+
```
79+
7280
## Testing the SDK
7381

7482
### Test Setup
@@ -84,23 +92,29 @@ them below.
8492

8593
#### Authentication Support
8694

87-
Visit the authentication config in your project and enable the `Anonymous`
95+
Visit the authentication config in your project and enable the `Anonymous`
8896
sign-in provider to complete your project config.
8997

9098
#### Automated Setup
9199

92-
The remainder of the test setup can be done by running the following command at
93-
the root of the package:
100+
The remainder of the test setup requires choosing a test project. You can
101+
choose the project manually or specify the project directly at the root of
102+
the package.
94103

95104
```bash
96-
yarn test:setup
105+
# Select a project manually when running setup
106+
$ yarn test:setup
107+
108+
# Specify the specific project for setup
109+
$ yarn test:setup --projectId=<your-test-project>
97110
```
98111

99112
### Running the tests
100113

101114
Each of the directories in the `integration` directory as well as the `packages`
102-
directory have their own test suites. These can be run altogether by running the
103-
following command at the root of the package:
115+
directory have their own test suites. You will need to build the SDK before
116+
running tests. Test suites can be run all together by running the following
117+
command at the root of the package:
104118

105119
```bash
106120
$ yarn test
@@ -114,13 +128,13 @@ an individual package directory.
114128
### Introduction
115129

116130
The Firebase JS SDK is built with a series of individual packages that are all
117-
contained in this repository. Development is coordinated via [yarn
118-
workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/) and
131+
contained in this repository. Development is coordinated via [yarn
132+
workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/) and
119133
[Lerna](https://lernajs.io/) (a monorepo management tool).
120134

121135
Each package in the `packages` directory, constitute a piece of our
122136
implementation. The SDK is built via a combination of all of these packages
123-
which are published under the [`firebase`
137+
which are published under the [`firebase`
124138
scope](https://www.npmjs.com/search?q=scope%3Afirebase) on NPM.
125139

126140
### Helper Scripts
@@ -133,12 +147,12 @@ watch tasks as well as a sandbox server.
133147
You can run the dev script by running the following at the root of the package:
134148

135149
```bash
136-
yarn dev
150+
$ yarn dev
137151
```
138152

139153
### Prepush Hooks
140154

141-
As part of this repo, we use the NPM package [`husky`](https://npm.im/husky) to
155+
As part of this repo, we use the NPM package [`husky`](https://npm.im/husky) to
142156
implement git hooks. We leverage the prepush hook to do two things:
143157

144158
- Automated code styling (using [`prettier`](https://npm.im/prettier))

config/functions/.ncurc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"upgrade": true,
3+
"reject": [
4+
]
5+
}

config/functions/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
2+
* @license
23
* Copyright 2017 Google Inc.
34
*
45
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -134,3 +135,10 @@ exports.httpErrorTest = functions.https.onRequest((request, response) => {
134135
response.status(400).send();
135136
});
136137
});
138+
139+
exports.timeoutTest = functions.https.onRequest((request, response) => {
140+
cors(request, response, () => {
141+
// Wait for longer than 500ms.
142+
setTimeout(() => response.send({ data: true }), 500);
143+
});
144+
});

0 commit comments

Comments
 (0)