Skip to content

Commit c0f9b62

Browse files
Merge master into release
2 parents 4b4cdd0 + 3ee35f9 commit c0f9b62

Some content is hidden

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

60 files changed

+1525
-559
lines changed

.changeset/eleven-cycles-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/storage": patch
3+
---
4+
5+
Fixed issue where pause throws an error when a request is in flight.

.changeset/heavy-mirrors-drum.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/auth-interop-types': patch
3+
---
4+
5+
Remove unused peerDependencies.

.changeset/nervous-ads-pretend.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+
Fixed issue where connectDatabaseToEmulator can be called twice during a hot reload

.changeset/pretty-carrots-kneel.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+
Replace `innerHTML` call with `textContent`.

.changeset/quick-radios-obey.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+
Update canonifyFilter to compute the canonization for flat conjunctions the same as implicit AND queries.

.changeset/stupid-swans-fix.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+
Fix an issue that stops some performance optimization being applied.

.changeset/tricky-ravens-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/auth': patch
3+
---
4+
5+
Fix to minimize a potential race condition between auth init and signInWithRedirect

.changeset/wild-frogs-play.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+
Fix documentation for getDocsFromCache.

.changeset/wild-geckos-fetch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/util': patch
3+
---
4+
5+
Reformat a comment that causes compile errors in some build toolchains.

.changeset/young-hornets-rescue.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/util': minor
3+
'firebase': minor
4+
---
5+
6+
Allow users to specify their environment as `node` or `browser` to override Firebase's runtime environment detection and force the SDK to act as if it were in the respective environment.

.github/workflows/merge-release-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
export VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
2020
export VERSION=`node -e "${VERSION_SCRIPT}"`
21-
echo "::set-output name=RELEASE_VERSION::$VERSION"
21+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
2222
- name: Echo version in shell
2323
run: |
2424
echo "Merging release ${{ steps.get-version.outputs.RELEASE_VERSION }}"

.github/workflows/release-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
run: |
9696
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
9797
VERSION=`node -e "${VERSION_SCRIPT}"`
98-
echo "::set-output name=BASE_VERSION::$VERSION"
98+
echo "BASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
9999
- name: Echo version in shell
100100
run: |
101101
echo "Base version: ${{ steps.get-version.outputs.BASE_VERSION }}"

.github/workflows/release-staging.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ jobs:
114114
run: |
115115
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
116116
VERSION=`node -e "${VERSION_SCRIPT}"`
117-
echo "::set-output name=STAGING_VERSION::$VERSION"
117+
echo "STAGING_VERSION=$VERSION" >> $GITHUB_OUTPUT
118118
BASE_VERSION=$(echo $VERSION | cut -d "-" -f 1)
119-
echo "::set-output name=BASE_VERSION::$BASE_VERSION"
119+
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_OUTPUT
120120
- name: Echo versions in shell
121121
run: |
122122
echo "Staging release ${{ steps.get-version.outputs.STAGING_VERSION }}"

common/api-review/util.api.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export interface FirebaseDefaults {
193193
config?: Record<string, string>;
194194
// (undocumented)
195195
emulatorHosts?: Record<string, string>;
196+
forceEnvironment?: 'browser' | 'node';
196197
}
197198

198199
// Warning: (ae-missing-release-tag) "FirebaseError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -221,11 +222,12 @@ export const getDefaultEmulatorHost: (productName: string) => string | undefined
221222
// @public
222223
export const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined;
223224

225+
// @public
226+
export const getDefaults: () => FirebaseDefaults | undefined;
227+
224228
// @public
225229
export const getExperimentalSetting: <T extends ExperimentalKey>(name: T) => FirebaseDefaults[`_${T}`];
226230

227-
// Warning: (ae-missing-release-tag) "getGlobal" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
228-
//
229231
// @public
230232
export function getGlobal(): typeof globalThis;
231233

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": "11.0.0",
6+
"firebase-admin": "11.3.0",
77
"firebase-functions": "3.24.1"
88
},
99
"private": true,

e2e/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@types/chai": "4.3.4",
2525
"@types/mocha": "9.1.1",
2626
"babel-loader": "8.2.5",
27-
"chai": "4.3.6",
27+
"chai": "4.3.7",
2828
"karma": "6.4.1",
2929
"karma-chrome-launcher": "3.1.1",
3030
"karma-mocha": "2.0.1",
@@ -33,7 +33,7 @@
3333
"karma-typescript-es6-transform": "5.5.3",
3434
"mocha": "9.2.2",
3535
"typescript": "4.3.4",
36-
"webpack": "5.74.0",
36+
"webpack": "5.75.0",
3737
"webpack-cli": "4.10.0",
3838
"webpack-dev-server": "4.10.0"
3939
}

integration/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"firebase": "9.15.0",
1111
"@types/chai": "4.3.4",
1212
"@types/mocha": "9.1.1",
13-
"chai": "4.3.6",
13+
"chai": "4.3.7",
1414
"karma": "6.4.1",
1515
"karma-babel-preprocessor": "8.0.2",
1616
"karma-chrome-launcher": "3.1.1",

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"devDependencies": {
1212
"firebase": "9.15.0",
13-
"chai": "4.3.6",
13+
"chai": "4.3.7",
1414
"chromedriver": "98.0.1",
1515
"express": "4.18.2",
1616
"geckodriver": "2.0.4",

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"@types/node": "12.20.50",
8484
"@types/request": "2.48.8",
8585
"@types/sinon": "9.0.11",
86-
"@types/sinon-chai": "3.2.8",
86+
"@types/sinon-chai": "3.2.9",
8787
"@types/tmp": "0.2.3",
8888
"@types/yargs": "17.0.13",
8989
"@typescript-eslint/eslint-plugin": "5.43.0",
@@ -92,7 +92,7 @@
9292
"api-documenter-me": "0.1.1",
9393
"api-extractor-me": "0.1.2",
9494
"babel-loader": "8.2.5",
95-
"chai": "4.3.6",
95+
"chai": "4.3.7",
9696
"chai-as-promised": "7.1.1",
9797
"chalk": "4.1.2",
9898
"child-process-promise": "2.2.1",
@@ -105,11 +105,11 @@
105105
"eslint-plugin-unused-imports": "2.0.0",
106106
"express": "4.18.2",
107107
"find-free-port": "2.0.0",
108-
"firebase-tools": "11.2.2",
108+
"firebase-tools": "11.19.0",
109109
"glob": "7.2.3",
110110
"http-server": "14.1.1",
111111
"indexeddbshim": "8.0.0",
112-
"inquirer": "8.2.4",
112+
"inquirer": "8.2.5",
113113
"istanbul-instrumenter-loader": "3.0.1",
114114
"js-yaml": "4.1.0",
115115
"karma": "6.4.1",
@@ -136,15 +136,15 @@
136136
"npm-run-all": "4.1.5",
137137
"nyc": "15.1.0",
138138
"ora": "5.4.1",
139-
"prettier": "2.7.1",
139+
"prettier": "2.8.0",
140140
"protractor": "5.4.2",
141141
"request": "2.88.2",
142142
"semver": "7.3.8",
143-
"simple-git": "3.7.1",
143+
"simple-git": "3.15.1",
144144
"sinon": "9.2.4",
145145
"sinon-chai": "3.7.0",
146146
"source-map-loader": "1.1.3",
147-
"terser": "5.15.1",
147+
"terser": "5.16.1",
148148
"ts-loader": "8.4.0",
149149
"ts-node": "10.9.1",
150150
"tslint": "6.1.3",

packages/auth-compat/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": "11.0.0",
12+
"firebase-admin": "11.3.0",
1313
"firebase-functions": "3.24.1"
1414
},
1515
"private": true

packages/auth-interop-types/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
"files": [
1212
"index.d.ts"
1313
],
14-
"peerDependencies": {
15-
"@firebase/app-types": "0.x",
16-
"@firebase/util": "1.x"
17-
},
1814
"repository": {
1915
"directory": "packages/auth-types",
2016
"type": "git",

packages/auth/demo/README.md

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Firebase-Auth for web - Auth Demo (Auth Next)
22

3-
## Prerequisite
3+
## Prerequisites
4+
5+
You need all the prerequisites mentioned in the [top-level README.](https://github.com/firebase/firebase-js-sdk#prerequisites)
46

57
You need to have created a Firebase Project in the
68
[Firebase Console](https://firebase.google.com/console/) as well as configured a web app.
@@ -36,14 +38,14 @@ Copy `src/sample-config.js` to `src/config.js`:
3638
cp src/sample-config.js src/config.js
3739
```
3840

39-
Then copy and paste the Web snippet config found in the console (either by clicking "Add Firebase to
40-
your web app" button in your Project overview, or clicking the "Web setup" button in the Auth page)
41+
Then copy and paste the Web snippet config found in the console (Project Settings -> Your apps -> SDK setup and Configuration)
4142
in the `config.js` file.
4243

4344
## Deploy
4445

4546
Before deploying, you may need to build the auth package:
4647
```bash
48+
yarn
4749
yarn build:deps
4850
```
4951

@@ -58,6 +60,20 @@ yarn run demo
5860
This will compile all the files needed to run Firebase Auth, and start a Firebase server locally at
5961
[http://localhost:5000](http://localhost:5000).
6062

63+
The demo opens a page like this:
64+
65+
![image](https://user-images.githubusercontent.com/35932340/153662957-41ba6a82-ea15-4084-ad3a-9fd41083efd3.png)
66+
67+
68+
This is a developer view of all the supported auth flows. Make sure that the auth flow you are testing is already enabled in your firebase project.
69+
For example, if you are testing “Sign up with email/password”, your project should allow email/password as a provider.
70+
If not, you will see an “auth/operation-not-allowed” error message.
71+
72+
You can check the enabled providers on the firebase console.
73+
74+
![image](https://user-images.githubusercontent.com/35932340/153662750-c0faf417-07b4-4f0e-93ab-5e0b82e3c793.png)
75+
76+
6177
## Running against Auth Emulator
6278

6379
The demo page by default runs against the actual Auth Backend. To run against the Auth Emulator with mocked endpoints, do the following:
@@ -74,3 +90,68 @@ The demo page by default runs against the actual Auth Backend. To run against th
7490
yarn run demo:emulator
7591
```
7692

93+
## Running against local changes to auth package
94+
95+
By default, the demo runs against the latest release of firebase-auth sdk. This can be modified by:
96+
97+
```
98+
// packages/auth/demo/package.json
99+
+ "@firebase/auth": "file:..",
100+
- "@firebase/auth": "0.18.0",
101+
```
102+
103+
## Troubleshooting
104+
105+
### Errors about dependency not being installed, example `lerna: command not found`
106+
107+
Ensure that you run `yarn` to install dependencies.
108+
109+
### `Failed to get Firebase project <project name>. Please make sure the project exists and your account has permission to access it.`
110+
111+
Logout, re-login and launch the demo
112+
113+
```bash
114+
firebase logout && firebase login && yarn demo
115+
```
116+
117+
### `Failed to list firebase projects` when running `firebase use --add`
118+
119+
Logout, re-login and add the project.
120+
121+
```bash
122+
firebase logout && firebase login && firebase use --add
123+
```
124+
125+
### `Access to localhost was denied` when accessing the demo app via http://localhost:5000
126+
127+
Most likely this means a different process is binding to localhost:5000.
128+
You can access the demo app via http://127.0.0.1:5000 or use a different port using `yarn demo --port 5002`
129+
130+
Note - If you use 127.0.0.1 in your browser, you need to allowlist it as a domain for sign in, as shown below.
131+
132+
![image](https://user-images.githubusercontent.com/35932340/153659058-d669055f-b587-4bc2-9f32-323149df50c3.png)
133+
134+
### `hosting: Port 5000 is not open on localhost, could not start Hosting Emulator.`
135+
136+
This can happen when you run `yarn run demo:emulator` if port 5000 is taken.
137+
Modify auth/demo/firebase.json with a custom port. Pick any port, this example picks 5091.
138+
139+
```
140+
{
141+
//...
142+
"emulators": {
143+
"hosting": {
144+
"host": "",
145+
"port": "5091"
146+
}
147+
}
148+
}
149+
```
150+
151+
### Error message about functions
152+
153+
`The Cloud Functions emulator requires the module "firebase-admin" to be installed. This package is in your package.json, but it's not available. You probably need to run "npm install" in your functions directory.
154+
i functions: Your functions could not be parsed due to an issue with your node_modules (see above)
155+
`
156+
157+
Run `npm install` inside the auth/demo/functions directory as mentioned in the error message.

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": "11.0.0",
12+
"firebase-admin": "11.3.0",
1313
"firebase-functions": "3.24.1"
1414
},
1515
"private": true,

packages/auth/demo/src/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,27 @@ function initApp() {
18121812
},
18131813
onAuthError);
18141814

1815+
// Try sign in with redirect once upon page load, not on subsequent loads.
1816+
// This will demonstrate the behavior when signInWithRedirect is called before
1817+
// auth is fully initialized. This will fail on firebase/auth versions 0.21.0 and lower
1818+
// due to https://github.com/firebase/firebase-js-sdk/issues/6827
1819+
/*
1820+
if (sessionStorage.getItem('redirect-race-test') !== 'done') {
1821+
console.log('Starting redirect sign in upon page load.');
1822+
try {
1823+
sessionStorage.setItem('redirect-race-test', 'done');
1824+
signInWithRedirect(
1825+
auth,
1826+
new GoogleAuthProvider(),
1827+
browserPopupRedirectResolver
1828+
).catch(onAuthError);
1829+
} catch (error) {
1830+
console.log('Error while calling signInWithRedirect');
1831+
console.error(error);
1832+
}
1833+
}
1834+
*/
1835+
18151836
// Bootstrap tooltips.
18161837
$('[data-toggle="tooltip"]').tooltip();
18171838

0 commit comments

Comments
 (0)