Skip to content

Commit

Permalink
Merge master into release
Browse files Browse the repository at this point in the history
  • Loading branch information
google-oss-bot authored Jan 17, 2023
2 parents 4b4cdd0 + 3ee35f9 commit c0f9b62
Show file tree
Hide file tree
Showing 60 changed files with 1,525 additions and 559 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-cycles-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/storage": patch
---

Fixed issue where pause throws an error when a request is in flight.
5 changes: 5 additions & 0 deletions .changeset/heavy-mirrors-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/auth-interop-types': patch
---

Remove unused peerDependencies.
5 changes: 5 additions & 0 deletions .changeset/nervous-ads-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/database": patch
---

Fixed issue where connectDatabaseToEmulator can be called twice during a hot reload
5 changes: 5 additions & 0 deletions .changeset/pretty-carrots-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/database': patch
---

Replace `innerHTML` call with `textContent`.
5 changes: 5 additions & 0 deletions .changeset/quick-radios-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Update canonifyFilter to compute the canonization for flat conjunctions the same as implicit AND queries.
5 changes: 5 additions & 0 deletions .changeset/stupid-swans-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Fix an issue that stops some performance optimization being applied.
5 changes: 5 additions & 0 deletions .changeset/tricky-ravens-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/auth': patch
---

Fix to minimize a potential race condition between auth init and signInWithRedirect
5 changes: 5 additions & 0 deletions .changeset/wild-frogs-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Fix documentation for getDocsFromCache.
5 changes: 5 additions & 0 deletions .changeset/wild-geckos-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/util': patch
---

Reformat a comment that causes compile errors in some build toolchains.
6 changes: 6 additions & 0 deletions .changeset/young-hornets-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@firebase/util': minor
'firebase': minor
---

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.
2 changes: 1 addition & 1 deletion .github/workflows/merge-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: |
export VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
export VERSION=`node -e "${VERSION_SCRIPT}"`
echo "::set-output name=RELEASE_VERSION::$VERSION"
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Echo version in shell
run: |
echo "Merging release ${{ steps.get-version.outputs.RELEASE_VERSION }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: |
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
VERSION=`node -e "${VERSION_SCRIPT}"`
echo "::set-output name=BASE_VERSION::$VERSION"
echo "BASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Echo version in shell
run: |
echo "Base version: ${{ steps.get-version.outputs.BASE_VERSION }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ jobs:
run: |
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
VERSION=`node -e "${VERSION_SCRIPT}"`
echo "::set-output name=STAGING_VERSION::$VERSION"
echo "STAGING_VERSION=$VERSION" >> $GITHUB_OUTPUT
BASE_VERSION=$(echo $VERSION | cut -d "-" -f 1)
echo "::set-output name=BASE_VERSION::$BASE_VERSION"
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_OUTPUT
- name: Echo versions in shell
run: |
echo "Staging release ${{ steps.get-version.outputs.STAGING_VERSION }}"
Expand Down
6 changes: 4 additions & 2 deletions common/api-review/util.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export interface FirebaseDefaults {
config?: Record<string, string>;
// (undocumented)
emulatorHosts?: Record<string, string>;
forceEnvironment?: 'browser' | 'node';
}

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

// @public
export const getDefaults: () => FirebaseDefaults | undefined;

// @public
export const getExperimentalSetting: <T extends ExperimentalKey>(name: T) => FirebaseDefaults[`_${T}`];

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

Expand Down
2 changes: 1 addition & 1 deletion config/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Cloud Functions for Firebase",
"dependencies": {
"cors": "2.8.5",
"firebase-admin": "11.0.0",
"firebase-admin": "11.3.0",
"firebase-functions": "3.24.1"
},
"private": true,
Expand Down
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/chai": "4.3.4",
"@types/mocha": "9.1.1",
"babel-loader": "8.2.5",
"chai": "4.3.6",
"chai": "4.3.7",
"karma": "6.4.1",
"karma-chrome-launcher": "3.1.1",
"karma-mocha": "2.0.1",
Expand All @@ -33,7 +33,7 @@
"karma-typescript-es6-transform": "5.5.3",
"mocha": "9.2.2",
"typescript": "4.3.4",
"webpack": "5.74.0",
"webpack": "5.75.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.10.0"
}
Expand Down
2 changes: 1 addition & 1 deletion integration/firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"firebase": "9.15.0",
"@types/chai": "4.3.4",
"@types/mocha": "9.1.1",
"chai": "4.3.6",
"chai": "4.3.7",
"karma": "6.4.1",
"karma-babel-preprocessor": "8.0.2",
"karma-chrome-launcher": "3.1.1",
Expand Down
2 changes: 1 addition & 1 deletion integration/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"firebase": "9.15.0",
"chai": "4.3.6",
"chai": "4.3.7",
"chromedriver": "98.0.1",
"express": "4.18.2",
"geckodriver": "2.0.4",
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@types/node": "12.20.50",
"@types/request": "2.48.8",
"@types/sinon": "9.0.11",
"@types/sinon-chai": "3.2.8",
"@types/sinon-chai": "3.2.9",
"@types/tmp": "0.2.3",
"@types/yargs": "17.0.13",
"@typescript-eslint/eslint-plugin": "5.43.0",
Expand All @@ -92,7 +92,7 @@
"api-documenter-me": "0.1.1",
"api-extractor-me": "0.1.2",
"babel-loader": "8.2.5",
"chai": "4.3.6",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"chalk": "4.1.2",
"child-process-promise": "2.2.1",
Expand All @@ -105,11 +105,11 @@
"eslint-plugin-unused-imports": "2.0.0",
"express": "4.18.2",
"find-free-port": "2.0.0",
"firebase-tools": "11.2.2",
"firebase-tools": "11.19.0",
"glob": "7.2.3",
"http-server": "14.1.1",
"indexeddbshim": "8.0.0",
"inquirer": "8.2.4",
"inquirer": "8.2.5",
"istanbul-instrumenter-loader": "3.0.1",
"js-yaml": "4.1.0",
"karma": "6.4.1",
Expand All @@ -136,15 +136,15 @@
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"ora": "5.4.1",
"prettier": "2.7.1",
"prettier": "2.8.0",
"protractor": "5.4.2",
"request": "2.88.2",
"semver": "7.3.8",
"simple-git": "3.7.1",
"simple-git": "3.15.1",
"sinon": "9.2.4",
"sinon-chai": "3.7.0",
"source-map-loader": "1.1.3",
"terser": "5.15.1",
"terser": "5.16.1",
"ts-loader": "8.4.0",
"ts-node": "10.9.1",
"tslint": "6.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/demo/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "11.0.0",
"firebase-admin": "11.3.0",
"firebase-functions": "3.24.1"
},
"private": true
Expand Down
4 changes: 0 additions & 4 deletions packages/auth-interop-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"files": [
"index.d.ts"
],
"peerDependencies": {
"@firebase/app-types": "0.x",
"@firebase/util": "1.x"
},
"repository": {
"directory": "packages/auth-types",
"type": "git",
Expand Down
87 changes: 84 additions & 3 deletions packages/auth/demo/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Firebase-Auth for web - Auth Demo (Auth Next)

## Prerequisite
## Prerequisites

You need all the prerequisites mentioned in the [top-level README.](https://github.com/firebase/firebase-js-sdk#prerequisites)

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

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

## Deploy

Before deploying, you may need to build the auth package:
```bash
yarn
yarn build:deps
```

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

The demo opens a page like this:

![image](https://user-images.githubusercontent.com/35932340/153662957-41ba6a82-ea15-4084-ad3a-9fd41083efd3.png)


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.
For example, if you are testing “Sign up with email/password”, your project should allow email/password as a provider.
If not, you will see an “auth/operation-not-allowed” error message.

You can check the enabled providers on the firebase console.

![image](https://user-images.githubusercontent.com/35932340/153662750-c0faf417-07b4-4f0e-93ab-5e0b82e3c793.png)


## Running against Auth Emulator

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

## Running against local changes to auth package

By default, the demo runs against the latest release of firebase-auth sdk. This can be modified by:

```
// packages/auth/demo/package.json
+ "@firebase/auth": "file:..",
- "@firebase/auth": "0.18.0",
```

## Troubleshooting

### Errors about dependency not being installed, example `lerna: command not found`

Ensure that you run `yarn` to install dependencies.

### `Failed to get Firebase project <project name>. Please make sure the project exists and your account has permission to access it.`

Logout, re-login and launch the demo

```bash
firebase logout && firebase login && yarn demo
```

### `Failed to list firebase projects` when running `firebase use --add`

Logout, re-login and add the project.

```bash
firebase logout && firebase login && firebase use --add
```

### `Access to localhost was denied` when accessing the demo app via http://localhost:5000

Most likely this means a different process is binding to localhost:5000.
You can access the demo app via http://127.0.0.1:5000 or use a different port using `yarn demo --port 5002`

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.

![image](https://user-images.githubusercontent.com/35932340/153659058-d669055f-b587-4bc2-9f32-323149df50c3.png)

### `hosting: Port 5000 is not open on localhost, could not start Hosting Emulator.`

This can happen when you run `yarn run demo:emulator` if port 5000 is taken.
Modify auth/demo/firebase.json with a custom port. Pick any port, this example picks 5091.

```
{
//...
"emulators": {
"hosting": {
"host": "",
"port": "5091"
}
}
}
```

### Error message about functions

`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.
i functions: Your functions could not be parsed due to an issue with your node_modules (see above)
`

Run `npm install` inside the auth/demo/functions directory as mentioned in the error message.
2 changes: 1 addition & 1 deletion packages/auth/demo/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "11.0.0",
"firebase-admin": "11.3.0",
"firebase-functions": "3.24.1"
},
"private": true,
Expand Down
21 changes: 21 additions & 0 deletions packages/auth/demo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1812,6 +1812,27 @@ function initApp() {
},
onAuthError);

// Try sign in with redirect once upon page load, not on subsequent loads.
// This will demonstrate the behavior when signInWithRedirect is called before
// auth is fully initialized. This will fail on firebase/auth versions 0.21.0 and lower
// due to https://github.com/firebase/firebase-js-sdk/issues/6827
/*
if (sessionStorage.getItem('redirect-race-test') !== 'done') {
console.log('Starting redirect sign in upon page load.');
try {
sessionStorage.setItem('redirect-race-test', 'done');
signInWithRedirect(
auth,
new GoogleAuthProvider(),
browserPopupRedirectResolver
).catch(onAuthError);
} catch (error) {
console.log('Error while calling signInWithRedirect');
console.error(error);
}
}
*/

// Bootstrap tooltips.
$('[data-toggle="tooltip"]').tooltip();

Expand Down
Loading

0 comments on commit c0f9b62

Please sign in to comment.