Skip to content

Commit 5e2edbe

Browse files
jamesdanielsxil222
andauthored
feat: Support for Firebase v9 (compat) (#850)
* Build firebaseui-esm for use against firebase/compat/* * tenantId and languageCode are readonly as of beta.2 * comment out more tests * Upgrade to beta.8, uncomment-out tests * cleanup * Revert whitespace changes * Bump version in demo * Pin JS SDK, beta.0 * Adding an NPM demo and fixing the CSS by upgrading gulp-css-concat * Cleanup * v5 is now taken, lets go 0.600 * Namespace registry * 0.600.0-rc.0 * Bumping versions * Fix bower dep * Cleanup and comment out flaky test * Bump CDN version and drop the wdr change * Split the build and test so things dont time out * Undo the package.json changes in favor to workflow * There was indeed a loop in the buildscript * Try a sleep to let the tunnel connect * Suacelabs is a timing thing, can see in logs start early * Updating the demo widget.html with the new Firebase JS SDK * Flush out the webpack demo a bit more * webdriver-manager has broken with the chrome version on github actions, try updating * String magics * Echo it * Use the --product-version * Version, dropping demo-npm * revert test change * Updating README w/v6/9 references * Whooops sauce_connect wasnt spinning up if cache hit, add OSX support * Replace the TODO w/init as add project doesn't expose compat by default * Bump the Firebase version to include the updateUser fix * Revert sample-config * Try adding the flaky test back in * Bump versions, undo out of scope changes * Bump Firebase version in README * Revert some changes, bump firebase dep * webdriver-manager use equal on versions.chrome arg * Bump lockfile * update package-lock.json up-to-date * remove firebase init in demoApp(which initialize twice) Co-authored-by: Xin Li <[email protected]>
1 parent 8cdf9eb commit 5e2edbe

14 files changed

+5516
-925
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Now using Firebase v9/compat

README.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,28 +91,17 @@ Install FirebaseUI and its peer-dependency Firebase via npm using the following
9191
commands:
9292

9393
```bash
94-
$ npm install firebase --save
95-
$ npm install firebaseui --save
94+
$ npm install firebase firebaseui --save
9695
```
9796

98-
You can then `require` the following modules within your source files:
97+
You can then `import` the following modules within your source files:
9998

10099
```javascript
101-
var firebase = require('firebase');
102-
var firebaseui = require('firebaseui');
103-
// or using ES6 imports:
100+
import firebase from 'firebase/compat/app';
104101
import * as firebaseui from 'firebaseui'
105102
import 'firebaseui/dist/firebaseui.css'
106103
```
107104

108-
Or include the required files in your HTML, if your HTTP Server serves the files
109-
within `node_modules/`:
110-
111-
```html
112-
<script src="node_modules/firebaseui/dist/firebaseui.js"></script>
113-
<link type="text/css" rel="stylesheet" href="node_modules/firebaseui/dist/firebaseui.css" />
114-
```
115-
116105
### Option 3: Bower component
117106

118107
Install FirebaseUI and its dependencies via Bower using the following command:
@@ -193,11 +182,11 @@ for a more in-depth example, showcasing a Single Page Application mode.
193182
<head>
194183
<meta charset="UTF-8">
195184
<title>Sample FirebaseUI App</title>
185+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-app-compat.js"></script>
186+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-auth-compat.js"></script>
196187
<!-- *******************************************************************************************
197188
* TODO(DEVELOPER): Paste the initialization snippet from this dialog box:
198189
* Firebase Console > Project Settings > Add App > Web.
199-
* In addition, include the firebase-auth SDK:
200-
* <script src="https://www.gstatic.com/firebasejs/[FIREBASE VERSION USED IN SNIPPET]/firebase-auth.js"></script> *
201190
***************************************************************************************** -->
202191
<script src="https://www.gstatic.com/firebasejs/ui/5.0.0/firebase-ui-auth.js"></script>
203192
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/5.0.0/firebase-ui-auth.css" />
@@ -268,6 +257,8 @@ Here is how you would track the Auth state across all your pages:
268257
<head>
269258
<meta charset="UTF-8">
270259
<title>Sample FirebaseUI App</title>
260+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-app-compat.js"></script>
261+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-auth-compat.js"></script>
271262
<!-- *******************************************************************************************
272263
* TODO(DEVELOPER): Paste the initialization snippet from:
273264
* Firebase Console > Overview > Add Firebase to your web app. *
@@ -1347,6 +1338,8 @@ FirebaseUI is displayed.
13471338
<head>
13481339
<meta charset="UTF-8">
13491340
<title>Sample FirebaseUI App</title>
1341+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-app-compat.js"></script>
1342+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-auth-compat.js"></script>
13501343
<!-- *******************************************************************************************
13511344
* TODO(DEVELOPER): Paste the initialization snippet from:
13521345
* Firebase Console > Overview > Add Firebase to your web app. *
@@ -1939,6 +1932,26 @@ can verify in the [demo app](https://fir-ui-demo-84a6c.firebaseapp.com/)).
19391932

19401933
**For v1.0.0 and superior:** https://github.com/firebase/firebaseui-web/releases
19411934

1935+
### 6.0.0
1936+
1937+
FirebaseUI-web v6.0.0 is intended to be used alongside Firebase JS SDK v9 compat.
1938+
1939+
If using the CDN, change your Firebase imports to:
1940+
1941+
```html
1942+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-app-compat.js"></script>
1943+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-auth-compat.js"></script>
1944+
```
1945+
1946+
If NPM:
1947+
1948+
```ts
1949+
import firebase from 'firebase/compat/app';
1950+
import 'firebase/compat/auth';
1951+
```
1952+
1953+
[See the Firebase upgrade guide for more information.](https://firebase.google.com/docs/web/modular-upgrade)
1954+
19421955
### 5.0.0
19431956

19441957
`accountchooser.com` has been operating in "universal opt-out" mode and was

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebaseui",
3-
"version": "2.5.1",
3+
"version": "6.0.0",
44
"description": "Javascript library for customizable UI on top of Firebase SDK",
55
"main": [
66
"./dist/firebaseui.js",
@@ -22,6 +22,6 @@
2222
"out"
2323
],
2424
"dependencies": {
25-
"firebase": "^4.1.2"
25+
"firebase": "^9.1.3"
2626
}
2727
}

buildtools/run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ else
8787
echo "Using Headless Chrome."
8888
# Updates Selenium Webdriver.
8989
GOOGLE_CHROME_VERSION=$(google-chrome --product-version || echo 'latest')
90-
echo "$PROTRACTOR_BIN_PATH/webdriver-manager update --versions.chrome $GOOGLE_CHROME_VERSION --gecko=false"
91-
$PROTRACTOR_BIN_PATH/webdriver-manager update --versions.chrome $GOOGLE_CHROME_VERSION --gecko=false
90+
echo "$PROTRACTOR_BIN_PATH/webdriver-manager update --versions.chrome=$GOOGLE_CHROME_VERSION --gecko=false"
91+
$PROTRACTOR_BIN_PATH/webdriver-manager update --versions.chrome=$GOOGLE_CHROME_VERSION --gecko=false
9292
# Start Selenium Webdriver.
9393
echo "$PROTRACTOR_BIN_PATH/webdriver-manager start &>/dev/null &"
9494
$PROTRACTOR_BIN_PATH/webdriver-manager start &>/dev/null &

cut

Whitespace-only changes.

demo/public/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<meta charset="UTF-8">
55
<title>FirebaseUI Auth Demo</title>
66
<link rel="manifest" href="manifest.json">
7-
<script src="https://www.gstatic.com/firebasejs/7.4.0/firebase.js"></script>
7+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-app-compat.js"></script>
8+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-auth-compat.js"></script>
89
<script src="config.js"></script>
910
<script src="common.js"></script>
1011
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />

demo/public/widget.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>FirebaseUI Auth Demo</title>
6-
<script src="https://www.gstatic.com/firebasejs/7.4.0/firebase.js"></script>
6+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-app-compat.js"></script>
7+
<script src="https://www.gstatic.com/firebasejs/9.1.3/firebase-auth-compat.js"></script>
78
<script src="config.js"></script>
89
<script src="common.js"></script>
910
<script src="dist/firebaseui.js"></script>

0 commit comments

Comments
 (0)