Skip to content

Commit

Permalink
Bump rxfire and don't init by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels committed Jul 27, 2021
1 parent 343dbde commit d72623d
Show file tree
Hide file tree
Showing 21 changed files with 2,887 additions and 3,038 deletions.
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"defaultProject": "angularfire",
"cli": {
"packageManager": "yarn",
"analytics": "86795b8f-9036-4a53-929c-a7303453d677"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test:typings": "node ./tools/run-typings-test.js",
"test:build": "bash ./test/ng-build/build.sh",
"test:all": "npm run test:node && npm run test:chrome-headless && npm run test:typings && npm run test:build",
"build": "ttsc -p tsconfig.build.json; node --trace-warnings ./tools/build.js",
"build": "rimraf dist; ttsc -p tsconfig.build.json; node --trace-warnings ./tools/build.js",
"build:jasmine": "tsc -p tsconfig.jasmine.json; cp ./dist/packages-dist/schematics/versions.json ./dist/out-tsc/jasmine/schematics",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
},
Expand Down Expand Up @@ -63,10 +63,11 @@
"inquirer-autocomplete-prompt": "^1.0.1",
"lodash.isequal": "^4.5.0",
"open": "^7.0.3",
"rxfire": "6.0.0-canary.d3cbd88",
"rxfire": "6.0.0-canary.cee1afe",
"rxjs": "~6.6.0",
"semver": "^7.1.3",
"tslib": "^2.1.0",
"webpack": "^5.35.0",
"ws": "^7.2.1",
"xhr2": "^0.1.4",
"zone.js": "~0.11.4"
Expand Down
3 changes: 2 additions & 1 deletion sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@angular/router": "^12.0.0",
"firebase": "9.0.0-beta.7",
"lodash.isequal": "^4.5.0",
"rxfire": "6.0.0-canary.d3cbd88",
"rxfire": "6.0.0-canary.cee1afe",
"rxjs": "~6.6.0",
"tslib": "^2.1.0",
"zone.js": "~0.11.4"
Expand All @@ -47,6 +47,7 @@
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^12.0.0",
"open": "^7.0.3",
"ts-node": "~9.1.1",
"typescript": "~4.2.3",
Expand Down
23 changes: 7 additions & 16 deletions sample/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ApplicationRef, Component, NgZone } from '@angular/core';
import { ApplicationRef, Component, NgZone, Optional } from '@angular/core';
import { FirebaseApp, FirebaseApps } from '@angular/fire/app';
import { Auth, AuthInstances, authState } from '@angular/fire/auth';
import { Firestore, FirestoreInstances } from '@angular/fire/firestore';
import { functionInstance$ } from '@angular/fire/functions';
import { Firestore, FirestoreInstances, firestoreInstance$ } from '@angular/fire/firestore';
import { debounceTime } from 'rxjs/operators';
import { initializeFirestore$ } from './firestore';

@Component({
selector: 'app-root',
Expand Down Expand Up @@ -39,8 +39,8 @@ export class AppComponent {
public auth: Auth, // default Firbase Auth
public apps: FirebaseApps, // all initialized App instances
public authInstances: AuthInstances, // all initialized Auth instances
public firestore: Firestore,
public firestoreInstances: FirestoreInstances,
@Optional() public firestore: Firestore,
@Optional() public firestoreInstances: FirestoreInstances,
appRef: ApplicationRef,
zone: NgZone,
) {
Expand All @@ -50,16 +50,7 @@ export class AppComponent {
authState(auth).subscribe(it => console.log('authState', it));
appRef.isStable.pipe(debounceTime(200)).subscribe(it => console.log('isStable', it));
console.log((app as any).container.providers.keys());
zone.runOutsideAngular(() => {
setTimeout(async () => {
const functions = await import('./getFunctions');
functions.getFunctions(app);
}, 5000);
setTimeout(async () => {
const functions = await import('./getFunctions');
functions.getFunctions(app, 'asdf');
}, 10000);
});
functionInstance$.subscribe(it => console.log('$', it));
firestoreInstance$.subscribe(it => console.log('$', it));
initializeFirestore$.subscribe(it => console.log('init', it));
}
}
3 changes: 0 additions & 3 deletions sample/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { initializeAuth } from 'firebase/auth';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { environment } from '../environments/environment';
import { initializeFirestore } from 'firebase/firestore';
import { provideFirestore } from '@angular/fire/firestore';

@NgModule({
declarations: [
Expand All @@ -24,7 +22,6 @@ import { provideFirestore } from '@angular/fire/firestore';
return app;
}),
provideAuth(() => initializeAuth(getApp())),
provideFirestore(() => initializeFirestore(getApp(), {}))
],
providers: [ ],
bootstrap: [AppComponent]
Expand Down
1 change: 1 addition & 0 deletions sample/src/app/firestore/getFirestore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { getFirestore } from 'firebase/firestore';
11 changes: 11 additions & 0 deletions sample/src/app/firestore/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Observable } from 'rxjs';
import { shareReplay } from 'rxjs/operators';

export const initializeFirestore$ = new Observable(sub => {
import('./getFirestore').then(({getFirestore}) => {
sub.next(getFirestore());
sub.complete();
});
}).pipe(
shareReplay({ refCount: false })
);
1 change: 0 additions & 1 deletion sample/src/app/getFunctions.ts

This file was deleted.

Loading

0 comments on commit d72623d

Please sign in to comment.