This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-30
Channels
- # beginners (126)
- # boot (2)
- # cider (6)
- # cljs-dev (46)
- # cljsjs (8)
- # clojure (122)
- # clojure-greece (57)
- # clojure-italy (6)
- # clojure-poland (3)
- # clojure-russia (2)
- # clojure-serbia (5)
- # clojure-spec (26)
- # clojure-uk (99)
- # clojurescript (39)
- # cursive (15)
- # datascript (7)
- # datomic (21)
- # dirac (7)
- # duct (1)
- # emacs (19)
- # fulcro (58)
- # garden (4)
- # graphql (15)
- # hoplon (2)
- # immutant (1)
- # instaparse (3)
- # jobs (5)
- # juxt (15)
- # klipse (4)
- # leiningen (2)
- # lumo (52)
- # off-topic (8)
- # om (27)
- # onyx (22)
- # other-languages (3)
- # portkey (2)
- # protorepl (2)
- # re-frame (7)
- # reagent (7)
- # ring (11)
- # rum (7)
- # shadow-cljs (114)
- # spacemacs (20)
- # specter (16)
- # test-check (5)
- # timbre (1)
- # unrepl (43)
- # yada (17)
Anybody knows how to attach transaction data from datomic to datascript?
In Datomic, transactions are entities like everything else, they just get created with unique ids
But I’d need more info to know how to help you
@tbaldridge Basically I have a :tx-data
from tx-report
then I transform it such that it suitable for datascript to consume [[:db/add 132132132 :user/name "foobar"]]
Datomic allows me to explicitly set the :db/txInstant
, so [[:db/add 132132132 :user/name "foobar" 111111111] [:db/add 111111111 :db/txInstant "current date" 111111111]]
While Datascript can't. It just overrides the transaction id with :db/current-tx
. What I'm trying to do is to clone
transaction to datascript
oh I see, yeah, I don't think Datascript has any support for transactions at all, what with it not supporting history
one of my biggest issues with the library, it tries to copy Datomic, but just completely ignores some of the better features. It ends up creating a bit of a impedance mis-match
So it's not doable in the current state then
Thanks
Yeah, I don't think it is. You might be able to hack something in via an extra attribute on every entity, but that's a bit icky
@boldaslove156 you are reading from a queue of raw transaction reports on the frontend? It sounds like what you may want is a reduce
on those into whatever data structures you need to query from the UI.
Problem is, Datomic tracks time, data script doesn’t
So if you need time, you’re hosed
Could you realistically rely on them being delivered in-order within a certain window?
Yes I was, and I succeed it to the extent I can have somewhat of a copy of datomic in datascript
Except the transaction id
I'm not sure about that, but I think it won't be a problem even if the order is messed up, since the date is generated by datomic
Maybe in the current state I just have to add datascript specific datom about datomic transaction id just like @tbaldridge suggests
You may also want to check out the https://github.com/metasoarous/datsync library (includes "Translate ids between Datomic and DataScript in transaction flow" as a feature)
DataScript does not let you change transaction id, but you can set any attrs on each transactions to any values you want
(d/transact! conn
[[:db/add e :attr v]
[:db/add :db/current-tx :db/txInstant (js/Date.)]
[:db/add :db/current-tx :original-datomic-tx-id 11111111]])
Hi, I'm having a problem in om.next which drives me crazy. 🙂 Namely my view is not being rendered at all as soon as the root comonent implements om/IQuery
, and I can't figure out why. When I comment the IQuery part, everything is ok, but as soon as I put it back, my view is not rendered at all (with no errors & co). Did anybody encounter this issue?
I found the problem: initial data was null, therefore the initial rendering is not happening 🙂
Cross post from #cljsjs since it may be a more general question:
If I’m trying to override the provided deps.cljs
file from a cljsjs
jar, is there a way I can still use the :file
in :foreign-libs
compiler opt to refer to the file within the jar?
e.g.
{:file "cljsjs/project/development/project.inc.js"
:file-min "cljsjs/project/production/project.min.inc.js"
:provides ["cljsjs.project"]
:requires ["things.here"]}
I get file not found doing it this way. It seems to try to form an absolute file path based on my project root.generally with the jvm you can’t use things in jars as if they were files, the apis don’t generalize on that level, and File is not the generic thing
and so far, I haven’t seen any special handling of where the :foreign-libs
entry comes from
@mikerod yeah - that could be the case, I was only talking about the general thing and I don’t know exactly how :file works in cljs maps
Hello, how do you convert $(‘#grid’).w2grid({name:’grid’, ...}); hopefully without jquery. Has anyone used w2ui from ClojureScript? I don’t see any cljsjs for w2ui yet. Referring to http://w2ui.com/web/demo/grid Thx.
(ins)dev:cljs.user=> (require '[goog.object :as gob])
nil
(ins)dev:cljs.user=> (gob/get #js{:#grid "OK"} "#grid")
"OK"
so something like (-> js/$ (gob/get "#grid") (.w2grid #js{:name "grid" ...}))
without jquery is another question of course
I want to write:
var div = goog.dom.createDom('div');
goog.dom.setProperties(div, {
'style': 'background-color: red',
'class': 'div-class',
'id': 'container'
});
I'm writing:
(defn foobar []
(let [svg-dom (gdom/getElement "app")
svg-text (.createElementNS js/document "" "text")]
(removeAllChilds svg-dom)
(.appendChild svg-dom svg-text)
(.setProperties svg-text (clj->js {"x" 20 "y" 20}))))
I think there is something wrong with the .setProperties
and clj->js