GithubHelp home page GithubHelp logo

Comments (10)

adamritter avatar adamritter commented on June 21, 2024

from nostr-relaypool-ts.

chmac avatar chmac commented on June 21, 2024

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.

adamritter avatar adamritter commented on June 21, 2024

from nostr-relaypool-ts.

chmac avatar chmac commented on June 21, 2024

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.

adamritter avatar adamritter commented on June 21, 2024

from nostr-relaypool-ts.

adamritter avatar adamritter commented on June 21, 2024

from nostr-relaypool-ts.

adamritter avatar adamritter commented on June 21, 2024

from nostr-relaypool-ts.

adamritter avatar adamritter commented on June 21, 2024

from nostr-relaypool-ts.

adamritter avatar adamritter commented on June 21, 2024

@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.

chmac avatar chmac commented on June 21, 2024

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)

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.