Better HN
topnewbestaskshowjobs
Log inSign up

josemaenzo

5 karma · joined Dec 9, 2016 (9y ago) · 15 submissions

www.josema.es www.distributedobjectprotocol.org
Submissions

comment 6y ago · link · parent

nocoiner

comment 6y ago · link · parent

I'm happy that we are moving away from the redux-like standard. I've tried the API in a dumb example and it looks clean and easy. https://codesandbox.io/s/three-buttons-example-with-recoil-q...

Still don't like the extra naming that you have to think of for every atom/value. Or also the key: prop that you have to define for every atom. It seems redundant for me.

And also, as a bundle-phobia guy I am. I think 22kb as extra library is ok but it could be better.

Liking a lot Recoil as solution for the three-button problem. I still think that the patch pattern I use with dop is better. In terms of simplicity and extra KB. This is the same example https://codesandbox.io/s/react-dop-nhj0j?file=/store.js

But I guess I say that because I'm the creator of dop. So I'm so open to critics :)

comment 6y ago · link · parent

Oh, I see. Just wondering, How GUN handle a situation like described above when working with Arrays?

comment 6y ago · link · parent

Does gun have a built-in "Linked list" in the API? If so, where are the docs? Could not find them.

If not, any paper or doc that explain how to implement it with gun?

comment 6y ago · link · parent

Cool! Make sense.

Let's say our state have an array like ['a','b'].

What about if Peer-A splice the first element (0) which results in ['b'] and Peer-B wants to mutate 'a' to 'A' which results in ['A','b'] and they both make the mutation at the same millisecond?

comment 6y ago · link · parent

Can you refer me to a document where you explain the "lexical rank" that you are referring to?

The cartoon explanation do not tackle those terms.

comment 6y ago · link · parent

Do you have any document that explain what resolution algorithm uses in what cases?

For example, one peer change a property value and the other peer deletes it.

8.

Mutable or immutable global state pattern in React with hooks?(dev.to ↗)

3 points · by josemaenzo · 7y ago · discuss

comment 7y ago · link · parent

"definitely isn't a library for shared document editing or more substantial cases that require OT"

You are right, is not a library that provides a way to resolve sync conflicts. Consensus algorithms is a difficult topic, and I haven't seen an approach in JavaScript that resolve this problem. Maybe gun, but I haven't tried.

If you just need client-server architecture with reactivity, why don't you give a try to dop?

comment 7y ago · link · parent

There is no authentication system in dop. You decide if a client can subscribe to a specific object: https://github.com/DistributedObjectProtocol/web/blob/master... The same way you would do it with plain WebSockets

Also you decide what to do when a client call a specific function: https://github.com/DistributedObjectProtocol/web/blob/master...

comment 7y ago · link · parent

The protocol has a versioning system: https://github.com/DistributedObjectProtocol/protocol/blob/m...

Is the responsibility of the implementation to apply the patches/mutations in the correct order of the version.

comment 7y ago · link · parent

Imagine a Chess game, Trello, a multiuser ToDo list app.

If you are familiar with state management libraries such a Redux, Mobx, etc. Dop is more or less the same. With the difference that the initial state of your app can be initialized in the server.

I have to work better explaining this.

comment 7y ago · link · parent

As mention by others, the protocol doesn't handle consensus synchronization. The implementation of the protocol (JavaScript in this case) must apply all the mutations in the correct version order: https://github.com/DistributedObjectProtocol/protocol#exampl...

comment 9y ago · link · parent

Can we use it outside of Meteor?

15.

Distributed Object Protocol(distributedobjectprotocol.org ↗)

3 points · by josemaenzo · 9y ago · discuss