This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-24
Channels
- # architecture (7)
- # beginners (73)
- # boot (4)
- # cider (48)
- # cljsjs (7)
- # cljsrn (27)
- # clojure (206)
- # clojure-boston (2)
- # clojure-italy (21)
- # clojure-nl (8)
- # clojure-spec (7)
- # clojure-uk (94)
- # clojurescript (126)
- # clojutre (7)
- # core-async (3)
- # cursive (7)
- # data-science (1)
- # datascript (4)
- # datomic (6)
- # duct (1)
- # emacs (19)
- # figwheel (1)
- # fulcro (31)
- # graphql (13)
- # jobs (5)
- # jobs-discuss (42)
- # keechma (4)
- # leiningen (10)
- # luminus (3)
- # mount (2)
- # nyc (3)
- # off-topic (37)
- # om-next (3)
- # onyx (45)
- # pedestal (2)
- # re-frame (4)
- # reagent (2)
- # reitit (16)
- # shadow-cljs (118)
- # spacemacs (10)
- # tools-deps (8)
- # vim (20)
Anyone able to run 2.3.2?
@lilactown what interfaces are reported?
I added IP detection since react-native stuff needs to be able to connect to the shadow-cljs server remotely
I’m struggling to run a REPL with Cursive - I have followed the guide but still am a bit stuck
[:no-client :script “Make sure your JS environment has loaded your compiled ClojureScript code.“]
@raymcdermott have you
(require '[shadow.cljs.devtools.api :as shadow])
(shadow/nrepl-select :build-id-to-focus-on)
in the clj repl after it starts?right. so you probably want to use shadow-cljs node-repl
+ (shadow/nrepl-select :node-repl)
for this
their websocket connection would keep the script running even after your work was done
@thheller Do you have a preferred policy on bringing up shadow-cljs issues on Slack first vs. straight to GitHub or just play it by ear?
Hello,
I am trying to set up clojurescript spec instrumentation with shadow, but I am running into an issue. I added an fn in the after-load
hook in my shadow-cljs.edn
which calls instrument
. I am getting spec errors for existing specs, but when I add a new spec I don't see anything. Can anyone help me with this issue?
@fatihict if you call instrument manually after the js is reloaded, it works?
I just tried your suggestion @wilkerlucio, but I don't see any messages in my devtools of the new spec I defined.
I'm just wondering if that's a issue of "timing" or maybe something else
Yeah, I also really wonder what the issue could be. I did try to define about 20 new specs, so it doesn't look like a timing issue.
@fatihict instrument
is a macro so if the code must be recompiled in order for it to update which specs to instrument
you can force recompilation of the namespace that has the instrument
call via (ns ^:dev/always that.ns ...)
instrument
in CLJS only works on vars that are compiled BEFORE instrument
is compiled.
I am currently testing with this:
(defn bla [x]
(+ 1 x))
(s/fdef bla :args (s/cat :x number?))
And calling the function with a string
to trigger an errorI also wrapper the call the instrument
with a println and I noticed that the new specs I add are not included in the output of instrument
(defn bla [x]
(+ 1 x))
(s/fdef bla :args (s/cat :x number?))
(bla 1)
(bla "foo")
(st/instrument)
eg. in your after-load
function when calling instrument
. if you call a specced function and that does not properly validate thats a bug. anything else is probably an issue related to when things happen.
I'm calling instrument
and afterwards refreshing my fulcro
application. In my application I have a call to the mentioned bla
function.
so to recap. you have an (ns ^:dev/always some.thing (:require [your.app :as x] [cljs.spec.test.alpha :as st]))
(ns ^:dev/always demo.instrument
(:require
[demo.browser :as x]
[cljs.spec.test.alpha :as st]))
(defn ^:dev/after-load instrument []
(st/instrument)
(js/console.log "instrument called")
(x/bla 1)
(x/bla "foo"))
then added the spec, saved the file, let live reload do the thing. and the spec failed as expected?
@thheller That works for me as well. if I require the namespace where I have defined the spec in my instrument
file it works, but not if I don't
don't think I added :output-wrapper
as a simplified version of the above. all my builds use multiple modules where you kinda can't use a wrapper
this is just cljs.closure
copied from CLJS to fix one particular bug. it is not used at all.
For a lot of people, output-wrapper has caused problems since non-wrapped fn's can shadow (ha) other vars. Large discussions on the other library pages: https://github.com/boot-clj/boot-cljs/issues/64
@kanwei I'm well aware why :output-wrapper
is useful. also gave you the solution you can use for now. same effect.
the issue is that as soon as you use multiple :modules
the :output-wrapper
breaks things
could probably add support for it and just fail when multiple modules are configured
@fatihict so, you have to require it in some way, I guess it was the first thing tomas said, you have to force the ns that define the spec to be loaded before instrument, otherwise it will not work
@wilkerlucio Is there a way to force the ns that has the spec to be defined without requiring it? Requiring every namespace with specs in my instrument
namespace is not the best solution
well, it only has to be reloaded if changes, so if you save a spec file, that file should be reloaded before your after-load gets called, thats when I'm getting confused, because if it does so, then it should work @fatihict
@fatihict it should be fine to only require your :entries
ns since that will have required everything else?
@thheller I'm experimenting with some auto-test setup using Shadow and Karma, I see the configuration outputs a single file, I can watch on shadow and karma and get some auto-test running, but it always runs all the tests, do you think would be possible to have something more localized? like generating multiple files and running parts of then, kind like Jest does (in case you know it)
@wilkerlucio definitely possible with some code that doesn't exist yet 😉
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/test/karma.cljs#L107 just need to filter somehow here
humm, interesting
Jest has a very cool test runtime, for instance, it can re-run only failing tests until they pass
then he can run the full suite after the tests get fixed, and it provides interactive commands if you wanna re-run things at anytime (one key shortcuts on the readline of the process)
I'm really considering it, but there are downsides...
Jest runs on node environments only, not in the browser
don't have time to look into that currently but shouldn't be hard given that storybook also just works
although JS community has a lot of tools to deal with that (for testing react things on node), I still think running in the browser is more reliable, and we can do real DOM testing
so, I'm thinking between having a great dev experience for testing vs been able to use real DOM on tests
but on the Jest that would be a lot of things to wrap before it gets smooth from a CLJS perspective
hello, I got some weird thing, I tried removing the clojurescript
from my deps, and now when I try to compile I'm getting this:
shadow-cljs - config: /Users/wilkerlucio/Development/fulcro-shadow-boot/shadow-cljs.edn version: 2.3.5
shadow-cljs - running: lein with-profile cljs run -m shadow.cljs.devtools.cli --npm watch test
Exception in thread "main" java.lang.RuntimeException: No such var: ana/cacheable-files, compiling:(shadow/build/cljs_closure.clj:569:19)
at clojure.lang.Compiler.analyze(Compiler.java:6792)
how can I know the version it got?
ok, found it, was fulcro-spec, thanks
@thheller have you published your workflow with cursive? from various tidbits i get the sense that you must run your watch command from the terminal (or maybe from the repl?)
i’m thinking there’s a better way than what i’m doing, which is to run the watch from the cli and then scroll all over the place to look at errors/warnings
@thheller @wilkerlucio By the way, thanks for your help today. I haven't fixed my issue yet, but will update you once I know more 🙂