Code Monkey home page Code Monkey logo

cause's People

Contributors

becomingbabyman avatar bobby avatar dependabot[bot] avatar smothers avatar sooheon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cause's Issues

Error when transacting empty collections at leaf of Causal Map

There are several reasons why we'd want to start a CausalBase with empty leaf collections, including initializing a new data structure. Currently we're unable to do so.

Repro:

(require '[causal.core :as cause])
(def db (cause/base))
(cause/transact db [[nil nil {:foo {}}]])
=> Error: The cause of this node is not in the tree.
    at new cljs$core$ExceptionInfo (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37198:10)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37259:9)
    at Function.cljs$core$IFn$_invoke$arity$2 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37255:26)
    at Function.cljs$core$IFn$_invoke$arity$4 (http://localhost:8000/js/compiled/cljs-runtime/causal.collections.shared.js:292:25)
    at Object.causal$protocols$CausalTree$insert$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/causal.collections.map.js:542:79)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/causal.protocols.js:168:19)
    at http://localhost:8000/js/compiled/cljs-runtime/causal.base.core.js:191:32
    at http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19649:89
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19650:3)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19646:78)

*e
=> #error {:message "The cause of this node is not in the tree.", :data {:causes #{:cause-must-exist}}}

UUID-indexed map doesn't transact

I'm unable to add a map with UUID keys. Reproducing case:

(cause/transact (cause/base) [[nil nil {#uuid "79f12947-b05b-4b57-8a19-1f4ef587a08a" {:id #uuid "79f12947-b05b-4b57-8a19-1f4ef587a08a"}}]])

Error Message (CLJS):

Error: The cause of this node is not in the tree.
    at new cljs$core$ExceptionInfo (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37198:10)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37259:9)
    at Function.cljs$core$IFn$_invoke$arity$2 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37255:26)
    at Function.cljs$core$IFn$_invoke$arity$4 (http://localhost:8000/js/compiled/cljs-runtime/causal.collections.shared.js:292:25)
    at Object.causal$protocols$CausalTree$insert$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/causal.collections.map.js:544:79)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/causal.protocols.js:168:19)
    at http://localhost:8000/js/compiled/cljs-runtime/causal.base.core.js:191:32
    at http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19649:89
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19650:3)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19646:78)[:app] Compiling ..

CausalBase Serialization

Currently, it is possible to view the EDN current-state of a CausalBase. However, there is no way to serialize the entire CausalBase (including history, etc.) for, e.g., putting it in LocalStorage in a browser or sending it on the wire.

CausalBase should implement the CLJ(S) multimethods and protocols necessary to serialize its entirety to EDN, and should add EDN readers for de-serializing back into memory.

Transit would also be nice to have, but could be maintained as a separate project, to keep dependencies lean and clean.

Post-transaction tx-data

In Datomic, the transaction result includes tx-data, which is a fully-resolved and complete version of the transaction originally submitted (i.e. with tempids resolved, transaction functions applied, maps flattened, etc.).

It would be very helpful to include something similar in the result of a CausalBase transaction, e.g. for sending on the wire to other participants with their own local versions of the CRDT.

Add ability to set identifier on CausalBase

The entities which we're storing as CausalBases already have their own unique identifier (UUID). Similarly to how we can set the site-id to something custom, we should be able to set the identifier portion of the ID vector to our own identifier.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.