Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Upgrade to exp #2770

Merged
merged 59 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6297299
feat(core): Upgrade to exp
davideast Mar 9, 2021
110c264
feat(analytics): Add Analytics
davideast Mar 9, 2021
aa62620
feat(auth): Add Auth
davideast Mar 9, 2021
ac07108
feat(auth-guard): Add Auth Guard
davideast Mar 9, 2021
4761ba1
feat(database): Add Database
davideast Mar 9, 2021
58fced7
feat(firestore): Add Firestore
davideast Mar 10, 2021
6376d97
feat(functions): Add Functions
davideast Mar 10, 2021
8fce342
feat(messaging): Add Messaging
davideast Mar 10, 2021
daa4c25
feat(performance): Add Performance
davideast Mar 10, 2021
36fb698
feat(rc) Add Remote Config
davideast Mar 11, 2021
13f945e
feat(storage): Add Storage
davideast Mar 11, 2021
c85d200
chore(build): Fix build script and Analytics services
davideast Mar 11, 2021
1868406
Adding compat packages
jamesdaniels Apr 21, 2021
3f4761b
Update actions
jamesdaniels Apr 21, 2021
ee9aac1
Expirimenting with a new configuration style and adding a non-compat …
jamesdaniels Apr 22, 2021
adda7a0
More cleanup
jamesdaniels Apr 22, 2021
fcfc5ec
New DI pattern
jamesdaniels Apr 23, 2021
cd11b58
Nuking the tests for now
jamesdaniels Apr 23, 2021
cd5f171
Upgrade ng deps
jamesdaniels Apr 23, 2021
25e48ca
Getting jasmine working again, cleaning up tests
jamesdaniels Apr 23, 2021
6d4a022
partial compilation mode and updating sample-compat
jamesdaniels Apr 23, 2021
f947321
Adding Firefox and Safari tests, doubt Safari will work in actions
jamesdaniels Apr 23, 2021
fadc178
Trying SafariNative launcher
jamesdaniels Apr 23, 2021
b72a87b
Placeholders for sub-package, reexport rxfire/*
jamesdaniels May 3, 2021
f4ca651
Zone wrapping rxfire exports
jamesdaniels May 17, 2021
59b5934
Getting README rolling
jamesdaniels May 18, 2021
a857610
Don't wait on tests to publish, their red right now
jamesdaniels May 18, 2021
f572bc9
Getting things updated, new DI API
jamesdaniels Jul 26, 2021
343dbde
Cleaning things up
jamesdaniels Jul 27, 2021
d72623d
Bump rxfire and don't init by default
jamesdaniels Jul 27, 2021
1233a1c
Firestore/lite
jamesdaniels Jul 28, 2021
3e5518e
Starting on upgrade guide
jamesdaniels Jul 28, 2021
96fdd27
Trying different syntax
jamesdaniels Jul 28, 2021
fb4f667
Internet says this is right but breaking my preview
jamesdaniels Jul 28, 2021
50cae6c
Try this
jamesdaniels Jul 28, 2021
1c0e1de
How does this look on Github?
jamesdaniels Jul 28, 2021
294b3ea
Getting the table rolling
jamesdaniels Jul 28, 2021
301dc5b
Updating to beta.8
jamesdaniels Aug 4, 2021
6445e29
Wrapping the JS SDK
jamesdaniels Aug 12, 2021
6fb0f6d
Cleanup, upgrade schematic
jamesdaniels Aug 16, 2021
32f57c2
Expose the schematic in the public-api
jamesdaniels Aug 16, 2021
d3a9af2
Public_api
jamesdaniels Aug 16, 2021
1062278
Find and replace on upgrade
jamesdaniels Aug 16, 2021
674ff68
Find and replace on upgrade
jamesdaniels Aug 16, 2021
52247a6
Doc changes
jamesdaniels Aug 16, 2021
ec33419
Fix the reexport types and cleanup
jamesdaniels Aug 17, 2021
6218ba2
Clean up the upgrade schematic a bit
jamesdaniels Aug 17, 2021
ec312e3
Rework the import alias regex
jamesdaniels Aug 17, 2021
c5d4d1f
Adding rxfire to the schematic install
jamesdaniels Aug 17, 2021
2a3bd2a
Write the new content
jamesdaniels Aug 17, 2021
5c5c40e
Merged master
jamesdaniels Aug 19, 2021
7d256b0
Bump husky
jamesdaniels Aug 19, 2021
24c29e3
Lost this fix in the merge conflict
jamesdaniels Aug 19, 2021
fb95678
Spec wasnt pulling from compat
jamesdaniels Aug 19, 2021
c9bbe78
Paths wrong in the spec too
jamesdaniels Aug 19, 2021
591edeb
New scheduler
jamesdaniels Aug 19, 2021
f676c41
Import path
jamesdaniels Aug 19, 2021
bdddf69
Readd ɵkeepUnstableUntilFirstFactory for specs
jamesdaniels Aug 19, 2021
4431934
Next ref, req tests, drop safari
jamesdaniels Aug 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merged master
  • Loading branch information
jamesdaniels committed Aug 19, 2021
commit 5c5c40ee80c965907e2400f5e0111b979667663b
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<a name="6.1.5"></a>
# [6.1.5](https://github.com/angular/angularfire/compare/6.1.4...6.1.5) (2021-05-17)

Support Angular 12 peer

### Bug Fixes

* **auth:** set the passed settings individually ([#2826](https://github.com/angular/angularfire/issues/2826)) ([984803d](https://github.com/angular/angularfire/commit/984803d))

<a name="6.1.4"></a>
## [6.1.4](https://github.com/angular/angularfire/compare/6.1.3...6.1.4) (2020-12-03)
# [6.1.4](https://github.com/angular/angularfire/compare/6.1.3...6.1.4) (2020-12-03)


### Bug Fixes
Expand All @@ -10,7 +19,7 @@


<a name="6.1.3"></a>
## [6.1.3](https://github.com/angular/angularfire/compare/6.1.2...6.1.3) (2020-11-30)
# [6.1.3](https://github.com/angular/angularfire/compare/6.1.2...6.1.3) (2020-11-30)


### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class MyApp {

### Angular and Firebase versions

AngularFire doesn't follow Angular's versioning as Firebase also has breaking changes throughout the year. Instead we try to maintain compatability with both Firebase and Angular majors for as long as possible, only breaking when we need to support a new major of one or the other.
AngularFire doesn't follow Angular's versioning as Firebase also has breaking changes throughout the year. Instead we try to maintain compatibility with both Firebase and Angular majors for as long as possible, only breaking when we need to support a new major of one or the other.

| Angular | Firebase | AngularFire |
| --------|----------|--------------|
Expand Down
112 changes: 112 additions & 0 deletions docs/auth/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,118 @@ export class AppComponent {
}
```

## Configuration with Dependency Injection

The AngularFireAuth Module provides several DI tokens to further configure your
authentication process.

### Configure

Using the `SETTINGS` DI Token (*default: null*), we can set the current Auth
instance's settings. This is used to edit/read configuration related options
like app verification mode for phone authentication, which is useful for
[testing](https://cloud.google.com/identity-platform/docs/test-phone-numbers).

```ts
import { SETTINGS as AUTH_SETTINGS } from '@angular/fire/auth';

@NgModule({
// ... Existing configuration
providers: [
// ... Existing Providers
{ provide: AUTH_SETTINGS, useValue: { appVerificationDisabledForTesting: true } },
]
})
export class AppModule { }
```

Read more at [Firebase Auth Settings](https://firebase.google.com/docs/reference/js/firebase.auth.AuthSettings).

### Use Current Browser Language

Using the `USE_DEVICE_LANGUAGE` DI Token (*default: null*), which is a boolean
that allow you to set the current language to the default device/browser
preference. This allows to localize emails but be aware that this only applies
if you use the standard template provided by Firebase.

```ts
import { USE_DEVICE_LANGUAGE } from '@angular/fire/auth';

@NgModule({
// ... Existing configuration
providers: [
// ... Existing Providers
{ provide: USE_DEVICE_LANGUAGE, useValue: true },
]
})
export class AppModule { }
```

If you want to set a different language, you can use `LANGUAGE_CODE` DI Token
(*default: null*).

More info at the [firebase auth docs](https://firebase.google.com/docs/reference/js/firebase.auth.Auth#languagecode).

```ts
import { LANGUAGE_CODE } from '@angular/fire/auth';

@NgModule({
// ... Existing configuration
providers: [
// ... Existing Providers
{ provide: LANGUAGE_CODE, useValue: 'fr' },
]
})
export class AppModule { }
```

### Persistence

Firebase Auth default behavior is to persist a user's session even after the
user closes the browser. To change the current type of persistence on the
current Auth instance for the currently saved Auth session and apply this type
of persistence for future sign-in requests, including sign-in with redirect
requests, you can use the `PERSISTENCE` DI Token (*default: null*).

The possible types are `'local'`, `'session'` or `'none'`. Read more at
[authentication state persistence](https://firebase.google.com/docs/auth/web/auth-state-persistence),

```ts
import { PERSISTENCE } from '@angular/fire/auth';

@NgModule({
// ... Existing configuration
providers: [
// ... Existing Providers
{ provide: PERSISTENCE, useValue: 'session' },
]
})
export class AppModule { }
```

### Tenant

If you need to use multi-tenancy, you can set the current Auth instance's tenant
ID using `TENANT_ID` DI Token (*default: null*).

More tutorials regarding this topic are _coming soon_.

```ts
import { TENANT_ID } from '@angular/fire/auth';

@NgModule({
// ... Existing configuration
providers: [
// ... Existing Providers
{ provide: TENANT_ID, useValue: 'tenant-id-app-one' },
]
})
export class AppModule { }
```

- [Multi-Tenancy Authentication](https://cloud.google.com/identity-platform/docs/multi-tenancy-authentication)
- [Firebase Auth Tenant](https://firebase.google.com/docs/reference/js/firebase.auth.Auth#tenantid)

## UI Libraries

- Material Design : [ngx-auth-firebaseui](https://github.com/AnthonyNahas/ngx-auth-firebaseui)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
"firebase": "9.0.0-beta.8",
"firebase-admin": "^8.10.0",
"firebase-functions": "^3.6.0",
"firebase-tools": "^8.0.0",
"firebase-tools": "^8.0.0 || ^9.0.0",
"fs-extra": "^8.0.1",
"fuzzy": "^0.1.3",
"husky": "^4.2.5",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"lodash.isequal": "^4.5.0",
"jsonc-parser": "^3.0.0",
"open": "^7.0.3",
"rxfire": "6.0.0-canary.92c6c26",
"rxjs": "~6.6.0",
Expand Down
19 changes: 14 additions & 5 deletions sample-compat/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets",
Expand All @@ -29,7 +28,13 @@
"styles": [
"src/styles.css"
],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"emulated": {
Expand Down Expand Up @@ -69,7 +74,8 @@
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down Expand Up @@ -129,7 +135,9 @@
"main": "server.ts",
"tsConfig": "tsconfig.server.json",
"bundleDependencies": true,
"externalDependencies": [ ]
"externalDependencies": [ ],
"sourceMap": true,
"optimization": false
},
"configurations": {
"production": {
Expand All @@ -143,7 +151,8 @@
"sourceMap": false,
"optimization": true
}
}
},
"defaultConfiguration": ""
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
Expand Down
41 changes: 20 additions & 21 deletions sample-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
"dev:ssr": "ng run sample:serve-ssr",
"bust": "rm -rf node_modules/@angular/fire && yarn cache clean @angular/fire && yarn add ../dist/packages-dist",
"serve:ssr": "node dist/sample/server/main.js",
"build:ssr": "ng build --prod && ng run sample:server:production",
"build:ssr": "ng build --configuration production && ng run sample:server:production",
"prerender": "ng run sample:prerender"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.0.0-rc.0",
"@angular/common": "~12.0.0-rc.0",
"@angular/compiler": "~12.0.0-rc.0",
"@angular/core": "~12.0.0-rc.0",
"@angular/animations": "~12.2.2",
"@angular/common": "~12.2.2",
"@angular/compiler": "~12.2.2",
"@angular/core": "~12.2.2",
"@angular/fire": "../dist/packages-dist",
"@angular/forms": "~12.0.0-rc.0",
"@angular/platform-browser": "~12.0.0-rc.0",
"@angular/platform-browser-dynamic": "~12.0.0-rc.0",
"@angular/platform-server": "~12.0.0-rc.0",
"@angular/router": "~12.0.0-rc.0",
"@angular/service-worker": "~12.0.0-rc.0",
"@nguniversal/express-engine": "~12.0.0-next.1",
"@angular/forms": "~12.2.2",
"@angular/platform-browser": "~12.2.2",
"@angular/platform-browser-dynamic": "~12.2.2",
"@angular/platform-server": "~12.2.2",
"@angular/router": "~12.2.2",
"@angular/service-worker": "~12.2.2",
"core-js": "^3.6.5",
"firebase": "^9.0.0-beta.1",
"firebase": "^9.0.0-beta.8",
"rxfire": "6.0.0-canary.92c6c26",
"first-input-delay": "^0.1.3",
"proxy-polyfill": "^0.3.2",
"rxjs": "~6.6.0",
Expand All @@ -41,13 +41,12 @@
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/architect": "~0.1200.0-rc.0",
"@angular-devkit/build-angular": "~12.0.0-rc.0",
"@angular/cli": "~12.0.0-rc.0",
"@angular/compiler-cli": "~12.0.0-rc.0",
"@angular/language-service": "~12.0.0-rc.0",
"@angular-devkit/architect": "~0.1202.2",
"@angular-devkit/build-angular": "~12.2.2",
"@angular/cli": "~12.2.2",
"@angular/compiler-cli": "~12.2.2",
"@angular/language-service": "~12.2.2",
"@firebase/app-types": "^0.6.1",
"@nguniversal/builders": "~12.0.0-next.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^6.0.0",
Expand All @@ -64,7 +63,7 @@
"inquirer-autocomplete-prompt": "^1.0.1",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.1.1",
"karma": "~6.3.4",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
Expand All @@ -74,4 +73,4 @@
"typescript": "~4.2.3",
"webpack-bundle-analyzer": "^4.4.1"
}
}
}
6 changes: 3 additions & 3 deletions sample-compat/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'zone.js/dist/zone-node';
import 'zone.js/node';

import { ngExpressEngine } from '@nguniversal/express-engine';
import * as express from 'express';
Expand All @@ -15,7 +15,7 @@ global['WebSocket'] = require('ws');
/* tslint:enable:no-string-literal */

// include the protos required to bundle firestore
import 'dir-loader!./firestore-protos';
// import 'dir-loader!./firestore-protos';

// The Express app is exported so that it can be used by serverless Functions.
export function app() {
Expand All @@ -36,7 +36,7 @@ export function app() {
// Serve static files from /browser
server.get('*.*', express.static(distFolder, {
maxAge: '1y'
}));
}) as any);

// All regular routes use the Universal engine
server.get('*', (req, res) => {
Expand Down
4 changes: 2 additions & 2 deletions sample-compat/src/app/database/database.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class DatabaseComponent implements OnInit {
this.testObjectValue$ = EMPTY;
} else {
const doc = database.object('test');
const key = makeStateKey(doc.query.toString());
const existing = state.get<any>(key, undefined);
const key = makeStateKey<unknown>(doc.query.toString());
const existing = state.get(key, undefined);
this.testObjectValue$ = doc.valueChanges().pipe(
trace('database'),
existing ? startWith(existing) : tap(it => state.set(key, it))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export class FirestoreOfflineComponent implements OnInit {

constructor(state: TransferState, firestore: AngularFirestoreOffline) {
const doc = firestore.doc('test/1');
const key = makeStateKey(doc.ref.path);
const existing = state.get<any>(key, undefined);
const key = makeStateKey<unknown>(doc.ref.path);
const existing = state.get(key, undefined);
this.testDocValue$ = firestore.doc('test/1').valueChanges().pipe(
trace('firestore'),
existing ? startWith(existing) : tap(it => state.set(key, it))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FirebaseOptions } from 'firebase/app';
import { USE_EMULATOR } from '@angular/fire/compat/firestore';
import { AngularFirestore, SETTINGS, Settings } from '@angular/fire/compat/firestore';
import { USE_EMULATOR as USE_AUTH_EMULATOR } from '@angular/fire/compat/auth';
import { ɵAngularFireSchedulers } from '@angular/fire';

export const FIRESTORE_OFFLINE = new InjectionToken<AngularFirestore>('my.firestore');

Expand All @@ -15,9 +16,10 @@ export class AngularFirestoreOffline extends AngularFirestore {
// tslint:disable-next-line:ban-types
@Inject(PLATFORM_ID) platformId: Object,
zone: NgZone,
schedulers: ɵAngularFireSchedulers,
@Optional() @Inject(USE_EMULATOR) useEmulator: any,
) {
super(options, 'offline', true, settings, platformId, zone, { synchronizeTabs: true }, useEmulator);
super(options, 'offline', true, settings, platformId, zone, schedulers, { synchronizeTabs: true }, useEmulator);
}
}

Expand Down
4 changes: 2 additions & 2 deletions sample-compat/src/app/firestore/firestore.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export class FirestoreComponent implements OnInit {

constructor(state: TransferState, firestore: AngularFirestore) {
const doc = firestore.doc('test/1');
const key = makeStateKey(doc.ref.path);
const existing = state.get<any>(key, undefined);
const key = makeStateKey<unknown>(doc.ref.path);
const existing = state.get(key, undefined);
this.testDocValue$ = firestore.doc('test/1').valueChanges().pipe(
trace('firestore'),
existing ? startWith(existing) : tap(it => state.set(key, it))
Expand Down
4 changes: 2 additions & 2 deletions sample-compat/src/app/storage/storage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class StorageComponent implements OnInit {

constructor(storage: AngularFireStorage, state: TransferState) {
const icon = storage.ref('google-g.png');
const key = makeStateKey('google-icon-url');
const existing = state.get<string>(key, undefined);
const key = makeStateKey<unknown>('google-icon-url');
const existing = state.get(key, undefined);
this.downloadUrl$ = existing ? of(existing) : icon.getDownloadURL().pipe(
trace('storage'),
tap(it => state.set(key, it)),
Expand Down
4 changes: 2 additions & 2 deletions sample-compat/src/app/upboats/upboats.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export class UpboatsComponent implements OnInit {
const collection = firestore.collection<Animal>('animals', ref =>
ref.orderBy('upboats', 'desc').orderBy('updatedAt', 'desc')
);
const key = makeStateKey(collection.ref.path);
const existing = state.get<Animal[]>(key, undefined);
const key = makeStateKey<Animal[]>(collection.ref.path);
const existing = state.get(key, undefined);
this.animals = collection.snapshotChanges().pipe(
trace('animals'),
map(it => it.map(change => ({
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.