Skip to content

Commit 7a75101

Browse files
committed
Merge branch 'master' of github.com:firebase/firebase-js-sdk into markduckworth/nested-update-data-v9
2 parents de6475a + 039f05f commit 7a75101

File tree

150 files changed

+2810
-2090
lines changed

Some content is hidden

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

150 files changed

+2810
-2090
lines changed

.changeset/eighty-tomatoes-trade.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@firebase/firestore": patch
3+
"firebase": patch
4+
---
5+
6+
Fix an issue where localCache is not copied as part of Settings.

.changeset/sour-glasses-count.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/firestore': patch
3+
'firebase': patch
4+
---
5+
6+
Fix source maps that incorrectly referenced yet another minified and mangled bundle, rendering them useless. The fixed bundles' source maps are: index.esm2017.js, index.cjs.js, index.node.mjs, and index.browser.esm2017.js (lite sdk only).

.github/ISSUE_TEMPLATE/bug_report.md

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

.github/ISSUE_TEMPLATE/bug_report_v2.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: 🐞 Bug Report V2
1+
name: 🐞 Bug Report
22
description: File a bug report
3-
title: '[Bug]: '
4-
labels: 'new, type: question'
3+
title: 'Title for the bug'
4+
labels: 'question, new'
55
body:
66
- type: markdown
77
id: before-you-start

.github/workflows/release-staging.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
options:
1717
- master
1818
- v8
19+
verbose:
20+
description: 'Enable verbose logging'
21+
type: boolean
22+
default: false
1923

2024
jobs:
2125
deploy:
@@ -28,6 +32,8 @@ jobs:
2832
uses: actions/setup-node@v3
2933
with:
3034
node-version: 16.x
35+
- name: Bump Node memory limit
36+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
3137
- name: Merge master into release
3238
uses: actions/github-script@v6
3339
with:
@@ -107,6 +113,7 @@ jobs:
107113
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
108114
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
109115
CI: true
116+
VERBOSE_NPM_LOGGING: ${{github.event.inputs.verbose}}
110117
- name: Get release version
111118
id: get-version
112119
# STAGING_VERSION = version with staging hash, e.g. 1.2.3-20430523

.github/workflows/test-all.yml

Lines changed: 137 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
env:
88
# make chromedriver detect installed Chrome version and download the corresponding driver
99
DETECT_CHROMEDRIVER_VERSION: true
10+
artifactRetentionDays: 2
1011

1112
jobs:
12-
test:
13-
name: Node.js and Browser (Chrome) Tests
13+
build:
14+
name: Build the SDK
1415
runs-on: ubuntu-latest
15-
1616
steps:
17-
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
17+
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
18+
# setting up the repo. This must be done to build and execute Auth properly.
1819
- name: install Chrome stable
1920
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
2021
# Temporary: Auth team will explore what's going wrong with the auth tests.
@@ -36,11 +37,142 @@ jobs:
3637
yarn
3738
- name: yarn build
3839
run: yarn build
40+
- name: Archive build
41+
if: ${{ !cancelled() }}
42+
run: |
43+
tar -cf build.tar .
44+
gzip build.tar
45+
- name: Upload build archive
46+
if: ${{ !cancelled() }}
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: build.tar.gz
50+
path: build.tar.gz
51+
retention-days: ${{ env.artifactRetentionDays }}
52+
53+
# Auth and Firestore are built and executed in their own jobs in an attempt to reduce flakiness.
54+
test-the-rest:
55+
name: (bulk) Node.js and Browser (Chrome) Tests
56+
needs: build
57+
runs-on: ubuntu-latest
58+
steps:
59+
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
60+
- name: install Chrome stable
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install google-chrome-stable
64+
- name: Download build archive
65+
uses: actions/download-artifact@v3
66+
with:
67+
name: build.tar.gz
68+
- name: Unzip build artifact
69+
run: tar xf build.tar.gz
70+
- name: Set up Node (16)
71+
uses: actions/setup-node@v3
72+
with:
73+
node-version: 16.x
74+
- name: Bump Node memory limit
75+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
76+
- name: Test setup and yarn install
77+
run: |
78+
cp config/ci.config.json config/project.json
79+
yarn
80+
- name: Set start timestamp env var
81+
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
82+
- name: Run unit tests
83+
# Ignore auth and firestore since they're handled in their own separate jobs.
84+
run: |
85+
xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' --concurrency 4 test:ci
86+
node scripts/print_test_logs.js
87+
env:
88+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
89+
- name: Generate coverage file
90+
run: yarn ci:coverage
91+
- name: Run coverage
92+
uses: coverallsapp/github-action@master
93+
with:
94+
github-token: ${{ secrets.GITHUB_TOKEN }}
95+
path-to-lcov: ./lcov-all.info
96+
continue-on-error: true
97+
98+
test-auth:
99+
name: (Auth) Node.js and Browser (Chrome) Tests
100+
needs: build
101+
runs-on: ubuntu-latest
102+
steps:
103+
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
104+
- name: install Chrome stable
105+
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
106+
# Temporary: Auth team will explore what's going wrong with the auth tests.
107+
run: |
108+
sudo apt-get update
109+
sudo apt-get install wget
110+
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_110.0.5481.177-1_amd64.deb
111+
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
112+
- name: Download build archive
113+
uses: actions/download-artifact@v3
114+
with:
115+
name: build.tar.gz
116+
- name: Unzip build artifact
117+
run: tar xf build.tar.gz
118+
- name: Set up Node (16)
119+
uses: actions/setup-node@v3
120+
with:
121+
node-version: 16.x
122+
- name: Bump Node memory limit
123+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
124+
- name: Test setup and yarn install
125+
run: |
126+
cp config/ci.config.json config/project.json
127+
yarn
128+
- name: Set start timestamp env var
129+
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
130+
- name: Run unit tests
131+
run: |
132+
xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/auth*'
133+
node scripts/print_test_logs.js
134+
env:
135+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
136+
- name: Generate coverage file
137+
run: yarn ci:coverage
138+
- name: Run coverage
139+
uses: coverallsapp/github-action@master
140+
with:
141+
github-token: ${{ secrets.GITHUB_TOKEN }}
142+
path-to-lcov: ./lcov-all.info
143+
continue-on-error: true
144+
145+
test-firestore:
146+
name: (Firestore) Node.js and Browser (Chrome) Tests
147+
needs: build
148+
runs-on: ubuntu-latest
149+
steps:
150+
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
151+
- name: install Chrome stable
152+
run: |
153+
sudo apt-get update
154+
sudo apt-get install google-chrome-stable
155+
- name: Download build archive
156+
uses: actions/download-artifact@v3
157+
with:
158+
name: build.tar.gz
159+
- name: Unzip build artifact
160+
run: tar xf build.tar.gz
161+
- name: Set up Node (16)
162+
uses: actions/setup-node@v3
163+
with:
164+
node-version: 16.x
165+
- name: Bump Node memory limit
166+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
167+
- name: Test setup and yarn install
168+
run: |
169+
cp config/ci.config.json config/project.json
170+
yarn
39171
- name: Set start timestamp env var
40172
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
41173
- name: Run unit tests
42174
run: |
43-
xvfb-run yarn test:ci
175+
xvfb-run yarn lerna run --concurrency 4 test:ci --scope '{@firebase/firestore*,firebase-firestore-integration-test}'
44176
node scripts/print_test_logs.js
45177
env:
46178
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Firebase Javascript SDK
22

33
<!-- BADGES -->
4-
![Build Status](https://img.shields.io/github/workflow/status/firebase/firebase-js-sdk/Run%20All%20Tests.svg)
4+
![Build Status](https://img.shields.io/github/actions/workflow/status/firebase/firebase-js-sdk/test-all.yml)
55
[![Version](https://img.shields.io/npm/v/firebase.svg?label=version)](https://www.npmjs.com/package/firebase)
66
[![Coverage Status](https://coveralls.io/repos/github/firebase/firebase-js-sdk/badge.svg?branch=master)](https://coveralls.io/github/firebase/firebase-js-sdk?branch=master)
77
<!-- END BADGES -->
@@ -29,7 +29,9 @@ Please see [Environment Support](https://firebase.google.com/support/guides/envi
2929
#### Node.js
3030

3131
Before you can start working on the Firebase JS SDK, you need to have Node.js
32-
installed on your machine. The currently supported versions are `10.15.0` through `16.6.0`.
32+
installed on your machine. As of June 13th, 2023 the team has been testing with Node.js versions
33+
between `16.4.0` and `16.16.0`, but the required verison of Node.js may change as we update
34+
our dependencies.
3335

3436
To download Node.js visit https://nodejs.org/en/download/.
3537

@@ -50,7 +52,7 @@ $ yarn set version 1.22.11
5052

5153
#### Java
5254

53-
The closure compiler requires a modern Java installation. Java 11+ should be installed: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
55+
The closure compiler requires a modern Java installation. Java 11+ should be installed: https://www.oracle.com/java/technologies/downloads/#java11
5456

5557
#### Verify Prerequisites
5658

@@ -62,7 +64,7 @@ $ yarn -v
6264
$ java -version
6365
```
6466

65-
Your `node` version should be between `10.15.0` and `16.6.0`, your `yarn` version should
67+
Your `node` version should be between `16.4.0` and `16.6.0`, your `yarn` version should
6668
be between `1.0.0` and `1.22.11`, and your `java` version should be `11.0` or greater.
6769

6870
_NOTE: We will update the documentation as new versions are required, however

common/api-review/firestore-lite.api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,21 @@ export function getFirestore(): Firestore;
218218
// @public
219219
export function getFirestore(app: FirebaseApp): Firestore;
220220

221+
// @beta
222+
export function getFirestore(databaseId: string): Firestore;
223+
224+
// @beta
225+
export function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
226+
221227
// @public
222228
export function increment(n: number): FieldValue;
223229

224230
// @public
225231
export function initializeFirestore(app: FirebaseApp, settings: Settings): Firestore;
226232

233+
// @beta
234+
export function initializeFirestore(app: FirebaseApp, settings: Settings, databaseId?: string): Firestore;
235+
227236
// @public
228237
export function limit(limit: number): QueryLimitConstraint;
229238

common/api-review/firestore.api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,15 @@ export function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnapshot<T>>
277277
// @public
278278
export function getFirestore(app: FirebaseApp): Firestore;
279279

280+
// @beta
281+
export function getFirestore(databaseId: string): Firestore;
282+
280283
// @public
281284
export function getFirestore(): Firestore;
282285

286+
// @beta
287+
export function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
288+
283289
// @public
284290
export function increment(n: number): FieldValue;
285291

common/api-review/functions.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export function httpsCallableFromURL<RequestData = unknown, ResponseData = unkno
4343

4444
// @public
4545
export interface HttpsCallableOptions {
46+
limitedUseAppCheckTokens?: boolean;
4647
timeout?: number;
4748
}
4849

config/functions/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ exports.instanceIdTest = functions.https.onRequest((request, response) => {
7676
});
7777
});
7878

79+
exports.appCheckTest = functions.https.onRequest((request, response) => {
80+
cors(request, response, () => {
81+
const token = request.get('X-Firebase-AppCheck');
82+
assert.equal(token !== undefined, true);
83+
assert.deepEqual(request.body, { data: {} });
84+
response.send({ data: { token } });
85+
});
86+
});
87+
7988
exports.nullTest = functions.https.onRequest((request, response) => {
8089
cors(request, response, () => {
8190
assert.deepEqual(request.body, { data: null });

docs-devsite/analytics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# analytics package
13-
Firebase Analytics
13+
The Firebase Analytics Web SDK. This SDK does not work in a Node.js environment.
1414

1515
## Functions
1616

docs-devsite/app-check.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# app-check package
13-
Firebase App Check
13+
The Firebase App Check Web SDK.
14+
15+
Firebase App Check does not work in a Node.js environment using `ReCaptchaV3Provider` or `ReCaptchaEnterpriseProvider`<!-- -->, but can be used in Node.js if you use `CustomProvider` and write your own attestation method.
1416

1517
## Functions
1618

docs-devsite/auth.auth.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ This will affect the currently saved Auth session and applies this type of persi
221221

222222
This makes it easy for a user signing in to specify whether their session should be remembered or not. It also makes it easier to never persist the Auth state for applications that are shared by other users or have sensitive data.
223223

224+
This method does not work in a Node.js environment.
225+
224226
<b>Signature:</b>
225227

226228
```typescript

0 commit comments

Comments
 (0)