News for hackers. Stuff that matters.
Re:A state syncing framework based on Vuex and rollback netcode by udbhavs on Thursday December 09, 2021 @07:04AM (#29496430)
Related - I'm working on a hobby hearthstone-like card game using Vue and although it's not two-way, I have a system that's reactive all the way down from the server to the dom rendering of the game board.

I have a deep Proxy that wraps the game state and watches for any changes on the server. It then sends a diff of the current state with the previous synced one using fast-json-patch (https://www.npmjs.com/package/fast-json-patch) to the client which also uses the same library to reconcile the state within a Vue reactive({}) object, which then updates the DOM. Since it's only a card game, it's all event based and there's no game loop or polling needed and there's only a few websocket messages per minute. It was fun to design and is pretty efficient too.

Re:A state syncing framework based on Vuex and rollback netcode by protoduction on Thursday December 09, 2021 @07:34AM (#29496639)
Sounds really interesting! Is this open source somewhere? Or perhaps you could share some gist to learn from?
Re:A state syncing framework based on Vuex and rollback netcode by ahefner on Thursday December 09, 2021 @02:41PM (#29501948)
Is the state so large that it's worth the effort sending diffs rather than the whole state?

Being a bit of contrarian, and not a front end person, I'm inclined to believe that you could do the DOM manipulations pretty easily in plain JS without a framework.

Anyway, sounds like a fun project.

Re:A state syncing framework based on Vuex and rollback netcode by kevinjahns on Thursday December 09, 2021 @08:23AM (#29497028)
This looks similar to SyncedStore which was posted just yesterday: https://news.ycombinator.com/item?id=29483913
Re:A state syncing framework based on Vuex and rollback netcode by matthewfcarlson on Tuesday December 07, 2021 @01:11PM (#29476055)
A look into rollback netcode inspired state syncing over websockets.
Re:A state syncing framework based on Vuex and rollback netcode by mathgladiator on Thursday December 09, 2021 @07:05PM (#29504866)
This space is near and dear to my heart, and I'm building a language around it: http://www.adama-lang.org/

I'm over-indexed on the language, but at the core is you are fundamentally building a data-base like thing with a logger.

Re:A state syncing framework based on Vuex and rollback netcode by egeozcan on Thursday December 09, 2021 @06:17AM (#29496169)
I thought meteor does this fairly well, also with optimistic updates.