1

I use rethinkdb and nobrainer as my ODM. Will Hyperstack be in sync with my models? i.e. state syncing between the backend db and the frontend?

sambehera
  • 959
  • 3
  • 13
  • 33

1 Answers1

3

As of right now HyperStack/HyperModel has a direct dependency to ActiveRecord so there is no real way to utilize this library without also using ActiveRecord as well.

Excerpt from hyper-model.gemspec

spec.add_dependency 'activerecord', '>= 4.0.0'

This seems to be due to the ActiveRecord API binding: https://hyperstack.org/edge/docs/dsl-isomorphic/models#activerecord-api

Hyperstack uses a subset of the standard ActiveRecord API to give your Isomorphic Components, Operations and Stores access to your server side Models. As much as possible Hyperstack follows the syntax and semantics of ActiveRecord.

engineersmnky
  • 25,495
  • 2
  • 36
  • 52
  • Hyperstack uses a couple of things from ActiveRecord: It uses the schema, and relationship definitions, so that if for example you say `Todo.find(1).comments.first.text` it knows what each of the methods will return. Secondly it relies on the after_commit callbacks so that it knows when the DB has been updated, and can broadcast changes, Third it uses ActiveRecord transactions and rollbacks. – Mitch VanDuyn May 03 '19 at 20:48
  • You could of course use the rest of Hyperstack, but you would have to synchronize your models manually. Of of course the Hyperstack team would welcome any contributions to getting things to work with NoBrainer. A reasonable subset should be possible – Mitch VanDuyn May 03 '19 at 20:54
  • @MitchVanDuyn maybe we should look into abstracting into adapters like ActiveRecord did for databases. That way it would be agnostic as long as you can provide an appropriate syncing adapter. This would be beneficial to NoBrianer, as well as other ORMs like Sequel. Haven't really looked at the code base but maybe I will give it a run through to see what can be seen (I am assuming given the references the binding is very tight right now) – engineersmnky May 03 '19 at 20:58
  • https://join.slack.com/t/hyperstack-org/shared_invite/enQtNTg4NTI5NzQyNTYyLTYzYTZhYTE2MGE5ZTQ0OTAyNDVlMzE5OTk5NWNmZmMzYjhkZGY1MDc3MGFjMGZlYzE5ZWJhZDJiMmQyYzAxMjY – Mitch VanDuyn May 03 '19 at 22:29