-
Notifications
You must be signed in to change notification settings - Fork 16
Attempt to use firebase 3.0 #15
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
Attempt to use firebase 3.0 #15
Conversation
| ref = firebase.database(); | ||
| break; | ||
| case 'ref': | ||
| ref = getRefStep (rest) .ref (head._1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the spaces after function names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk, that's the way thomas was doing ¯\_(ツ)_/¯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my style for JS code.
I would appreciate if contributors would stick the style of the existing code.
|
@rogeriochaves thank you very much for your contribution. Will review it ASAP. |
|
@ThomasWeiser it's not really a valuable code contribution, I opened this PR more for the discussion of what path will we follow |
As suggested by Rogério Chaves: #15 (comment) Pros: - No need to patch Firebase script - Faster loading from CDN / cache / parallel chunk. - Can upgrade firebase for non-breaking changes without changing ElmFire. - More flexibility while developing new ElmFire version Cons: - ElmFire is not self-contained any more. - User is now responsibly for compatibility of the version of included firebase.js script. This is a preliminary change during development. We may change back to included Firebase script for published versions of ElmFire. Needs to be discussed with community.
|
As per your suggestion, firebase.js script is now to be included separately. For pros and cons see the commit msg. Please direct API discussions to #16 or separate issues/PRs. |
So, first of all, I really needed this project going, so I decided to help, then I noted that this is a lot to maintain, congratulations for the awesome work!
What I did was changing the example and use it to test if the stuff worked. Auth was not working, so I needed to upgrade to Firebase 3.0.
But I've had some problems upgrading the javascript, because firebase 3.0 doesn't work when bundled inside something that uses
"use strict", as elm does, check it out: https://groups.google.com/forum/#!topic/firebase-talk/gFtK1YoRUoESo I've decided to delete firebase and rely on the global available one, and found out that this might be a much better approach, because:
Going forward, I've realized that the API must change, we have to pass more data than the database url (apiKey, authDomain, databaseURL, storageBucket, messagingSenderId now), and we have to instantiate it without child paths, we could have something like:
Then, I don't see a reason why the elm api shouldn't just mimic the js api, we could use it like this: