Fork me on GitHub
#clojurescript
<
2018-09-30
>
theeternalpulse03:09:46

Does anyone use one of the datalog implementations for app state. I saw datascript has posh and I'm starting to learn datalog

theeternalpulse04:09:44

Also is there a benefit to using this if you are using local storage or a non-datomik like database?

deliciousowl09:09:49

This is good stuff 🙂, which one of you made it? haha http://app.klipse.tech/

deliciousowl09:09:54

I always use it for timed coding challenges so I don't have to wait for the built-in clojure backend to compile

Yehonathan Sharvit09:09:39

@coinedtalk Did you know that you could load code from github gist?

👀 4
deliciousowl09:09:35

nope, that's nifty

gklijs12:09:39

I just found out about Netlify, very easy to put something public for free. Tried it with a pokemon re-frame game I made last Chistmas. https://pokequiz.netlify.com/

👍 4
artesonraju16:09:29

Hi, is there a way to pprint custom edn ? My record implements IPrintWithWriter but it seems pprint doesnt care... https://gist.github.com/Artesonraju/9a6fa406b1d45371a4cb7d6dd4033f55

Braden Shepherdson16:09:27

can anyone recommend an intro to Datomic, and (same or separate) how it can work across the network and on the web?

joelsanchez18:09:00

did anyone manage to solve the Cannot find module 'react' problem?

Jakub Holý (HolyJak)19:09:15

I do not have any such problem? I use shadow-cljs and npm install-ed react.

joelsanchez20:09:22

I heard that it's not a problem with shadow-cljs, but using shadow-cljs is a very big change

joelsanchez20:09:32

I'll stick with cljsjs packaging, then

joelsanchez21:09:28

...between these problems with npm-deps and shadow-cljs's promise of reliable modules, I'm finally trying shadow-cljs. @U05224H0W might win this one after all 😛

👍 4
Jakub Holý (HolyJak)20:09:07

Hello! Any idea how to make my macro output #js? The problem is that the reader tries to process it... My code:

~(let [~name #js ~js-data] ...)
Thanks!

4
Jakub Holý (HolyJak)20:09:29

sorry, forget it, I just realized I perhaps don't need it since the data will be inserted there later, when it is already compiled to javascript

thheller20:09:59

@holyjak you could just use js-obj instead. its more or less identical. otherwise you can wrap the value in cljs.tagged-literal/JSValue.

👍 4
❤️ 4
Digital Baboon20:09:19

Is there a way to run a command on figwheel js reload? E.g let's say you save a file and then runs "lein cljfmt fix"?

bhauman20:09:59

Are you using figwheel-main?

bhauman20:09:46

figwheel-main has a hook, lein figwheel allows you to override the build function

Digital Baboon20:09:47

Not sure if "main", but I am using figwheel

Digital Baboon20:09:59

"lein figwheel" is what I run to develop stuff

sb22:09:10

Hello, somebody could help me how can I use :npm-deps? I read all spec, but not clear for me. I would like to add to project eg. react-google-charts npm repo.

:cljsbuild {:builds
              [{:id "dev"
                :source-paths ["src/cljs"]
                :figwheel {:on-jsload "cljs-react-semantic-ui-example.core/mount-root"}
                :compiler {:main cljs-react-semantic-ui-example.core
                           :output-to "resources/public/js/compiled/app.js"
                           :output-dir "resources/public/js/compiled/out"
                           :asset-path "js/compiled/out"
                           :source-map-timestamp true
                           :preloads [print.foo.preloads.devtools]
                           :external-config {:devtools/config {:features-to-install :all}}
                           :install-deps true
                           :npm-deps {:semantic-ui-react "0.73.1"
                                      :react "15.6.2"
                                      :react-dom "15.6.2"
                                      :react-quill "1.3.1"
                                      :react-google-charts "3.0.8"
                                      }}}

sb22:09:58

How can I use this in the cljs ns?

sb22:09:06

(ns cljs-react-semantic-ui-example.views
  (:require
   [re-frame.core :as re-frame]
   ["react-quill" :as ReactQuill]
   ;??? ["react-google-charts" :as Chart] ;;; or :refer]
   ["semantic-ui-react/dist/commonjs" :as ui]    
   ["semantic-ui-react/dist/commonjs/modules/Transition/Transition" :as transition]
   ["semantic-ui-react/dist/commonjs/modules/Transition/TransitionGroup"  :as transition-group]
   [reagent.core :as r]))

(def divider (r/adapt-react-class ui/Divider))
(def button (r/adapt-react-class ui/Button))
(def quill-component (r/adapt-react-class ReactQuill))

;???

                                        ;(def chart (r/adapt-react-class Chart))

(defn main-panel []
  (let [name (re-frame/subscribe [:name])
        visible? (r/atom true)]
    (fn []
      [:div
       [:div "Hello from  " @name]
       [divider]
       [:div [:p "hello"]]
       [button {:on-click #(println "clicked sui button")} "hello"]
       [:div 
        [quill-component {:value "hello" :theme "snow" :style {:width 650 :height 350 :padding-left 100}}]]
       [:div
        [chart ???]]

       ])))

sb22:09:43

So, I added quill and semantic ui.. but I can’t add the gchart in a same way. I just want to understand better how works npm-deps in real production