This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-02
Channels
- # adventofcode (47)
- # announcements (7)
- # aws (1)
- # babashka (52)
- # beginners (80)
- # boot (3)
- # calva (19)
- # cider (9)
- # cljs-dev (1)
- # clojure (48)
- # clojure-brasil (1)
- # clojure-dev (27)
- # clojure-europe (3)
- # clojure-madison (3)
- # clojure-nl (29)
- # clojure-spec (11)
- # clojure-sweden (1)
- # clojure-uk (49)
- # clojurescript (66)
- # core-async (20)
- # cryogen (4)
- # cursive (13)
- # data-science (7)
- # datomic (5)
- # emacs (30)
- # figwheel-main (11)
- # fulcro (15)
- # graphql (8)
- # jobs (5)
- # joker (17)
- # lambdaisland (1)
- # leiningen (2)
- # malli (2)
- # off-topic (5)
- # pathom (22)
- # re-frame (12)
- # reagent (29)
- # reitit (2)
- # ring (10)
- # shadow-cljs (57)
- # specter (3)
- # tools-deps (22)
- # vim (5)
- # xtdb (7)
also added https://github.com/thheller/shadow-cljs/issues/609 so I don't forget
how long do you think it might take to fix the naming issue?
Cool, no rush, thx
hey, just wanted to say yet again, that shadow-cljs is such an amazing tool 🙂 very happy to be using it daily.
Hi I am trying to consume vis-network as a npm-package using the ns require form
(my.ns
(:require [reagent.core :as r]
["vis-network" :as vis]
[clojure.string :as str]))
I run into https://github.com/visjs/vis-network/blob/c47be95c57caaa69ce31a6fca70fbf77f51fcac6/lib/network/modules/ManipulationSystem.js#L1206 this error with a release build so I am now doing a :simple build.
I also noticed the following warning with the release build, but not sure whether it is related
Resource: node_modules/vis-network/dist/vis-network.min.js:2
constant module$node_modules$vis_network$dist$vis_network_min assigned a value more than once.
Original definition at externs.shadow.js:4
Appreciate tips & pointers 🙂@iku000888 not sure what you mean. the warning you get can be ignored. what about the if
you posted? looks like its checking the arity of a function? maybe one you passed in? (fn [arg1 arg2] ..)
?
Thanks for checking! Right, so in a non release build the function I pass in gets correctly invoked
And with a release build throws an error with the pointed error message in the same context
FWIW :advanced
compilation will often remove function args if you don't use them. eg (fn [arg1 arg2] (use-only arg1))
it'll optimize that to (fn [a] ...)
since JS doesn't care if the arg is declared (usually)
@thheller Happy to report that bumping from [thheller/shadow-cljs "2.8.69"] to [thheller/shadow-cljs "2.8.76"] fixed the issue 😂 😂
FWIW here is the repro effort https://github.com/iku000888/reagent-shadow-cljs-vis-js if curious.
https://github.com/iku000888/reagent-shadow-cljs-vis-js/blob/master/src/my/dev.cljs#L23
so the closure compiler will remove it from the argument list to make to code smaller
I did not need call it because I discard the object upon re-rendering, but now I am enlightened
@pavel.klavik I added :release-version
in 2.8.77
see https://shadow-cljs.github.io/docs/UsersGuide.html#release-version
Thx, looking at it. I am currently building uberjar like this in project.clj:
["clean"
["run" "-m" "shadow.cljs.devtools.cli" "release" "client"]
"compile"
["less" "once"]]
Any idea how to add the version there in the easiest way?I'd probably create something like the release
fn described here https://shadow-cljs.github.io/docs/UsersGuide.html#clj-run
note the extra vector that is currently required (since you are allowed to use --config-merge
multiple times too)
I'm trying to upgrade the version of shadow-cljs that my :npm-module
uses, but I'm finding that (from version 2.8.69) :closure-defines
in shadow-cljs.edn isn't overriding the default values. Did something change in how that's configured? The documentation doesn't seem to differ from what I have.
Though for my current purpose I should be able to use goog.DEBUG
, since that appears to still get set.
@thheller thx for the quick, got it working with git commit ids; for anyone running on Heroku, this is very useful: https://devcenter.heroku.com/articles/dyno-metadata
Hmm, apparently the defines weren't the only thing preventing my devtools from working.
I'm currently using (js/require "ardoq-sheet-load/build/npm/shadow.cljs.devtools.client.browser")
to load the devtools while my module is embedded in our main app. This worked previously, but appears to no longer be enough/correct?
@mel.collins if you are using project.clj or deps.edn then it is likely you just have a version conflict on the closure compiler/library releases
should be
[com.google.javascript/closure-compiler-unshaded "v20191027"]
[org.clojure/google-closure-library "0.0-20191016-6ae1f72f"]
[org.clojure/google-closure-library-third-party "0.0-20191016-6ae1f72f"]
@thheller tried adding those versions explicitly, and it didn't change either of the issues I'm experiencing. 😞
For the defines issue, I can see in the browser console that $CLJS.CLOSURE_DEFINES
contains myproject.core.EMBEDDED_DEV: true
, but returning the value from a function within myproject.core
returns false
. 😕
To the devtools not working, I can see $CLJS.shadow.cljs.devtools.client.browser
contains a bunch of functions and whatnot, so I guess it's being imported in some capacity, but none of the functionality is evident. Could the websocket be failing to connect silently? Not sure how to debug that. 😕
Hm. 2.8.68
is the most recent version where either of them work for me. Suggestions for fixing/debugging welcome, but otherwise I guess I'm going to have to stay on that release until I have more time/priority to investigate upgrading further. 😞
@mel.collins which version did you try? 2.8.77
should definitely work everything before .76 may have had a problem
.69 was the version that bumped the closure compiler/library so I'm fairly certain that is your issue
besides upgrading? haven't had any reports about that for a while now? which version are you on?
@thheller I was just testing :loader-mode :script and it works for WebWorker but source maps then don't work for the main code.
:output-dir "resources/public/js/compiled"
:asset-path "/js/compiled"
It does display the error in a readable form, but when I click at a cljs file, Chrome opens the corresponding js files (and it states in the top that source maps are available, but it does not use them for whatever reason)
and when I set :loader-mode to default, everything works fine