This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-17
Channels
- # announcements (11)
- # beginners (29)
- # calva (2)
- # clara (12)
- # cljsjs (1)
- # cljsrn (7)
- # clojure (39)
- # clojure-europe (6)
- # clojure-nl (7)
- # clojure-spec (6)
- # clojure-sweden (1)
- # clojure-uk (15)
- # clojuredesign-podcast (6)
- # code-reviews (2)
- # conjure (29)
- # cursive (3)
- # datomic (13)
- # duct (15)
- # emacs (1)
- # figwheel-main (2)
- # fulcro (7)
- # graalvm (16)
- # lambdaisland (4)
- # luminus (1)
- # meander (15)
- # observability (15)
- # off-topic (27)
- # parinfer (7)
- # pathom (2)
- # reitit (2)
- # rum (11)
- # shadow-cljs (57)
- # spacemacs (6)
- # sql (56)
- # tools-deps (36)
- # xtdb (3)
How can I run shadow watch app on my local IP instead of localhost? I want to test my app on mobile
@hoertlehner people have reported that this happens when the output files are on the classpath? did you upgrade the JDK version? that would explain the nashorn warning?
@thheller Might this constant recompile issue happen also due to the bundle being in a resource path?
@somedude314 it should be available on your local IP automatically?
Ah you are right, thanks. I didn’t think that was the case because the console says “localhost”
When i run shadow-cljs watch app
s i get a warning about shadow cljs devtools not being able to locate refactor nrepl:
[2020-07-17 09:22:55.580 - WARNING] :shadow.cljs.devtools.server.nrepl/middleware-fail - {:sym refactor-nrepl.middleware/wrap-refactor}
FileNotFoundException Could not locate refactor_nrepl/middleware__init.class, refactor_nrepl/middleware.clj or refactor_nrepl/middleware.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
clojure.lang.RT.load (RT.java:462)
clojure.lang.RT.load (RT.java:424)
clojure.core/load/fn--6839 (core.clj:6126)
clojure.core/load (core.clj:6125)
clojure.core/load (core.clj:6109)
clojure.core/load-one (core.clj:5908)
clojure.core/load-one (core.clj:5903)
clojure.core/load-lib/fn--6780 (core.clj:5948)
clojure.core/load-lib (core.clj:5947)
clojure.core/load-lib (core.clj:5928)
clojure.core/apply (core.clj:667)
clojure.core/load-libs (core.clj:5985)
I'm not sure what to do. Should i be including refactor nrepl middlware? I can make a minimal project if that would help debug this. Many thanks on any hints.you have configured that middleware somewhere. shadow-cljs does not use it. well maybe cider-nrepl or whatever configures it? I don't really know.
all the default nrepl locations apply, not sure what they are exactly. I think .nrepl.edn
in your project and somewhere else
➜ Cabotage git:(master) ✗ cat ~/.nrepl/nrepl.edn {:middleware [refactor-nrepl.middleware/wrap-refactor]} Many thanks. This is likely it. i had no idea this existed. I must say, its sometimes overwhelming all the places dependencies can be set.
Is it possible for shadow-cljs to generate full externs file like that tool does? http://jmmk.github.io/javascript-externs-generator/
I would like to generate externs for react-jss to provide cljsjs.react-jss package as a backward compatibility for people who will not use the new :target :bundle option. Seems that the generator I've linked is unable to produce externs for https://github.com/FieryCod/cljs-react-jss/blob/master/resources/cljsjs/react-jss.js. Thought that maybe shadow-cljs is able to do it.
unless users of your library also use react-jss
directly and don't use your stuff your library already uses.
I would rather allow the users to consume react-jss directly
you can also write the more "modern" CLJSJS style. you are writing the bad old style.
Ok guide me master.
What the "modern" means?
no clue how it works exactly but you can configure :foreign-libs
to "provide" react-jss
so (:require ["react-jss" :as x])
works regardless of using CLJSJS or shadow-cljs or bundle
like this I guess https://github.com/cljsjs/packages/blob/master/react/build.boot#L43-L57
@thheller I think that this line allows the same: https://github.com/FieryCod/cljs-react-jss/blob/master/build.boot#L32
the issue II meant is this https://github.com/FieryCod/cljs-react-jss/blob/master/src/main/css_cljs/core.cljs#L6
and using the global via js/
https://github.com/FieryCod/cljs-react-jss/blob/master/src/main/css_cljs/core.cljs#L19
so it seems you already have this setup correctly https://github.com/FieryCod/cljs-react-jss/blob/master/build.boot#L30
like reagent https://github.com/reagent-project/reagent/blob/master/src/reagent/dom.cljs#L2 it doesn't use any js/
globals anymore because the compiler does that automatically when using cljsjs
Ok got it! You're right I can simply use ["react-jss" :as react-jss]
and compatibility will be preserved.
It seems that I do not have to provide cljsjs.react-jss namespace as well. Am I right?
Thank you @thheller! You are awesome!
I assume this warning means ill need to supply a type hint:
17 | (let [x @loadable]
18 | (when-some [modules (.-modules loadable)]
-----------------------------------------------^--------------------------------
Cannot infer target type in expression (. loadable -modules)
Will there be more then that?Shadow is giving me a warning that it cannot infer the target type. My assumption is that i have to tell it the type, is that correct?
makes sense. ill think about if i want i need to do more later
https://shadow-cljs.github.io/docs/UsersGuide.html#compiler-options It says it should be true by default or i'm i reading that wrong
awesome. as always thanks for the help @thheller
I'm trying to write a build-hook that adds some preloads. The build-hook runs on the :configure
stage and adds the preload like this:
(update-in build-state [:devtools :preloads] conj 'my.preload.namespace)
Is it possible to do this?