Skip to content

Commit 10d1d7e

Browse files
WIP
2 parents 8e91691 + 70fe239 commit 10d1d7e

File tree

129 files changed

+5474
-729
lines changed

Some content is hidden

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

129 files changed

+5474
-729
lines changed

.changeset/honest-doors-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"firebase": patch
3+
---
4+
5+
Escape unicodes when generating CDN scripts, so they work correctly in environments that requires UTF-8, for example, in Chrome extension.

.changeset/mean-queens-roll.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/firestore": patch
3+
---
4+
5+
Fixes an issue that prevents `waitForPendingWrites()` from resolving in background tabs when multi-tab is used (https://github.com/firebase/firebase-js-sdk/issues/3816).

.changeset/moody-jobs-deliver.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/firestore": patch
3+
---
4+
5+
Fixes a "Comparison with -0" lint warning for customers that build from source.

.changeset/polite-readers-wait.md

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

.changeset/shiny-forks-pull.md

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

.changeset/tame-donuts-relate.md

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

.changeset/thin-buses-fail.md

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

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# This file is pre-built and need not be formatted
22
packages/auth
33
packages/firebase/firebase*
4+
packages/firestore/scripts
45
dist

common/api-review/installations-exp.api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
import { FirebaseApp } from '@firebase/app-types-exp';
88
import { FirebaseInstallations } from '@firebase/installations-types-exp';
99

10-
// @public (undocumented)
10+
// @public
1111
export function deleteInstallations(installations: FirebaseInstallations): Promise<void>;
1212

13-
// @public (undocumented)
13+
// @public
1414
export function getId(installations: FirebaseInstallations): Promise<string>;
1515

16-
// @public (undocumented)
16+
// @public
1717
export function getInstallations(app: FirebaseApp): FirebaseInstallations;
1818

19-
// @public (undocumented)
19+
// @public
2020
export function getToken(installations: FirebaseInstallations, forceRefresh?: boolean): Promise<string>;
2121

22-
// @public (undocumented)
22+
// @public
2323
export type IdChangeCallbackFn = (installationId: string) => void;
2424

25-
// @public (undocumented)
25+
// @public
2626
export type IdChangeUnsubscribeFn = () => void;
2727

2828
// @public

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": "9.1.1",
6+
"firebase-admin": "9.2.0",
77
"firebase-functions": "3.11.0"
88
},
99
"private": true,

integration/firebase/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
10-
"firebase": "7.20.0",
11-
"@babel/core": "7.11.4",
12-
"@babel/preset-env": "7.11.0",
10+
"firebase": "7.21.0",
11+
"@babel/core": "7.11.6",
12+
"@babel/preset-env": "7.11.5",
1313
"@types/chai": "4.2.12",
1414
"@types/mocha": "7.0.2",
1515
"chai": "4.2.0",
16-
"karma": "5.1.1",
16+
"karma": "5.2.2",
1717
"karma-babel-preprocessor": "8.0.1",
1818
"karma-chrome-launcher": "3.1.0",
1919
"karma-firefox-launcher": "1.3.0",
2020
"karma-mocha": "2.0.1",
2121
"karma-sauce-launcher": "1.2.0",
2222
"karma-spec-reporter": "0.0.32",
23-
"karma-typescript": "5.1.0",
23+
"karma-typescript": "5.2.0",
2424
"mocha": "7.2.0",
2525
"npm-run-all": "4.1.5",
2626
"typescript": "4.0.2"

integration/firestore/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
},
1616
"devDependencies": {
1717
"@firebase/app": "0.6.11",
18-
"@firebase/firestore": "1.16.7",
18+
"@firebase/firestore": "1.17.0",
1919
"@types/mocha": "7.0.2",
2020
"gulp": "4.0.2",
2121
"gulp-filter": "6.0.0",
2222
"gulp-replace": "1.0.0",
23-
"karma": "5.1.1",
23+
"karma": "5.2.2",
2424
"karma-chrome-launcher": "3.1.0",
2525
"karma-firefox-launcher": "1.3.0",
2626
"karma-mocha": "2.0.1",
2727
"karma-spec-reporter": "0.0.32",
2828
"mocha": "7.2.0",
29-
"ts-loader": "8.0.3",
29+
"ts-loader": "8.0.4",
3030
"typescript": "4.0.2",
31-
"webpack": "4.44.1",
31+
"webpack": "4.44.2",
3232
"webpack-stream": "5.2.1"
3333
}
3434
}

integration/messaging/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"test:manual": "mocha --exit"
1010
},
1111
"devDependencies": {
12-
"firebase": "7.20.0",
12+
"firebase": "7.21.0",
1313
"chai": "4.2.0",
14-
"chromedriver": "84.0.1",
14+
"chromedriver": "85.0.1",
1515
"express": "4.17.1",
1616
"geckodriver": "1.20.0",
1717
"mocha": "7.2.0",

integration/messaging/test/test-send.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ describe('Starting Integration Test > Sending and Receiving ', function () {
6767
}
6868

6969
TEST_DOMAINS.forEach(domain => {
70-
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${domain}`, function() {
71-
before(async function() {
70+
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${domain}`, function () {
71+
before(async function () {
7272
globalWebDriver = createPermittedWebDriver(
7373
/* browser= */ assistantBrowser.getId()
7474
);
7575
});
7676

77-
it('Background app can receive a {} empty message from sw', async function() {
77+
it('Background app can receive a {} empty message from sw', async function () {
7878
this.timeout(TIMEOUT_BACKGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
7979

8080
// Clearing the cache and db data by killing the previously instantiated driver. Note that
@@ -107,7 +107,7 @@ describe('Starting Integration Test > Sending and Receiving ', function () {
107107
);
108108
});
109109

110-
it('Background app can receive a {"data"} message frow sw', async function() {
110+
it('Background app can receive a {"data"} message frow sw', async function () {
111111
this.timeout(TIMEOUT_BACKGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
112112

113113
await seleniumAssistant.killWebDriver(globalWebDriver);
@@ -135,7 +135,6 @@ describe('Starting Integration Test > Sending and Receiving ', function () {
135135
/* expectedDataPayload= */ getTestDataPayload()
136136
);
137137
});
138-
139138
});
140139

141140
it('Foreground app can receive a {} empty message in onMessage', async function () {

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
],
6767
"devDependencies": {
6868
"@changesets/changelog-github": "0.2.7",
69-
"@changesets/cli": "2.10.2",
70-
"@microsoft/api-documenter": "7.8.36",
71-
"@microsoft/api-extractor": "7.9.11",
69+
"@changesets/cli": "2.10.3",
70+
"@microsoft/api-documenter": "7.8.53",
71+
"@microsoft/api-extractor": "7.9.19",
7272
"@types/chai": "4.2.12",
7373
"@types/chai-as-promised": "7.1.3",
7474
"@types/child-process-promise": "2.2.1",
@@ -78,7 +78,7 @@
7878
"@types/long": "4.0.1",
7979
"@types/mocha": "7.0.2",
8080
"@types/mz": "2.7.1",
81-
"@types/node": "12.12.54",
81+
"@types/node": "12.12.62",
8282
"@types/sinon": "9.0.5",
8383
"@types/sinon-chai": "3.2.4",
8484
"@types/tmp": "0.2.0",
@@ -95,21 +95,21 @@
9595
"coveralls": "3.1.0",
9696
"del": "5.1.0",
9797
"dependency-graph": "0.9.0",
98-
"eslint": "7.7.0",
98+
"eslint": "7.9.0",
9999
"eslint-plugin-import": "2.22.0",
100100
"express": "4.17.1",
101101
"find-free-port": "2.0.0",
102102
"firebase-functions": "3.11.0",
103-
"firebase-tools": "8.9.2",
103+
"firebase-tools": "8.10.0",
104104
"git-rev-sync": "3.0.1",
105105
"glob": "7.1.6",
106106
"http-server": "0.12.3",
107-
"husky": "4.2.5",
108-
"indexeddbshim": "6.6.0",
107+
"husky": "4.3.0",
108+
"indexeddbshim": "7.0.0",
109109
"inquirer": "7.3.3",
110110
"istanbul-instrumenter-loader": "3.0.1",
111111
"js-yaml": "3.14.0",
112-
"karma": "5.1.1",
112+
"karma": "5.2.2",
113113
"karma-chrome-launcher": "3.1.0",
114114
"karma-cli": "2.0.0",
115115
"karma-coverage-istanbul-reporter": "2.1.1",
@@ -134,25 +134,25 @@
134134
"npm-run-all": "4.1.5",
135135
"npm-run-path": "4.0.1",
136136
"nyc": "15.1.0",
137-
"ora": "5.0.0",
138-
"prettier": "2.1.1",
137+
"ora": "5.1.0",
138+
"prettier": "2.1.2",
139139
"protractor": "5.4.2",
140140
"rollup-plugin-copy": "3.3.0",
141-
"rxjs": "6.6.2",
141+
"rxjs": "6.6.3",
142142
"semver": "7.3.2",
143143
"simple-git": "2.20.1",
144144
"sinon": "9.0.3",
145145
"sinon-chai": "3.5.0",
146-
"source-map-loader": "1.0.2",
147-
"terser": "5.2.1",
148-
"ts-loader": "8.0.3",
149-
"ts-node": "8.10.2",
146+
"source-map-loader": "1.1.0",
147+
"terser": "5.3.2",
148+
"ts-loader": "8.0.4",
149+
"ts-node": "9.0.0",
150150
"tslint": "6.1.3",
151151
"typedoc": "0.16.11",
152152
"typescript": "4.0.2",
153153
"watch": "1.0.2",
154-
"webpack": "4.44.1",
155-
"yargs": "15.4.1"
154+
"webpack": "4.44.2",
155+
"yargs": "16.0.3"
156156
},
157157
"husky": {
158158
"hooks": {

packages-exp/app-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"xmlhttprequest": "1.8.0"
3838
},
3939
"devDependencies": {
40-
"rollup": "2.26.7",
40+
"rollup": "2.28.1",
4141
"rollup-plugin-json": "4.0.0",
4242
"rollup-plugin-replace": "2.2.0",
4343
"rollup-plugin-typescript2": "0.27.2",

packages-exp/app-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"license": "Apache-2.0",
4040
"devDependencies": {
41-
"rollup": "2.26.7",
41+
"rollup": "2.28.1",
4242
"rollup-plugin-json": "4.0.0",
4343
"rollup-plugin-replace": "2.2.0",
4444
"rollup-plugin-typescript2": "0.27.2",

packages-exp/firebase-exp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
"@firebase/app-exp": "0.0.800",
4141
"@firebase/app-compat": "0.0.800",
4242
"@firebase/functions-exp": "0.0.800",
43-
"@firebase/firestore": "1.16.7"
43+
"@firebase/firestore": "1.17.0"
4444
},
4545
"devDependencies": {
46-
"rollup": "2.26.7",
46+
"rollup": "2.28.1",
4747
"rollup-plugin-commonjs": "10.1.0",
4848
"rollup-plugin-license": "2.2.0",
4949
"rollup-plugin-node-resolve": "5.2.0",
5050
"rollup-plugin-sourcemaps": "0.6.2",
51-
"rollup-plugin-terser": "7.0.0",
51+
"rollup-plugin-terser": "7.0.2",
5252
"rollup-plugin-typescript2": "0.27.2",
5353
"rollup-plugin-uglify": "6.0.4",
5454
"gulp": "4.0.2",

packages-exp/functions-exp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"devDependencies": {
3838
"@firebase/app-exp": "0.0.800",
39-
"rollup": "2.26.7",
39+
"rollup": "2.28.1",
4040
"rollup-plugin-typescript2": "0.27.2",
4141
"typescript": "4.0.2"
4242
},
@@ -54,7 +54,7 @@
5454
"@firebase/functions-types-exp": "0.0.800",
5555
"@firebase/messaging-types": "0.5.0",
5656
"@firebase/util": "0.3.2",
57-
"isomorphic-fetch": "2.2.1",
57+
"node-fetch": "2.6.1",
5858
"tslib": "^1.11.1"
5959
},
6060
"nyc": {

packages-exp/functions-exp/src/config.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,31 @@ import { FUNCTIONS_TYPE } from './constants';
2727

2828
export const DEFAULT_REGION = 'us-central1';
2929

30-
const factory: InstanceFactory<'functions'> = (
31-
container: ComponentContainer,
32-
region?: string
33-
) => {
34-
// Dependencies
35-
const app = container.getProvider('app-exp').getImmediate();
36-
const authProvider = container.getProvider('auth-internal');
37-
const messagingProvider = container.getProvider('messaging');
30+
export function registerFunctions(fetchImpl: typeof fetch): void {
31+
const factory: InstanceFactory<'functions'> = (
32+
container: ComponentContainer,
33+
region?: string
34+
) => {
35+
// Dependencies
36+
const app = container.getProvider('app-exp').getImmediate();
37+
const authProvider = container.getProvider('auth-internal');
38+
const messagingProvider = container.getProvider('messaging');
3839

39-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
40-
return new FunctionsService(app, authProvider, messagingProvider, region);
41-
};
42-
43-
export function registerFunctions(): void {
44-
const namespaceExports = {
45-
// no-inline
46-
Functions: FunctionsService
40+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
41+
return new FunctionsService(
42+
app,
43+
authProvider,
44+
messagingProvider,
45+
region,
46+
fetchImpl
47+
);
4748
};
4849

4950
_registerComponent(
50-
new Component(FUNCTIONS_TYPE, factory, ComponentType.PUBLIC)
51-
.setServiceProps(namespaceExports)
52-
.setMultipleInstances(true)
51+
new Component(
52+
FUNCTIONS_TYPE,
53+
factory,
54+
ComponentType.PUBLIC
55+
).setMultipleInstances(true)
5356
);
5457
}

packages-exp/functions-exp/src/index.node.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
*/
1717
import { registerVersion } from '@firebase/app-exp';
1818
import { registerFunctions } from './config';
19-
import 'isomorphic-fetch';
19+
import nodeFetch from 'node-fetch';
2020

2121
import { name, version } from '../package.json';
2222

2323
export * from './api';
2424

25-
registerFunctions();
25+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
26+
registerFunctions(nodeFetch as any);
2627
registerVersion(name, version, 'node');

packages-exp/functions-exp/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ import { name, version } from '../package.json';
2121

2222
export * from './api';
2323

24-
registerFunctions();
24+
registerFunctions(fetch);
2525
registerVersion(name, version);

0 commit comments

Comments
 (0)