This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-22
Channels
- # announcements (9)
- # beginners (96)
- # calva (14)
- # cider (49)
- # clj-kondo (29)
- # cljsrn (5)
- # clojure (55)
- # clojure-dev (37)
- # clojure-europe (4)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-spec (5)
- # clojure-switzerland (3)
- # clojure-uk (5)
- # clojurescript (172)
- # cursive (14)
- # datomic (3)
- # duct (1)
- # emacs (6)
- # fulcro (17)
- # jobs (1)
- # leiningen (6)
- # nrepl (11)
- # off-topic (26)
- # pedestal (2)
- # re-frame (20)
- # reagent (9)
- # remote-jobs (3)
- # shadow-cljs (67)
- # spacemacs (24)
- # specter (6)
- # test-check (3)
- # tools-deps (18)
hey, guys. I use clojurescript to call some javascript
library function, but this will make this
in the called function invalid. Is it relative to the compiler? @thheller
why not (.thatFn obj arg1 arg2)
? whats the point of getting the fn off the object first?
(.-fn obj)
will get the function, so the first way doesn't matter, I have verified it.
Hi everyone. I'm trying to learn clojurescript to create an AWS lambda, but I'm having trouble getting a REPL working in emacs/spacemacs. I create REPL via cider-jack-in-clojurescript and see
[nREPL] Starting server via npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.1 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.22.0-beta11 server
. After Select ClojureScript REPL type: node
, I see [nREPL] Direct connection to localhost:37269 established
, but I get an error Unhandled java.lang.AssertionError Assert failed: (keyword? repl-env)
. I'm using version 2.8.51, node 10.16.3, and spacemacs [email protected]
My shadow-cljs-edn:
{:source-paths ["src"]
:dependencies []
:builds {:app {:target :node-library
:exports {:handler test.main/handler}
:output-dir "target"
:output-to "target/main.js"}}}
You need to add the dependencies to cider as well
And you also need piggieback
This is how I got it working
I have cider-nrepl and piggieback installed. The repl seems to work if I choose custom
and do (shadow/watch :app) (shadow/node-repl :app)
Is there a way to print out the deps.cljs
:npm-deps
dependency tree ?
Hi, I'm having trouble with a react-native project, expo is trying to connect to the wrong websocket because it is getting the wrong lan ip. How can I override the ip being used?
@superstructor no. there is no tree. its a flat map but you can use npm list
or so after they are installed
ok thanks, but is there a way to see what jar/deps.cljs each dependency comes from ?
you can do this
(->> (ClassLoader/getSystemResources "deps.cljs")
(enumeration-seq))
:thumbsup: Thanks. Is this something you'd be interested in being part of the shadow-cljs command line or is it better for me to add it to something like lein-shadow
(i.e. build tool problem) ?
in shadow-cljs package.json
is the source of truth. deps.cljs stuff is only added if it is not already in package.json
So for example in re-frame-10x
there are some important transitive deps: https://github.com/Day8/re-frame-10x/blob/master/src/deps.cljs
Then I have some other closed-source libs that also add transitive deps.
So my thinking was it would just be good to see where these deps came from.
Like, if you wanted to update one and not duplicate it in the current project.
It's not urgent, so have a think about it. If you think its not the responsibility of shadow-cljs itself I'm happy to add it to lein-shadow.
you could create a function that does that and run it via shadow-cljs run some.util/show-npm-deps
doesn't need anything special from shadow-cljs so it would work with other tools too
Yeah could do the same with lein plugin. :thumbsup:
My issue is probably related to https://github.com/thheller/shadow-cljs/issues/482
https://shadow-cljs.github.io/docs/UsersGuide.html#repl-trouble-react-native has the solution
we have a module that represents one namespace, we're pulling a function from a npm package - it works fine on the dev environment but once we build the app we have this error Uncaught ReferenceError: $jscomp is not defined
when calling toAscii
build target is browser so maybe it's just because we dont' have the latest version of shadow ? (ping @UCK2PHQ59 )
yeah it seems to be when calling that
with --pseudo-names i get this
the namehashed
fn is this one
how come we don't have this error when not lazy loading this namespace/module?
the :compiler-options {:output-feature-set :es6}
worked!
Hi!
Updating shadow-cljs from 2.8.39
to 2.8.45
(or .51
) is unfortunately breaking our REPL setup on the final NPM build of our project. We checked for the usual culprits but nothing did the trick except reverting to 2.8.39.
This is an :npm-module
that's being consumed by a Webpack project. From JS we have
window.CLOSURE_BASE_PATH = '/javascripts' // Should match our assets location
require('cljs/shadow.cljs.devtools.client.browser')
After the update, the REPL connects as usual but apparently cljs.core
isn't loaded:
cljs.user> 3
3
cljs.user> (first [1 2])
ReferenceError: cljs is not defined
at eval (eval at shadow$cljs$devtools$client$browser$global_eval (webpack-internal:///./build/cljs/shadow.cljs.devtools.client.browser.js), <anonymous>:1:1)
at eval (<anonymous>)
at Object.shadow$cljs$devtools$client$browser$global_eval [as global_eval] (webpack-internal:///./build/cljs/shadow.cljs.devtools.client.browser.js:878:16)
at eval (webpack-internal:///./build/cljs/shadow.cljs.devtools.client.browser.js:887:44)
[...]
Is there something else we could try?
Thanks!hmm that is probably caused by the introduction of the global-eval
fn. https://github.com/thheller/shadow-cljs/commit/1470c6d2d06195d01ba2b486ef6f730c36b51840
hmm not sure what to do about the. I introduced the global-eval
to fix another issue
you could try copying the current browser.cljs
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/client/browser.cljs and just replacing the #(global-eval ..
with (js/eval ...
seems weird this doesn't work though. I thought I ensured the npm-modules properly exports to global
too tired to think about that now. if you open an issue I'll take a look over the weekend
https://github.com/thheller/shadow-cljs/issues/550
Please let me know if you need anything else.
(Testing the global-eval
substitution is still queued up, trying to find a breach on the schedule)
Thanks again!