-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Added storage download url pipe #2089
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
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
I signed it! |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
1 similar comment
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
|
I signed it! |
|
In regards to the CLA, I signed and I then used git config to add my email. I'm uncertain how to proceed. Please assist |
|
I like this, I'll review in a few. The CLA bot has trouble when the git email is different, I'll do the checks manually. |
|
|
||
| /** to be used with in combination with | async */ | ||
| @Pipe({ | ||
| name: 'ngfbStorageUrl' |
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.
Perhaps we could call this downloadURL, getDownloadURL, storageDownloadURL or something to that effect, @davideast any thoughts?
Could we make it so this was an async pipe itself so it didn't have to be combined with async? So the developer could just do 'someref.jpeg' | storageDownloadURL... or maybe then we call it asyncDownloadURL?
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.
My experience and recommendation is to avoid being too generic as to avoid name collisions as this type of functionality is common to convert a string to a url.
Also, if you removed the need for the async pipe, appending a dollar sign ngfbStorageUrl$ is a standard I’ve read to be clear that an in template variable is or is going through an observable process. It’s a practice to make clear something async is at play. I actually recommend against removing the need for the async pipe OR offer both (one pipe with a trailing $ sign and one without)
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.
Both would be cool, but we could scope as a separate PR if you felt so inclined.
How about getFirebaseDownloadURL and firebaseDownloadURL$ for naming then? That way it's super clear.
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 like that a lot. Great collaboration. I’d like to have this code in my project, how can I help move this along?
I can make the changes but perhaps @davideast would like throw an opinion in the hat?
Thank you very kindly
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.
Ps, I don’t know how to have a pipe that has to be async not require the async pipe.
The end all be all maybe that the async pipe is actually a requirement
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.
Sorry to “spam”
Here is dollar sign suffix docs:
https://angular.io/guide/rx-library#naming-conventions-for-observables
|
@jamesdaniels I can confirm the CLA bot is wrong: |
|
Closing in favor of #2648. |
Checklist
yarn install,yarn testrun successfully? (i ran npm install npm test)Description
Implementing a new feature: A convenient pipe exists for simple in page references.
I needed a simpler was to produce image src urls. The existing method to
storage.ref().getDownloadUrlrequired too much setup for just that.Code sample
The old way to getDownLoadUrl() of course still exists, as seen here: