dat-ecosystem-archive / dat-node

Node module for creating dat compatible tools on file systems [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
https://dat.foundation
MIT License
501 stars 63 forks source link

would like better jsdoc coverage for function callbacks #250

Closed SreeChandan closed 4 years ago

SreeChandan commented 4 years ago

I am reporting:

Bug Report

Please give us details about your installation to assist you. Run dat -v to see the version of Dat you are using.

Expected behavior

I don't know how to word it properly but none of the function callbacks seems to be typed properly. I will be open here, I am mainly a typescript dev. And I have seen #148. I respect your preferences, so I won't go into that discussion. I am not very familiar with how jsdocs works. If callback functions can be typed as the rest of the parameters that would be great. I am looking to get better at using jsdocs so if you want I can learn and try to give PRs. Let me know If you are open to that.

Actual behavior

Here's an example. image

Debug Logs

RangerMauve commented 4 years ago

I don't think anyone is actively working on updates for this repo, but I'd be more than happy to review and merge a PR if somebody is interested in taking this one. 💜

SreeChandan commented 4 years ago

wait. This repo isn't actively worked on? I'm looking to build an app based on dat-node. While it's not a commercial project for me, I do want a stable dependency. Is there an alternative?

RangerMauve commented 4 years ago

The Dat SDK is where all the latest work is being done in at the moment. Specifically I'm in the process of adding in the latest networking stack and data structures into it. https://github.com/datproject/sdk/issues/36

SreeChandan commented 4 years ago

I see. Glad to know. Are you guys planning to deprecate this repo or its just a question of shifting focus and resources?

SreeChandan commented 4 years ago

Anyways, thanks for your time. And for saving my time.

RangerMauve commented 4 years ago

Yeah, dat-node was actually deprecated for a bit, but we realized that it was still useful for certain applications so we un-archived it. There's a note in the README saying to use the SDK, though. Might need to make it more prominent. 😅

SreeChandan commented 4 years ago

This is probably a tangent. I am trying to create an API using dat. As in I want to basically send http-like requests over dat. Any idea of how to go about it? I'm kinda confused. I want my front end to send requests to backend that's probably on another system over dat.

SreeChandan commented 4 years ago

You don't have to explain in detail. At this point any direction is helpful.

RangerMauve commented 4 years ago

If you want some sort of messaging with peers you should check out the extension messages feature. This lets you send arbitrary messages over a connection.

I put together a thing called hypercommunication that builds off of it. Generally speaking though, Dat is good for a producer creating some sort of data in an archive, and readers getting data out of that archive.

Another approach which could be cool is using Dat's hypercore feature as an event queue. You can have the client create a feed full of tasks, and the server produce a feed full of results. Then you can have both of them add data and have it eventually sync regardless of whether they're constantly online or connected directly (since it can be replicated through third parties or something).

kappa-core is a pretty cool Dat related ecosystem for making apps which might get you some more insight. https://docs.datproject.org/docs/kappa