Skip to content

Commit c26a7ec

Browse files
committed
Merge branch 'master' into khanrafi/webchannelupgrade
2 parents 3c34f6d + 7bf7379 commit c26a7ec

File tree

282 files changed

+16035
-4901
lines changed

Some content is hidden

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

282 files changed

+16035
-4901
lines changed

.changeset/cold-impalas-drop.md

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

.changeset/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"@firebase/app-types-exp",
1515
"@firebase/functions-exp",
1616
"@firebase/functions-types-exp",
17+
"@firebase/installations-exp",
18+
"@firebase/installations-types-exp",
1719
"@firebase/testing",
1820
"firebase-exp",
1921
"@firebase/app-compat",

.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/small-grapes-teach.md

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

.changeset/tall-mugs-shop.md

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

.github/workflows/health-metrics-test.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ name: Health Metrics
22

33
on: [push, pull_request]
44

5+
env:
6+
METRICS_SERVICE_URL: ${{ secrets.METRICS_SERVICE_URL }}
7+
GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
8+
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
9+
510
jobs:
6-
binary-size-test:
11+
binary-size:
712
name: Binary Size
813
if: github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)
914
runs-on: ubuntu-latest
10-
env:
11-
METRICS_SERVICE_URL: ${{ secrets.METRICS_SERVICE_URL }}
12-
GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
13-
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
1415
steps:
1516
- uses: actions/checkout@v2
1617
- uses: actions/setup-node@v1
@@ -19,12 +20,24 @@ jobs:
1920
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
2021
with:
2122
service_account_key: ${{ secrets.GCP_SA_KEY }}
22-
- run: cp config/ci.config.json config/project.json
2323
- run: yarn install
2424
- run: yarn build
2525
- name: Run health-metrics/binary-size test
2626
run: yarn size-report
27+
modular-export-size:
28+
name: Binary Size For Modular Exports
29+
if: github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: actions/setup-node@v1
34+
with:
35+
node-version: 10.x
36+
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
37+
with:
38+
service_account_key: ${{ secrets.GCP_SA_KEY }}
39+
- run: yarn install
40+
- run: yarn build
2741
- name: Run health-metrics/modular-exports-binary-size test
2842
run: yarn modular-export-size-report
29-
3043
# TODO(yifany): Enable startup times testing on CI.

.github/workflows/test-changed-auth.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: pull_request
44

55
jobs:
66
test:
7-
name: If Changed
7+
name: Test Auth If Changed
88
runs-on: ubuntu-latest
99

1010
steps:

.github/workflows/test-changed-fcm-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: pull_request
44

55
jobs:
66
test:
7-
name: If Changed
7+
name: Test FCM integration If Changed
88
runs-on: ubuntu-latest
99

1010
steps:

.github/workflows/test-changed-firestore-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: pull_request
44

55
jobs:
66
test:
7-
name: If Changed
7+
name: Test Firestore Integration If Changed
88
runs-on: ubuntu-latest
99

1010
steps:

.github/workflows/test-changed-firestore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: pull_request
44

55
jobs:
66
test:
7-
name: If Changed
7+
name: Test Firestore If Changed
88
runs-on: ubuntu-latest
99

1010
steps:

.github/workflows/test-changed-misc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: pull_request
44

55
jobs:
66
test:
7-
name: If Changed
7+
name: Test Misc Packages If Changed
88
runs-on: ubuntu-latest
99

1010
steps:

.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
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## API Report File for "@firebase/installations-exp"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
import { FirebaseApp } from '@firebase/app-types-exp';
8+
import { FirebaseInstallations } from '@firebase/installations-types-exp';
9+
10+
// @public
11+
export function deleteInstallations(installations: FirebaseInstallations): Promise<void>;
12+
13+
// @public
14+
export function getId(installations: FirebaseInstallations): Promise<string>;
15+
16+
// @public
17+
export function getInstallations(app: FirebaseApp): FirebaseInstallations;
18+
19+
// @public
20+
export function getToken(installations: FirebaseInstallations, forceRefresh?: boolean): Promise<string>;
21+
22+
// @public
23+
export type IdChangeCallbackFn = (installationId: string) => void;
24+
25+
// @public
26+
export type IdChangeUnsubscribeFn = () => void;
27+
28+
// @public
29+
export function onIdChange(installations: FirebaseInstallations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;
30+
31+
32+
// (No @packageDocumentation comment for this package)
33+
34+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## API Report File for "@firebase/installations-types-exp"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
// @public (undocumented)
8+
export interface FirebaseInstallations {}
9+
10+
// @internal
11+
export interface _FirebaseInstallationsInternal {
12+
getId(): Promise<string>;
13+
14+
getToken(forceRefresh?: boolean): Promise<string>;
15+
}
16+
17+
18+
// (No @packageDocumentation comment for this package)
19+
20+
```

config/ci.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"databaseURL": "https://jscore-sandbox-141b5.firebaseio.com",
55
"projectId": "jscore-sandbox-141b5",
66
"storageBucket": "jscore-sandbox-141b5.appspot.com",
7-
"messagingSenderId": "280127633210"
7+
"messagingSenderId": "280127633210",
8+
"appId": "1:280127633210:web:1eb2f7e8799c4d5a46c203"
89
}

integration/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
10-
"firebase": "7.19.1",
10+
"firebase": "7.21.0",
1111
"@babel/core": "7.11.4",
1212
"@babel/preset-env": "7.11.0",
1313
"@types/chai": "4.2.12",

integration/firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome"
1515
},
1616
"devDependencies": {
17-
"@firebase/app": "0.6.10",
18-
"@firebase/firestore": "1.16.6",
17+
"@firebase/app": "0.6.11",
18+
"@firebase/firestore": "1.17.0",
1919
"@types/mocha": "7.0.2",
2020
"gulp": "4.0.2",
2121
"gulp-filter": "6.0.0",

integration/messaging/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"test:manual": "mocha --exit"
1010
},
1111
"devDependencies": {
12-
"firebase": "7.19.1",
12+
"firebase": "7.21.0",
1313
"chai": "4.2.0",
1414
"chromedriver": "84.0.1",
1515
"express": "4.17.1",
1616
"geckodriver": "1.20.0",
1717
"mocha": "7.2.0",
18-
"node-fetch": "2.6.0",
18+
"node-fetch": "2.6.1",
1919
"selenium-assistant": "6.1.0"
2020
}
2121
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"dev": "lerna run --parallel --scope @firebase/* --scope firebase --scope rxfire dev",
2525
"build": "lerna run --scope @firebase/app-exp build:deps && lerna run --scope @firebase/* --scope firebase --scope rxfire --ignore @firebase/app-exp build",
2626
"build:exp": "lerna run --scope @firebase/*-exp --scope @firebase/*-compat --scope firebase-exp build",
27-
"build:release": "lerna run --scope @firebase/app-exp build:deps && lerna run --scope @firebase/* --scope firebase --scope rxfire --ignore @firebase/*-exp prepare",
27+
"build:release": "lerna run --scope @firebase/app-exp build:deps && lerna run --scope @firebase/* --scope firebase --scope rxfire --ignore @firebase/*-exp --ignore @firebase/*-compat prepare",
2828
"build:exp:release": "yarn --cwd packages/app build:deps && lerna run --scope @firebase/*-exp --scope @firebase/*-compat --scope firebase-exp prepare && yarn --cwd packages-exp/app-exp typings:public",
2929
"build:changed": "ts-node-script scripts/ci-test/build_changed.ts",
3030
"link:packages": "lerna exec --scope @firebase/* --scope firebase --scope rxfire -- yarn link",
@@ -101,7 +101,7 @@
101101
"find-free-port": "2.0.0",
102102
"firebase-functions": "3.11.0",
103103
"firebase-tools": "8.9.2",
104-
"git-rev-sync": "2.0.0",
104+
"git-rev-sync": "3.0.1",
105105
"glob": "7.1.6",
106106
"http-server": "0.12.3",
107107
"husky": "4.2.5",

packages-exp/app-compat/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"esm2017": "dist/index.esm2017.js",
1111
"lite": "dist/index.lite.js",
1212
"lite-esm2017": "dist/index.lite.esm2017.js",
13-
"files": [
14-
"dist"
15-
],
13+
"files": ["dist"],
1614
"scripts": {
1715
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1816
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
@@ -31,9 +29,9 @@
3129
"license": "Apache-2.0",
3230
"dependencies": {
3331
"@firebase/app-exp": "0.0.800",
34-
"@firebase/util": "0.3.1",
32+
"@firebase/util": "0.3.2",
3533
"@firebase/logger": "0.2.6",
36-
"@firebase/component": "0.1.18",
34+
"@firebase/component": "0.1.19",
3735
"tslib": "^1.11.1",
3836
"dom-storage": "2.1.0",
3937
"xmlhttprequest": "1.8.0"
@@ -60,4 +58,4 @@
6058
],
6159
"reportDir": "./coverage/node"
6260
}
63-
}
61+
}

packages-exp/app-exp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
},
3232
"dependencies": {
3333
"@firebase/app-types-exp": "0.0.800",
34-
"@firebase/util": "0.3.1",
34+
"@firebase/util": "0.3.2",
3535
"@firebase/logger": "0.2.6",
36-
"@firebase/component": "0.1.18",
36+
"@firebase/component": "0.1.19",
3737
"tslib": "^1.11.1"
3838
},
3939
"license": "Apache-2.0",

packages-exp/firebase-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
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.6"
43+
"@firebase/firestore": "1.17.0"
4444
},
4545
"devDependencies": {
4646
"rollup": "2.26.7",

packages-exp/functions-exp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
},
5151
"typings": "dist/functions-exp-public.d.ts",
5252
"dependencies": {
53-
"@firebase/component": "0.1.18",
53+
"@firebase/component": "0.1.19",
5454
"@firebase/functions-types-exp": "0.0.800",
5555
"@firebase/messaging-types": "0.5.0",
56-
"@firebase/util": "0.3.1",
57-
"isomorphic-fetch": "2.2.1",
56+
"@firebase/util": "0.3.2",
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)