Skip to content

Commit 2d825a5

Browse files
Merge branch 'master' into mrschmidt/rewritefieldvalue
2 parents b54f28f + a5d80d9 commit 2d825a5

36 files changed

+996
-467
lines changed

config/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Cloud Functions for Firebase",
44
"dependencies": {
55
"cors": "2.8.5",
6-
"firebase-admin": "8.9.2",
6+
"firebase-admin": "8.10.0",
77
"firebase-functions": "3.3.0"
88
},
99
"private": true,

integration/browserify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"karma-mocha": "1.3.0",
2222
"karma-sauce-launcher": "1.2.0",
2323
"karma-spec-reporter": "0.0.32",
24-
"mkdirp": "0.5.1",
24+
"mkdirp": "0.5.3",
2525
"mocha": "7.1.0"
2626
}
2727
}

integration/firestore/gulpfile.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function clean() {
2727
return del(['temp/**/*', 'dist/**/*']);
2828
}
2929

30+
function isPersistenceEnabled() {
31+
return process.env.INCLUDE_FIRESTORE_PERSISTENCE !== 'false';
32+
}
33+
3034
function copyTests() {
3135
/**
3236
* NOTE: We intentionally don't copy src/ files (to make sure we are only
@@ -37,7 +41,9 @@ function copyTests() {
3741
const firebaseAppSdk = 'firebase/app/dist/index.esm.js';
3842
const firebaseFirestoreSdk = resolve(
3943
__dirname,
40-
'../../packages/firestore/dist/index.esm.js'
44+
isPersistenceEnabled()
45+
? '../../packages/firestore/dist/index.esm.js'
46+
: '../../packages/firestore/dist/index.memory.esm.js'
4147
);
4248
return gulp
4349
.src(
@@ -63,7 +69,14 @@ function copyTests() {
6369
*/
6470
/import\s+firebase\s+from\s+('|")[^\1]+firebase_export\1;?/,
6571
`import firebase from '${firebaseAppSdk}';
66-
import '${firebaseFirestoreSdk}';`
72+
import '${firebaseFirestoreSdk}';
73+
74+
if (typeof process === 'undefined') {
75+
process = { env: { INCLUDE_FIRESTORE_PERSISTENCE: '${isPersistenceEnabled()}' } } as any;
76+
} else {
77+
process.env.INCLUDE_FIRESTORE_PERSISTENCE = '${isPersistenceEnabled()}';
78+
}
79+
`
6780
)
6881
)
6982
.pipe(

integration/firestore/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
"version": "1.0.1",
44
"private": true,
55
"scripts": {
6-
"build": "gulp compile-tests",
7-
"build:deps": "cd ../../ ; yarn build",
8-
"pretest:manual": "yarn build",
9-
"pretest:debug": "yarn build:deps && yarn build",
10-
"test": "echo 'Automated tests temporarily disabled, run `yarn test:manual` to execute these tests'",
11-
"test:manual": "karma start --single-run",
12-
"test:debug": "karma start --auto-watch --browsers Chrome"
6+
"build:deps": "cd ../../packages/firestore ; yarn build",
7+
"build:persistence": "INCLUDE_FIRESTORE_PERSISTENCE=true gulp compile-tests",
8+
"build:memory": "INCLUDE_FIRESTORE_PERSISTENCE=false gulp compile-tests",
9+
"test": "yarn build:memory; karma start --single-run; yarn build:persistence; karma start --single-run;",
10+
"test:persistence": " yarn build:persistence; karma start --single-run",
11+
"test:memory": "yarn build:memory; karma start --single-run",
12+
"test:debug:persistence": "yarn build:deps; yarn build:persistence; karma start --auto-watch --browsers Chrome",
13+
"test:debug:memory": "yarn build:deps; yarn build:memory; karma start --single-run"
1314
},
1415
"devDependencies": {
1516
"@types/mocha": "7.0.2",

integration/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"devDependencies": {
1212
"@babel/core": "7.8.7",
1313
"@babel/preset-env": "7.8.7",
14-
"@types/chai": "4.2.10",
14+
"@types/chai": "4.2.11",
1515
"@types/mocha": "7.0.2",
1616
"chai": "4.2.0",
1717
"karma": "4.4.1",

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@
4848
"integration/*"
4949
],
5050
"devDependencies": {
51-
"@types/chai": "4.2.10",
51+
"@types/chai": "4.2.11",
5252
"@types/chai-as-promised": "7.1.2",
5353
"@types/long": "4.0.1",
5454
"@types/mocha": "7.0.2",
5555
"@types/node": "8.10.59",
5656
"@types/sinon": "7.5.2",
5757
"@types/sinon-chai": "3.2.3",
58-
"@typescript-eslint/eslint-plugin": "2.23.0",
59-
"@typescript-eslint/eslint-plugin-tslint": "2.23.0",
60-
"@typescript-eslint/parser": "2.23.0",
58+
"@typescript-eslint/eslint-plugin": "2.24.0",
59+
"@typescript-eslint/eslint-plugin-tslint": "2.24.0",
60+
"@typescript-eslint/parser": "2.24.0",
6161
"babel-loader": "8.0.6",
6262
"chai": "4.2.0",
6363
"chai-as-promised": "7.1.1",
@@ -72,13 +72,13 @@
7272
"express": "4.17.1",
7373
"find-free-port": "2.0.0",
7474
"firebase-functions": "3.3.0",
75-
"firebase-tools": "7.14.0",
75+
"firebase-tools": "7.15.1",
7676
"git-rev-sync": "2.0.0",
7777
"glob": "7.1.6",
7878
"http-server": "0.12.1",
7979
"husky": "4.2.3",
8080
"indexeddbshim": "5.0.0",
81-
"inquirer": "7.0.6",
81+
"inquirer": "7.1.0",
8282
"istanbul-instrumenter-loader": "3.0.1",
8383
"js-yaml": "3.13.1",
8484
"karma": "4.4.1",
@@ -98,7 +98,7 @@
9898
"listr": "0.14.3",
9999
"long": "3.2.0",
100100
"merge2": "1.3.0",
101-
"mkdirp": "0.5.1",
101+
"mkdirp": "0.5.3",
102102
"mocha": "7.1.0",
103103
"mz": "2.7.0",
104104
"npm-run-all": "4.1.5",
@@ -109,18 +109,18 @@
109109
"protractor": "5.4.2",
110110
"rxjs": "6.5.4",
111111
"semver": "7.1.3",
112-
"simple-git": "1.131.0",
113-
"sinon": "9.0.0",
112+
"simple-git": "1.132.0",
113+
"sinon": "9.0.1",
114114
"sinon-chai": "3.5.0",
115115
"source-map-loader": "0.2.4",
116116
"ts-loader": "6.2.1",
117117
"ts-node": "8.6.2",
118118
"tslint": "6.1.0",
119-
"typedoc": "0.16.11",
119+
"typedoc": "0.17.0",
120120
"typescript": "3.8.3",
121121
"watch": "1.0.2",
122122
"webpack": "4.42.0",
123-
"yargs": "15.3.0",
123+
"yargs": "15.3.1",
124124
"lodash": "4.17.15"
125125
}
126126
}

packages/auth/demo/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"logs": "firebase functions:log"
1010
},
1111
"dependencies": {
12-
"firebase-admin": "8.9.2",
12+
"firebase-admin": "8.10.0",
1313
"firebase-functions": "3.3.0"
1414
},
1515
"private": true

packages/auth/demo/functions/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,10 @@ finalhandler@~1.1.2:
674674
statuses "~1.5.0"
675675
unpipe "~1.0.0"
676676

677-
firebase-admin@8.9.2:
678-
version "8.9.2"
679-
resolved "https://registry.npmjs.org/firebase-admin/-/firebase-admin-8.9.2.tgz#248ba184dc13b4929b043870a2067787a0dd013e"
680-
integrity sha512-ix4qcx+hHnr3mnc41Z8EzQa9Mr+2nhogLEv6ktkOCCpdKJ+9HxW9vikRCElSbC8ICHLD0KIH0GVOIZK80vbvqw==
677+
firebase-admin@8.10.0:
678+
version "8.10.0"
679+
resolved "https://registry.npmjs.org/firebase-admin/-/firebase-admin-8.10.0.tgz#4a838aec52df49845eba07ad59a40b4df996e815"
680+
integrity sha512-QzJZ1sBh9xzKjb44aP6m1duy0Xe1ixexwh0eaOt1CkJYCOq2b6bievK4GNWMl5yGQ7FFBEbZO6hyDi+5wrctcg==
681681
dependencies:
682682
"@firebase/database" "^0.5.17"
683683
"@types/node" "^8.10.59"

packages/auth/src/authcredential.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ goog.provide('fireauth.SAMLAuthCredential');
3636
goog.provide('fireauth.SAMLAuthProvider');
3737
goog.provide('fireauth.TwitterAuthProvider');
3838

39-
goog.forwardDeclare('fireauth.RpcHandler');
39+
goog.requireType('fireauth.RpcHandler');
4040
goog.require('fireauth.ActionCodeInfo');
4141
goog.require('fireauth.ActionCodeURL');
4242
goog.require('fireauth.AuthError');
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/**
19+
* This file serves as the public entrypoint for users that import
20+
* `firebase/firestore/memory`.
21+
*/
22+
23+
import '../../../firestore/dist/index.memory.esm';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "firebase/firestore/memory",
3+
"description": "A memory-only build of the Cloud Firestore JS SDK.",
4+
"main": "dist/index.cjs.js",
5+
"module": "dist/index.esm.js",
6+
"typings": "../../empty-import.d.ts",
7+
}

packages/firebase/firestore/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "firebase/firestore",
3+
"description": "The Cloud Firestore component of the Firebase JS SDK.",
34
"main": "dist/index.cjs.js",
45
"module": "dist/index.esm.js",
56
"typings": "../empty-import.d.ts"

packages/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"rollup-plugin-license": "0.13.0",
6060
"rollup-plugin-node-resolve": "5.2.0",
6161
"rollup-plugin-sourcemaps": "0.5.0",
62-
"rollup-plugin-terser": "5.2.0",
62+
"rollup-plugin-terser": "5.3.0",
6363
"rollup-plugin-typescript2": "0.26.0",
6464
"rollup-plugin-uglify": "6.0.4",
6565
"typescript": "3.8.3"

packages/firebase/rollup.config.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,32 @@ const componentBuilds = pkg.components
147147
})
148148
.reduce((a, b) => a.concat(b), []);
149149

150+
const firestoreMemoryBuilds = [
151+
{
152+
input: `firestore/memory/index.ts`,
153+
output: [
154+
{
155+
file: resolve('firestore/memory', pkg.main),
156+
format: 'cjs',
157+
sourcemap: true
158+
},
159+
{
160+
file: resolve('firestore/memory', pkg.module),
161+
format: 'es',
162+
sourcemap: true
163+
}
164+
],
165+
plugins,
166+
external
167+
},
168+
{
169+
input: `firestore/memory/index.ts`,
170+
output: createUmdOutputConfig(`firebase-firestore.memory.js`),
171+
plugins: [...plugins, uglify()],
172+
external: ['@firebase/app']
173+
}
174+
];
175+
150176
/**
151177
* Complete Package Builds
152178
*/
@@ -260,4 +286,9 @@ const completeBuilds = [
260286
}
261287
];
262288

263-
export default [...appBuilds, ...componentBuilds, ...completeBuilds];
289+
export default [
290+
...appBuilds,
291+
...componentBuilds,
292+
...firestoreMemoryBuilds,
293+
...completeBuilds
294+
];

packages/firestore/index.memory.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import firebase from '@firebase/app';
19+
import { FirebaseNamespace } from '@firebase/app-types';
20+
21+
import { Firestore } from './src/api/database';
22+
import { MemoryPersistenceProvider } from './src/local/memory_persistence';
23+
import { configureForFirebase } from './src/platform/config';
24+
25+
import './register-module';
26+
import './src/platform_browser/browser_init';
27+
28+
import { name, version } from './package.json';
29+
30+
/**
31+
* Registers the memory-only Firestore build with the components framework.
32+
*/
33+
export function registerFirestore(instance: FirebaseNamespace): void {
34+
configureForFirebase(
35+
instance,
36+
(app, auth) => new Firestore(app, auth, new MemoryPersistenceProvider())
37+
);
38+
instance.registerVersion(name, version);
39+
}
40+
41+
registerFirestore(firebase);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import firebase from '@firebase/app';
19+
import { FirebaseNamespace } from '@firebase/app-types';
20+
21+
import { Firestore } from './src/api/database';
22+
import { MemoryPersistenceProvider } from './src/local/memory_persistence';
23+
import { configureForFirebase } from './src/platform/config';
24+
import './register-module';
25+
import './src/platform_node/node_init';
26+
27+
import { name, version } from './package.json';
28+
29+
/**
30+
* Registers the memory-only Firestore build for Node with the components
31+
* framework.
32+
*/
33+
export function registerFirestore(instance: FirebaseNamespace): void {
34+
configureForFirebase(
35+
instance,
36+
(app, auth) => new Firestore(app, auth, new MemoryPersistenceProvider())
37+
);
38+
instance.registerVersion(name, version);
39+
}
40+
41+
registerFirestore(firebase);

packages/firestore/index.node.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,26 @@
1515
* limitations under the License.
1616
*/
1717
import firebase from '@firebase/app';
18+
import { FirebaseNamespace } from '@firebase/app-types';
19+
20+
import { Firestore } from './src/api/database';
21+
import { IndexedDbPersistenceProvider } from './src/local/indexeddb_persistence';
1822
import { configureForFirebase } from './src/platform/config';
23+
1924
import './register-module';
2025
import './src/platform_node/node_init';
21-
import { FirebaseNamespace } from '@firebase/app-types';
2226

2327
import { name, version } from './package.json';
2428

29+
/**
30+
* Registers the main Firestore Node build with the components framework.
31+
* Persistence can be enabled via `firebase.firestore().enablePersistence()`.
32+
*/
2533
export function registerFirestore(instance: FirebaseNamespace): void {
26-
configureForFirebase(instance);
34+
configureForFirebase(
35+
instance,
36+
(app, auth) => new Firestore(app, auth, new IndexedDbPersistenceProvider())
37+
);
2738
instance.registerVersion(name, version, 'node');
2839
}
2940

0 commit comments

Comments
 (0)