derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 116 forks source link

Modern examples #290

Closed curran closed 2 months ago

curran commented 2 years ago

It would be great to see some modern examples. The current reference examples have not been updated in 5 years.

Sketch for what I'd like to see:

cray0000 commented 2 years ago

@curran React integration requires observables implementation like MobX to leverage the reactive programming paradigm of racer. Refer to https://github.com/startupjs/startupjs for a working implementation which features:

  1. observables like MobX
  2. monkey-patched ES6 version of racer API with promises
  3. classes and hooks api which handles racer subscriptions and working with local and remote models
curran commented 2 years ago

Thank you @cray0000 for the pointer!

React integration requires observables implementation like MobX to leverage the reactive programming paradigm of racer I would be curious to try an integration without any additional libraries. I bet it is possible.

Are there any Racer examples out there that fall in between the 5 year old examples and StartupJS?

The main thing I struggle with is the basic setup. For example, the examples bundle client JS on demand, and which is confusing. Also, it's not clear how to instantiate Racer without using Browserchannel.

cray0000 commented 2 years ago

@curran react-sharedb is the standalone library which can be used independently from startupjs. You can refer to the following issue on the example to how to set it up:

https://github.com/startupjs/startupjs/tree/master/packages/react-sharedb#using-react-sharedb-in-a-pure-react-project

And if you feel like it you can make a PR there (to startupjs) or here (to racer) with an out of the box working example of pure racer and react integration using react-sharedb

curran commented 2 years ago

Thanks!

craigbeck commented 2 months ago

Thanks for your contributing your issue.

We have recently been actively updating the Derby and Racer packages, and both repos are now in Typescript and published with types on npm. As we have quite a few old issues open we have made the decision to close out of date issues.

If this issue still matters to you we encourage reproducing against the current versions of the repo and opening a new issue.