Skip to content

Commit 7594809

Browse files
committed
Merge remote-tracking branch 'origin/master' into ErrorToFirestoreError
2 parents 476b366 + f47f990 commit 7594809

File tree

117 files changed

+8923
-1815
lines changed

Some content is hidden

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

117 files changed

+8923
-1815
lines changed

.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/great-dolphins-tie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/database": patch
3+
---
4+
5+
The SDK can now infer a default database URL if none is provided in the config.

.changeset/swift-pillows-retire.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/remote-config': patch
3+
---
4+
5+
Moved `calculateBackoffMillis()` exponential backoff function to util and have remote-config
6+
import it from util.

.changeset/thin-rivers-relax.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/util': patch
3+
---
4+
5+
Moved `calculateBackoffMillis()` exponential backoff function from remote-config to util,
6+
where it can be shared between packages.

.changeset/witty-deers-study.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@firebase/analytics': minor
3+
'@firebase/analytics-types': minor
4+
'firebase': minor
5+
---
6+
7+
Analytics now dynamically fetches the app's Measurement ID from the Dynamic Config backend
8+
instead of depending on the local Firebase config. It will fall back to any `measurementId`
9+
value found in the local config if the Dynamic Config fetch fails.

.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.
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 (undocumented)
11+
export function deleteInstallations(installations: FirebaseInstallations): Promise<void>;
12+
13+
// @public (undocumented)
14+
export function getId(installations: FirebaseInstallations): Promise<string>;
15+
16+
// @public (undocumented)
17+
export function getInstallations(app: FirebaseApp): FirebaseInstallations;
18+
19+
// @public (undocumented)
20+
export function getToken(installations: FirebaseInstallations, forceRefresh?: boolean): Promise<string>;
21+
22+
// @public (undocumented)
23+
export type IdChangeCallbackFn = (installationId: string) => void;
24+
25+
// @public (undocumented)
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
}

package.json

Lines changed: 1 addition & 1 deletion
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",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
module.exports = {
19+
extends: '../../config/.eslintrc.js',
20+
parserOptions: {
21+
project: 'tsconfig.json',
22+
// to make vscode-eslint work with monorepo
23+
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
24+
tsconfigRootDir: __dirname
25+
}
26+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../config/api-extractor.json",
3+
// Point it to your entry point d.ts file.
4+
"mainEntryPointFilePath": "<projectFolder>/dist/src/index.d.ts",
5+
"dtsRollup": {
6+
"enabled": true
7+
}
8+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* @license
3+
* Copyright 2019 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+
const karmaBase = require('../../config/karma.base');
19+
20+
const files = [`src/**/*.test.ts`];
21+
22+
module.exports = function (config) {
23+
const karmaConfig = {
24+
...karmaBase,
25+
// files to load into karma
26+
files,
27+
// frameworks to use
28+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
29+
frameworks: ['mocha']
30+
};
31+
32+
config.set(karmaConfig);
33+
};
34+
35+
module.exports.files = files;
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "@firebase/installations-exp",
3+
"version": "0.0.800",
4+
"private": true,
5+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
6+
"main": "dist/index.cjs.js",
7+
"module": "dist/index.esm.js",
8+
"browser": "dist/index.esm.js",
9+
"esm2017": "dist/index.esm2017.js",
10+
"typings": "dist/installations-exp.d.ts",
11+
"license": "Apache-2.0",
12+
"files": [
13+
"dist"
14+
],
15+
"scripts": {
16+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
17+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
18+
"build": "rollup -c && yarn api-report",
19+
"build:deps": "lerna run --scope @firebase/installations-exp --include-dependencies build",
20+
"dev": "rollup -c -w",
21+
"test": "yarn type-check && yarn test:karma && yarn lint",
22+
"test:ci": "node ../../scripts/run_tests_in_ci.js",
23+
"test:karma": "karma start --single-run",
24+
"test:debug": "karma start --browsers=Chrome --auto-watch",
25+
"type-check": "tsc -p . --noEmit",
26+
"serve": "yarn serve:build && yarn serve:host",
27+
"serve:build": "rollup -c test-app/rollup.config.js",
28+
"serve:host": "http-server -c-1 test-app",
29+
"prepare": "yarn build",
30+
"api-report": "api-extractor run --local --verbose",
31+
"predoc": "node ../../scripts/exp/remove-exp.js temp",
32+
"doc": "api-documenter markdown --input temp --output docs",
33+
"build:doc": "yarn build && yarn doc"
34+
},
35+
"repository": {
36+
"directory": "packages-exp/installations-exp",
37+
"type": "git",
38+
"url": "https://github.com/firebase/firebase-js-sdk.git"
39+
},
40+
"bugs": {
41+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
42+
},
43+
"devDependencies": {
44+
"@firebase/app-exp": "0.0.800",
45+
"rollup": "2.26.7",
46+
"rollup-plugin-commonjs": "10.1.0",
47+
"rollup-plugin-json": "4.0.0",
48+
"rollup-plugin-node-resolve": "5.2.0",
49+
"rollup-plugin-typescript2": "0.27.2",
50+
"rollup-plugin-uglify": "6.0.4",
51+
"typescript": "4.0.2"
52+
},
53+
"peerDependencies": {
54+
"@firebase/app-exp": "0.x",
55+
"@firebase/app-types-exp": "0.x"
56+
},
57+
"dependencies": {
58+
"@firebase/installations-types-exp": "0.0.800",
59+
"@firebase/util": "0.3.1",
60+
"@firebase/component": "0.1.18",
61+
"idb": "3.0.2",
62+
"tslib": "^1.11.1"
63+
}
64+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* @license
3+
* Copyright 2019 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 json from 'rollup-plugin-json';
19+
import typescriptPlugin from 'rollup-plugin-typescript2';
20+
import pkg from './package.json';
21+
import typescript from 'typescript';
22+
23+
const deps = Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies });
24+
25+
/**
26+
* ES5 Builds
27+
*/
28+
const es5BuildPlugins = [typescriptPlugin({ typescript }), json()];
29+
30+
const es5Builds = [
31+
{
32+
input: 'src/index.ts',
33+
output: [
34+
{ file: pkg.main, format: 'cjs', sourcemap: true },
35+
{ file: pkg.module, format: 'es', sourcemap: true }
36+
],
37+
plugins: es5BuildPlugins,
38+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
39+
}
40+
];
41+
42+
/**
43+
* ES2017 Builds
44+
*/
45+
const es2017BuildPlugins = [
46+
typescriptPlugin({
47+
typescript,
48+
tsconfigOverride: {
49+
compilerOptions: {
50+
target: 'es2017'
51+
}
52+
}
53+
}),
54+
json({ preferConst: true })
55+
];
56+
57+
const es2017Builds = [
58+
{
59+
input: 'src/index.ts',
60+
output: {
61+
file: pkg.esm2017,
62+
format: 'es',
63+
sourcemap: true
64+
},
65+
plugins: es2017BuildPlugins,
66+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
67+
}
68+
];
69+
70+
export default [...es5Builds, ...es2017Builds];

0 commit comments

Comments
 (0)