News for hackers. Stuff that matters.
Re:Dop: Distributed Object Protocol by creamyhorror on Saturday December 29, 2018 @12:54PM (#18784778)
Does anyone have recommendations for node packages that perform similar client-server pub/sub or even sophisticated syncing?

Besides dop, DerbyJS/Racer seems to be dead, Apollo might be a solution but seems to require some setup, Meteor is too heavy, and Feathers with RxJS seems like a possibility. I'd be interested in any tools for getting easy client-server sync or reactivity.

Re:Dop: Distributed Object Protocol by toomim on Saturday December 29, 2018 @04:30PM (#18785817)
I can toot my own horn here: https://stateb.us.

Statebus can easily synchronize N clients to N servers, and has a very nice wrapper on top for reactive UI widgets to respond to changes in state. Here's a hello world example:

    dom.BODY = ->   # Let's define the body tag as a function
      DIV
        backgroundColor: '#eef'
        'The time is '
        fetch('state://server.com/time').now
        ' and the weather is '
        fetch('state://another.org/weather/oakland,ca').brief
This defines the <body> tag as a function that will reactively re-run whenever the state of the time (fetched from server.com) or the weather (fetched from another.org) changes.
Re:Dop: Distributed Object Protocol by creamyhorror on Sunday December 30, 2018 @04:38PM (#18791497)
Interesting project with very simple core API. I saw some feedback about more sophisticated syncing through OT/WOOT/CRDT, though I don't know if that fits your approach.

If it can be used seamlessly with Vue/React (as mentioned in older discussions) such that changes are propagated into them, I'd be interested to try it. (Those libraries are in heavy use already so your solution would have to work with them for a decent chance at traction, I think.)

Re:Dop: Distributed Object Protocol by toomim on Thursday January 03, 2019 @07:58PM (#18821056)
Thanks! Yes, the API is very simple. And indeed:

(1) It does work with React natively, and in fact the example I gave above uses React under the hood. Here's how to do the same thing with raw react:

    <script src="https://stateb.us/client6.js"></script>
    <script>
    var body = statebus.create_react_class({
      render: () => {                          // This function will re-run whenever
        return React.DOM.div(                  // any state fetched below changes
            {style: {backgroundColor: '#eef'}},
            'The time is ',
            fetch('state://server.com/time').now,
            ' and the weather is ',
            fetch('state://another.org/weather/oakland,ca').brief
        )
      },
      displayName: 'body'
    })

    setTimeout(_=> React.render(body(), document.body))
    </script>
You can put that into a .html file and run it directly in your browser with a file:// URL.

I would love to help you give it a try and see what you think! Please send me an email or text ([email protected] or 510-282-4312) for feedback and assistance.

2) We are currently OT/CRDT/Version Control into it. We've come up with a new approach here, which I'm very excited about. I'm also looking for folks to beta-test or give early feedback on our approach as we polish it up.

I'm also interested in adding Vue support. If you'd like it, I'll add it.

Re:Dop: Distributed Object Protocol by bauerd on Saturday December 29, 2018 @12:56PM (#18784786)
A coworker praised https://pouchdb.com

Apparently a client for CouchDB.

Edit: Not affiliated with PouchDB, it's FOSS

Re:Dop: Distributed Object Protocol by zrail on Saturday December 29, 2018 @01:30PM (#18784969)
PouchDB isn’t a client, it’s a whole implementation of CouchDB on top of IndexDB running in the browser or a Node server. It speaks the CouchDB sync protocol.
Re:Dop: Distributed Object Protocol by Ezku on Saturday December 29, 2018 @03:05PM (#18785407)
Maybe check out Gun (https://gun.eco)? It's CRDT-based and the docs make it look like they're taking things like consistency seriously. I have no experience with it, so can't make a recommendation either way, though.
Re:Dop: Distributed Object Protocol by creamyhorror on Sunday December 30, 2018 @05:00PM (#18791609)
Another interesting project with decent-looking adoption. The focus on p2p sync is a little off for typical server-client usecases. But it's nice to see that it can work with Vue/React.