Fork me on GitHub
Oliver George02:05:47

I've been updated a cljs codebase developed ~2015. The compiler is way faster now!!

Dustin Getz15:05:36

Do you guys think is possible to build in ClojureScript? Anyone given thought to if this is the right direction and what the level of effort to build is?


there's a few of those incremental frameworks -- look at adapton too

Dustin Getz15:05:12

That appears to be imperative


I haven't used either and can't speak to them. There is some similarity with ref types


They seem like they're closer to reactive extensions than clojure's identities. I'm not sure you can extract a value from one of those without blocking or being clocked by anything.


Hi! I wonder, is anybody here using clojurescript without figwheel? I always assumed it's THE way to do cljs: write some code, save files, watch figwheel reload stuff. But then a couple of days ago I tried to use cljs as described on clojurescript site, and was surprised, that it works just like that, with repl as in clojure. Do people use it like that? Write big applications like that?

Roman Liutikov15:05:53

I’ve heard nextjournal is using cljs repl without figwheel because Figwheel got slow for them, but in general haven’t seen anyone else doing that


is there anyone from nextjournal here? care to share experience? 🙂


i'd be interested in that style if there was a way to make editors play nice with it.

Roman Liutikov15:05:49

@dpsutton I prefer auto reloading + connected REPL so I can explore when needed, but most of the time I don’t care and just want changes to be applied on the screen


we do use it with figwheel but also sometimes turn off live reloading and eval things on a per form basis


this is an advanced feature for us, so it’s disabled by default and we only enable it when you really need the faster feedback cycles


I tend to like to let Figwheel auto-load when messing with UIs, but when working on businesss logic and associated unit tests, I tend to turn off live reloading for that case

☝️ 4

does everyone use figwheel though? does anyone use clojurescript in the manner on


For lib dev I sometimes use plain vanilla CLJS

👍 4

All the self-hosted REPLs are another example of non-Figwheel


I use shadow-cljs, but yesterday I had great success developing a lib just using the node-repl


no need to configure a build. just shadow-cljs node-repl, M-x cider-connect and I was off


Maybe the theme is: Live reloading's sweet spot and where it really rocks is when tweaking UIs


And on the Clojure side, you end up with coarse-grained life-cycle solutions (Component, Mount)


Yeah, if I'm developing a lib, I'll usually have a subproject with an application that consumes the lib. I'll definitely use Figwheel for those application bits. But for the lib, I'll often develop that over the vanilla CLJS so that it's most generic between build systems.


I think I remember juxt/edge eschewing hot reloading for mount/component and inline-eval


(The Mount stuff also works out for Node-based ClojureScript in the same way it does for conventional Clojure server apps.)


we use hot reloading for our Node.js app as well but it could easily be switched to use eval + mount


We even have Mount in a browser-based non-React app


in fact we use mount for parts, but nobody at work uses them in practice 😛


cool, thank you for answers!


I noticed there are :watch and :watch-fn clojurescript compiler/repl options, I'll try them at home, looks like something that figwheel covers...


@vlaaad note those don't hot reload, and aren't going to


@dnolen so there is no way to hot reload using vanilla cljs?


REPL fundamentally hot reload


What Figwheel does is about files


sorry, haven't tried yet, but there is other stuff that is not code that expected to be reloadable: css


will :static-dir reload that?


I also noticed this thing:

The source directory containing user-defined cljs files. Used to support reflection. Defaults to "src/".
I thought there is no reflection in clojurescript? at least searching cljs site for reflection does not provide any more information..


No reloading for assets


Where did you find that doc?


oh sorry this discussion was a bit out of context


that's true, the compiler does use that get information about an existing build


but I see how that could be misunderstand - would need to think about the wording


or if you have an idea, submit your CA and make a PR


Unfortunately I have no idea what documentation for this parameter is trying to tell, so I don't know what how I could reword it


it's really not that important


all it's saying is that the compiler will use that to collect analysis info from :src so that interactions via the REPL work as expected wrt. to known definitions etc.


all we mean by "reflection" here is that Clojure (not ClojureScript) uses vars to support reflection about what's definitions are loaded, docstrings, arglists etc.


ClojureScript can't do it in the same way because the compilation model is completely different


but all this stuff is details


far as I recall this is all handled for you anyway

Vitor Barbosa17:05:06

Hello! One question, is it possible to have the reports for test failures (using cljs.test) pointing to the cljs source code instead of the compiled js code? I wanted to know if this is not supported or I have something wrong in my configuration. For example I'm having failed tests reported like this (firefox):

FAIL in (i-fail) (cljs$test$run_block@http:374:11)
expected: false
  actual: false
And I would like to have them like with something like this:
FAIL in (i-fail) (test/hello_world/core_test.cljs:11:10)
expected: false
  actual: false
Thanks 🙂


I don't think currently we do anything to make that easier - though all the pieces are in place


it's probably a couple of days of work to tie everything together

Vitor Barbosa18:05:28

Yep, now googling a bit I even found a ticket created to address it:

enn18:05:37 does not mention futures or promises, but am I correct in assuming they are not supported because of the lack of agent support? If so, are there recommended alternatives? Promesa maybe?


neat. I've used promesa, kitchen-async looks newer


Is there a way to just use JS async/await directly? I'm not sure how I'd define an async function.


an "async" function just returns a promise


@lilactown kitchen-async is ever-so-slightly smoother to use. Eg. their let variant doesn't require you to wrap anything with a special form like async

👍 4

(defn some-fn []
  (js/Promise.resolve "foo"))
is the same as:
async function someFn() {
 return await "foo";


kitchen-async's utilities like let, ->, do and so on all return promises, and they let you write async forms in a similar format to your synchronous code. "poor man's core.async" it is said, though I've never felt remotely impoverished


it reminds me a lot of your js-interop lib. just the right amount of sugar 😉


is there a way to set a name to a function programmatically but w/o macros (via metadata, etc.)? I need to dynamically return a fn, and want to set a name from an argument, so it would appear in stacktraces. Like:

(defn my-factory [fname a b c]
  (fn fname [a b c] ...))
(my-factory [foo-bar 1 2 3])
=> #object[my.ns$my-factory$foo-bar ...]


@misha I’ve used Object.defineProperty for this in the past, & I think for the same purpose. eg.


@U050RLRRQ thanks, will try it out


have to use a macro if you want stacktraces to be correct


anyone ever see errors from IE11 Object doesn't support this action?


in a reframe app and this works just fine in Chrome


@dpsutton IIRC this can happen if you use js/console (ie. prn). might go away if you open the IE11 devtools


this almost made me quit web dev


might be remembering wrong though


i've got them open because i'm logging. as far as i can tell it just dies when it shouldn't. a reframe event is called [:invoke f arg] with the arg coming in and invoke just calls (f arg). as far as i can tell it doesn't call it but rather throws this error from bidi for some reason


all of my googling tells me it might be using a constructor that doesnt exist


i read somewhere about CustomEvent and ie11 not having that


but i dont' know what that is. although there seems to be some custom event package in re-frame


you said it fails in bidi. does it not have a stack trace?


its async for some reason.


also having to do this through browser stack and running figwheel locally and its terrible 😞


feel that pain - did you try using the free IE11 vms from microsoft?


I bet it's isNaN