feathersjs-ecosystem / feathers-blob

Feathers service for blob storage, like S3.
http://feathersjs.com
MIT License
92 stars 32 forks source link

feat: make data uri encoding optional #72

Closed florianbepunkt closed 4 years ago

florianbepunkt commented 4 years ago

Summary

(If you have not already please refer to the contributing guideline as described here)

Data uri is great to typically upload/download images, however for others types of data like raw binary data, etc. it adds a layer of complexity that is not really useful.

The usage of data uri could remains default (backward compatibility) but the usage of raw data buffer could be enforced by either a service constructor option or a query parameter.

If so, please mention them to keep the conversations linked together.

Other Information

Sorry about the additional formatting (was the specified lint command).

claustres commented 4 years ago

here shouldn't it be this.returnUri = !options.returnBuffer as this is mutually exclusive ?

florianbepunkt commented 4 years ago

Is it mutually exclusive? I have no use case for this, but returning both, uri and buffer, would be possible atm.

claustres commented 4 years ago

Well it seems to me a pretty bad overhead to send data twice over the wire, we'd like to send the buffer to avoid requiring the decoding of the data uri. Otherwise I think that if both are required it will be more efficient to use data uri and create the buffer from it on the client side.

florianbepunkt commented 4 years ago

@claustres I see your point. Made changes as requested.

claustres commented 4 years ago

Thanks for this !

florianbepunkt commented 4 years ago

Sure thing. Any ETA yet, when this will be released to npm?

claustres commented 4 years ago

Just updated the docs so should be possible soon, I will probably close this issue so that we reopen on-demand.

claustres commented 4 years ago

Actually, I cannot push releases on NPM yet, asked @daffl if possible to add me as collaborator on NPM. Otherwise will have to wait until he releases.

daffl commented 4 years ago

I thought you already were but I just sent you an invite. You need to add your GITHUB_TOKEN for the changelog generator and then you should be able to just run npm run release:patch (or npm run release:minor or npm run release:major).

claustres commented 4 years ago

Thanks, however I still have this error: You do not have permission to publish "feathers-blob". Are you logged in as the correct user?. Did you add this NPM user https://www.npmjs.com/~claustres ? Typically I don't see the settings panel on the package, meaning I am not a registered maintainer.

claustres commented 4 years ago

Release done.