Comments (10)
from nostr-relaypool-ts.
Haha! I wanted to use your relaypool implementation, but the caching stuff was a bit too opaque for me to easily understand. I ended up writing a thin layer over redux instead. The filter deduplication stuff you've written is a nice idea, I had similar thoughts. I found the code impossible to understand, plus I'm a bit wary of let
although I admit that's just a prejudice on my part! Anyway, all of that means I'm not using the codebase so I won't submit a PR. Just wanted to share the suggestion in case you think it's useful.
from nostr-relaypool-ts.
from nostr-relaypool-ts.
I appreciate you being open to feedback. It's not always the case!
I also hear you on everyone reinventing the wheel. It's helpful to have something like nostr-tools which seems to be a standard.
I'm happy to have a closer look at the code and open some issues if you like. For example I just looked at relay.ts
and it seems like it's the same or similar to relay.ts
in nostr-tools
. Maybe there's a good reason for having it in there? An explanation as a comment at the top of the file might make that knowledge more accessible.
In general I'm a big fan of comments. Lots of them. I loved literate coffeescript where you write markdown files and the indented code blocks get executed, more comments than code!
Trying to read relay-pool, my mind is breaking! I think one of the biggest issues is the code formatting. Have you considered using prettier? I'm so used to prettier output by now, that personally, I struggle to read code properly without it. When I copy and paste the file into my editor and format it, I get a lot further.
There seems to be a ton of functionality in that one file. I wonder if there's a way to break it into smaller parts which are individually easier to understand?
The readme could also be a lot simpler to read. More headings, even just more formatting like code
blocks on variable names and so on would make it easier to parse.
My sense is that the nostr space is pretty chaotic at the moment. I guess it'll take a bit of time for that to settle down. My advice for nostr-relaypool would be to work on the docs and simplifying the explanation of what it does. It seems like there's a ton of features in there. Like aggregating filters, sending subscriptions to specific relays, caching results, logic to handle different replaceable events, and so on. But I can't tell how much of which of those things works properly and overlaps. Like what happens if multiple relays return different nip33 events? I think I'd only be able to figure that out by testing, I don't think I'd be able to answer that by reading the code.
from nostr-relaypool-ts.
from nostr-relaypool-ts.
from nostr-relaypool-ts.
from nostr-relaypool-ts.
from nostr-relaypool-ts.
@chmac Hi, I implemented this issue, still it would be nice to talk more, the feedback you provided was appreciated. You can reach me on Telegram as well @Adam8812
from nostr-relaypool-ts.
Cool, awesome to see so many updates. I'll ping you now on telegram, I'm also @chmac on there.
I'll look at the new version now and share any feedback.
from nostr-relaypool-ts.
Related Issues (20)
- Don't give back older event of kind 0 / 3 for the same author/kind pair in a subscription
- Think about removing relay property from filter after delay is implemented
- InMemoryRelay
- Duplicate event filtering test shouldn't pass
- ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
- Return updated metadata / contacts for cached results
- Use EventDemultiplexer HOT 2
- Isomorphic WebSockets
- Cache by any type of filter
- Process events from all running subscriptions
- Don't resend already running filters to a relay
- Hint for storing data in localStorage HOT 3
- Unsub should unsubscribe a virtual subscription immediately
- Auto unsubscribe
- Events missformat HOT 1
- Add reducer for batching filters with limit
- Support for event reactions HOT 1
- Why do Authors use a callback syntax? HOT 2
- NIP-42 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nostr-relaypool-ts.