This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-09
Channels
- # beginners (91)
- # boot (5)
- # cider (30)
- # clara (16)
- # cljsjs (3)
- # cljsrn (6)
- # clojure (84)
- # clojure-dev (4)
- # clojure-dusseldorf (1)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-uk (120)
- # clojurescript (54)
- # core-async (25)
- # core-matrix (1)
- # css (2)
- # cursive (20)
- # datomic (28)
- # editors (11)
- # emacs (6)
- # figwheel (4)
- # figwheel-main (28)
- # fulcro (36)
- # graphql (7)
- # hyperfiddle (2)
- # jobs (6)
- # jobs-discuss (10)
- # lambdaisland (1)
- # lumo (3)
- # nrepl (20)
- # off-topic (24)
- # pedestal (2)
- # protorepl (3)
- # reagent (3)
- # reitit (2)
- # remote-jobs (1)
- # ring-swagger (26)
- # rum (1)
- # shadow-cljs (247)
- # spacemacs (29)
- # tools-deps (12)
- # vim (15)
hi guys
when i make (def app-state (reagent/atom {}) is this version for each client ?
or just one app-state for full app ?
so it's a one version for all clients?
As an "SPA" thing, the identity of most things are going to be specific to a particular client
There's some "server side rendering" stuff that has been done and you can run CLJS on the server, but most reagent apps you'll see are "Single Page Apps" where most logic is being run on the client.
so, you know how re-frame projects are set up with 2 source directories (`clj` and cljs
)? Well, in the project.clj, how do you refer to a symbol in the clj sources? I'm trying to get lein-garden to work, but I'm suppose to point it to the my-project.core/style
where I have a defstyles
defined... but I don't know how to š
Check out the lein templates for reagent and re-frame, if you haven't. They helped me to understand things a bit better. lein new re-frame project-name +garden
anyone have any idea how to do this with garden?
*,
*::before,
*::after {
box-sizing: inherit;
}
[:* :*:before :*:after {:box-sizing "border-box"}]
that how we do it in our project
:after
is css2 and ::after
is css3 but both work
try to use ::after in the same way
but everything works for us
Hey everyone. Iām building a Reagent app and Iām noticing that my compiled JS file is pretty big (> 2MB). This is with advanced compilation too. Does anyone know of a code analyzer in the CLJS ecosystem, similar to what Webpack has? https://www.npmjs.com/package/webpack-bundle-analyzer
@forrest.thomas what build tool are you using?
@forrest.thomas shadow-cljs
can generate reports like this one: https://code.thheller.com/demos/build-report/huge.html but it currently only works for shadow-cljs.
you could try https://www.npmjs.com/package/source-map-explorer but it won't be very accurate
problem is that all cljsjs deps won't be properly source mapped. so you end up with one big undefined blob
well, its a start. it really just seems like 2mb is too big and its just not clear to me where all that bloat could be coming from
I'm trying to make js promises synchronous, but I seem to fail:
(let [ch (async/chan)]
(go
(.then js-promise
(fn [success]
(async/>! ch {:status :success
:result success}))
(fn [error]
(async/>! ch {:status :errors
:result error})))
(let [{:keys [status result]} (async/<! ch)]
(if (= status :success)
...
...))))
When I run this, I get this error:
Uncaught (in promise) Error: >! used not in (go ...) block
at Object.cljs$core$async$_GT__BANG_ [as _GT__BANG_] (async.cljs:113)
So, apparently, when using a channel in a callback in the go-block, it's not in the right scope?
@kurt-o-sys maybe you have to wrap your callback function bodies in (go ...)
solved... right š
thx š
can I actually wait until the go-block is finished? The problem is: I have this js promise and I need that value and have to do something with it so I can return the result. If I'm not mistaken, that go-block returns nil and is executed async. I actually need to make that promise really synchnronous (= waiting for it's value and do something with it before returning from the function)
so, the go-block returns nil
, right?
you canāt āmake a promise synchronousā in JS. thereās no such thing as <!!
in CLJS
the go
will return a channel that will output whatever is returned at the end of the form
ok... that's weird. It seems to return nil
, I may try again.
I don't know much about js promises, but I suspect the correct thing to do is to not use >!, but to use put! with the callback that is called when the put! completes
oh, now I see... it returns a channel that outputs something. hmmm... too bad. Not sure how I'll solve this one.
hello guys ā¦ has anyone every managed to include cljs packages within a pure JS app?
like var someCljsPackage = require('someCljsPackage')
listed in package.json?
for me the missing link is how to make the packages in http://cljsjs.github.io accessible for npm or yarn