This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-06
Channels
- # announcements (3)
- # aws (23)
- # beginners (61)
- # calva (57)
- # cider (121)
- # clara (1)
- # clj-kondo (9)
- # cljs-dev (62)
- # cljsrn (3)
- # clojure (79)
- # clojure-europe (2)
- # clojure-nl (19)
- # clojure-spec (9)
- # clojure-uk (14)
- # clojurescript (92)
- # clojureverse-ops (2)
- # cursive (3)
- # data-science (2)
- # duct (1)
- # figwheel (2)
- # graphql (6)
- # jobs (1)
- # kaocha (5)
- # leiningen (11)
- # off-topic (25)
- # overtone (1)
- # pedestal (4)
- # portkey (1)
- # re-frame (1)
- # remote-jobs (2)
- # shadow-cljs (179)
- # slack-help (3)
- # specter (7)
- # testing (14)
- # tools-deps (14)
- # unrepl (12)
- # vim (2)
- # yada (3)
I've been updated a cljs codebase developed ~2015. The compiler is way faster now!!
Do you guys think https://github.com/janestreet/incremental 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?
That appears to be imperative
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?
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
i'd be interested in that style if there was a way to make editors play nice with it.
@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
does everyone use figwheel though? does anyone use clojurescript in the manner on http://clojurescript.org?
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
I noticed there are :watch
and :watch-fn
clojurescript compiler/repl options, I'll try them at home, looks like something that figwheel covers...
sorry, haven't tried yet, but there is other stuff that is not code that expected to be reloadable: css
I also noticed this thing:
:src
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..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
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
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) (c[email protected]: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
@dnolen thanks 🙂.
Yep, now googling a bit I even found a ticket created to address it: https://dev.clojure.org/jira/browse/CLJS-1255
https://clojurescript.org/about/differences#_concurrent_programming 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?
Is there a way to just use JS async/await directly? I'm not sure how I'd define an async function.
@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
(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
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. https://github.com/mhuebert/chia/blob/master/view/src/chia/view.cljs#L171
@U050RLRRQ thanks, will try it out
@dpsutton IIRC this can happen if you use js/console
(ie. prn
). might go away if you open the IE11 devtools
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
but i dont' know what that is. although there seems to be some custom event package in re-frame
also having to do this through browser stack and running figwheel locally and its terrible 😞
@misha I’ve used Object.defineProperty
for this in the past, & I think for the same purpose. eg. https://github.com/mhuebert/chia/blob/master/view/src/chia/view.cljs#L171