-
Notifications
You must be signed in to change notification settings - Fork 142
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
feature(storage): add storage API to app element #30
feature(storage): add storage API to app element #30
Conversation
partly fix for #10 |
c0a4e62
to
2dc01ad
Compare
}, function() { | ||
resolve(uploadTask.snapshot.downloadURL); | ||
}); | ||
}); |
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.
.bind(this)
:)
Thanks for the PR! Can you give me an example of how you'd expect people to use the storage behavior here? I'm still pondering the best way to bring storage into the mix and I'm not saying you don't have it just that I'm not sure what you're aiming at 😄 |
@mbleigh since I think there won't be the "one" upload UI interface, I thought it might be a good idea, to provide a very generic low level interface as a base layer.. elements including the behaviour could just use the upload functionality, makes sense? |
At least this way we could just use the bare firebase.js with the App we instantiated in our |
I've forked a file-upload polymer element to work with the storage functionality added here |
@mbleigh just added a very basic demo to upload files, let me know, what you think about the general structure, and I'll move forward extending functionality |
What's standing in the way of this merge? |
I'm still evaluating what I think is the best way to incorporate storage, On Wed, Jul 6, 2016, 5:26 AM reads [email protected] wrote:
|
@mbleigh I understand that and I'm sorry to breath down your neck but I'd be remiss if i failed to mention how big of a feature this is, "polymerfire" is definitively feature-incomplete until it's in (even if just basic behavior) |
Maybe we could merge the essential part of storage API(i.e storage-url in firebase-app) first and postpone storage operations(i.e firebase-storage) part? I agree with @mbleigh 's opinion but I also believe that there are lots of developers who use storage API are glad to hack their own storage operations logic but first they need to initialize storage url in Firebase App, which is impossible if there is no storage-url in firebase-app element. |
Yes, you definitely should merge the storage-url in at least. Currently, there is no way to use the storage API directly because you can't change an app after it has been instantiated. So this should be merged (the property only), and the (possible) addition of a storage element added in a separate PR. The addition of the storage-url property will not change, so there should be no question/doubt about adding it. |
* | ||
* For example: 'polymerfire-test.appspot.com/' | ||
*/ | ||
storageUrl: { |
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.
This should have a default empty value, shouldn't it? the other properties are required for a functioning firebase app, this one is not. If we don't default it, I guess the app
property is never computed unless we set storageUrl
.
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.
👍 I'll add it
I would like to check up on this as well. I was planning to have a firebase-storage that also works like firebase-document (and hopefully uses the same attributes/properties). What i had in mind though is this:
The idea of the file_array is that it comes from input.files or an array of Files. This is where it gets a bit tricky though... Do we save the files once it has been passed to the element or do we call a method like .save() to do the saving. Regardless it will return an array of uploadTasks objects.. Each object is like this:
Either that or just return an array of uploadTasks and then people can do whatever they want... Would it be possible to fork this PR and play with it and see what happens? |
I've gone ahead and added |
@mbleigh Thanks. will create an issue and a PR once I have done my own experiments and let you see if it fits with the vision of the polymer element for firebase |
@tjmonsi , regarding whether to save files once it's passed to the element or to call a method like .save(), |
@jaaki already added that. I added an attribute called 'auto-upload' that if it exists, will auto-upload the files put in the files attribute. There's a working system already here: https://github.com/tjmonsi/polymerfire/tree/adding-firebase-storage and a demo here: https://practice-play-for-polymer-tjmonsi1.c9users.io/ I'm just adding one more case and I'm going to create some tests and will do a pull request for review |
@jaaki demo is not working.. Try to load it in incognito mode, and you'll see what I see. |
@jaaki: Whoops i forgot... made it public now |
@polinom: my demo is public now for a bit (until I turn off the server). |
I don't want to push anybody but is their anything that prevents a merge? I tested @tjmonsi implementation and it worked just fine. Would be really helpful to know whats going on. |
4009ae6
to
3ed10bf
Compare
Would love to use the fork in a demo. Is there any reason I shouldn't? |
The fork is working, let me know if you find something unexpected or missing |
3ed10bf
to
5f708a9
Compare
closed in favor of #69 |
adds storageURL support to firebase-app