Giter Site home page Giter Site logo

Unifile next steps about unifile HOT 13 CLOSED

silexlabs avatar silexlabs commented on August 25, 2024
Unifile next steps

from unifile.

Comments (13)

JbIPS avatar JbIPS commented on August 25, 2024

I suggest using ESLint to ensure the code style throughout the repository. And I had some docs on good REST API, I'll post them here as soon as I find them.

from unifile.

JbIPS avatar JbIPS commented on August 25, 2024

I'm actually reading this a lot: https://developer.github.com/v3/. It's a very well structured API and documentation. This could be an example.

And just to be sure, every service will now be a prototype, right?

from unifile.

lexoyo avatar lexoyo commented on August 25, 2024

I'm actually reading this a lot: https://developer.github.com/v3/. It's a very well structured API and documentation. This could be an example.

yes right!

And just to be sure, every service will now be a prototype, right?

what do you mean exactly?

from unifile.

JbIPS avatar JbIPS commented on August 25, 2024

Lately I was thinking about splitting this lib. Unifile would only take care of routes declaration and routing. In addition, services (or connector) would be dependencies, loaded at will and declared like a middleware

unifile.use(require('ftp-connector'));

This way, you only embed the connectors you want and creating a new connector doesn't imply any modification on Unifile (= don't publish a new version any time a connector changes).

And for the connector development, this mean we can ask for a clear API to implements and get rid of some internal parameters in connector function (response, next,...).

What do you think?

from unifile.

lexoyo avatar lexoyo commented on August 25, 2024

Wow that's a great idea, like they did with connect body-parser etc.

from unifile.

lexoyo avatar lexoyo commented on August 25, 2024

👍

from unifile.

KrishnaPG avatar KrishnaPG commented on August 25, 2024

Also, may be some of these connectors can be reused from Browser-FS. Especially the ZipFS, WorkerFS and FolderAdapter types of extensions are valuable in different contexts.

from unifile.

lexoyo avatar lexoyo commented on August 25, 2024

👍 nice project!
And the idea of using nodejs API is a very good one !

from unifile.

lexoyo avatar lexoyo commented on August 25, 2024

@JbIPS I have looked at your branch and the sample here
https://github.com/JbIPS/unifile/blob/refacto-api/samples/simple-api-server.js

Concerning this part of the API (the commands)

  • This is very nice 👍
  • You did not take the idea of @KrishnaPG into account and prefered the "promise" version over node nodejs api, is any particular reason?

Concerning the "useConnector" part

  • The name could be use don't you think?
  • and by the way, I use service more than connector but it is in fact a connector to a service. We should choose a way to call this concept and stick to it

Concerning the "auth" part

  • no json here? just the URL?

Concerning the auth callback

  • you should move this code to the connector, so that you can know when the callback is for which connector?

from unifile.

JbIPS avatar JbIPS commented on August 25, 2024

You did not take the idea of @KrishnaPG into account and prefered the "promise" version over node nodejs api, is any particular reason?

I'm not sure what you're referring to. Callback vs Promise? If so, I hate calling 4 functions with callbacks consecutively and that's often the case with Web API.

The name could be use don't you think?

I thought so after I had to write it numerous time 😉. Connector or service, I don't really care but connector seemed more explicit to me at the time.

no json here? just the URL?

Don't know what you're talking about, the url must be on the wrong line.

you should move this code to the connector, so that you can know when the callback is for which connector?

I was going to but I remembered that I cannot declare route in Unifile. But maybe a dynamic function? Any other idea is welcome!

And thank you for the review, I hope will make a next version universally applauded! 😄

from unifile.

JbIPS avatar JbIPS commented on August 25, 2024

Do you think we should use the same API as fs module? Like unifile.createReadStream()?

from unifile.

lexoyo avatar lexoyo commented on August 25, 2024

+1 to replicate fs API

Maybe something like

var db = new require("unifile").Dropbox({...}); 
db.createReadStream();

from unifile.

JbIPS avatar JbIPS commented on August 25, 2024

Hi guys,

I did some work on my branch to rework the API and use all of the precious inputs in this issue.

Could you take a look at this and give me feedback to ensure we're heading in the right direction? You can find a usage example here and an implementation of the API here. Thanks!

from unifile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.