Closed dinoboff closed 8 years ago
Console errors Running with npm start after npm install and npm test.
Console errors after running npm build and npm run serve-build
It's a work in progress; only src/packages/singpath-core as been migrated (this is were spfFirebaseRef
and spfFirebase
.
Only singpath-core demo is completed:
cd src/packages/singpath-core
npm install
npm start
@SingaporeClouds @shiquan-lim It's ready for review.
When will it be suitable to merge? It might disrupt some PR in progress.
@SingaporeClouds @shiquan-lim
Rebased on last PR.
I will merge this PR once I document firebase angularFire setup on example app.
ps: this PR fails coverage check since it's adding all the code base to coverage, but I set coveralls to only report any decrease in coverage while the coverage is so low.
@SingaporeClouds @shiquan-lim
PR replaces:
var ref = spfFirebase.ref(['path/to', someId])
->var db = firebaseApp.database();
var ref = db.ref(`path/to/${someId}}`);
var obj = spfFirebase.loadedObj(['path/to', someId])
->var db = firebaseApp.database();
var ref = db.ref(`path/to/${someId}}`);
var obj = $firebaseObject(ref);
obj.$loaded().then(() => dosomething(obj);
No more intermediary services; we are now using firebase reference directly. Here is a guide for the for migrated code from firebase 2 to firebase 3 sdk.
The PR also create an index of component that the main module loads instead of each component individually.
Finally, In a few cases I used someRef.once()
instead of creating a synchronized firebase object because the data needed to be read only once.
One change I didn't notice is that the initial value of $firebaseAuth.$getAuth()
always returns null initially.
in #95, I added spfAuth.$loaded() to deal with it; a few view loading logic had to be adjusted.
Firebase 3 relies on App which encapsulate a connection to a firebase app (allows multiple connection to different app or with deferent auth). Instead of various intermediary services between our datastore services and the firebase client, the angular app simply require a "firebaseApp" constant, which is easy to mock in test.
We can remove most firebase related services; no more
spfFirebaseRef
orspfFirebase
.One issue, is that the requests are no longer logged to the console.
singpath-core API changes:
firebaseApp.database().ref()
instead (and template string to build a path);userInfo
method tospfAuth
services (return the the name and email from the Oauth2 signup data);spfAuth.logout()
now return a promise.Other
spfAuth
method andspfAuthdata
are unchanged.TODO: