This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-16
Channels
- # 100-days-of-code (1)
- # announcements (1)
- # beginners (93)
- # boot (46)
- # cider (40)
- # cljdoc (4)
- # cljs-dev (7)
- # clojure (78)
- # clojure-conj (12)
- # clojure-dev (17)
- # clojure-italy (5)
- # clojure-nl (10)
- # clojure-spec (34)
- # clojure-uk (36)
- # clojurescript (56)
- # code-reviews (6)
- # core-async (31)
- # cursive (12)
- # datascript (9)
- # datomic (19)
- # devops (2)
- # editors (3)
- # emacs (6)
- # events (2)
- # figwheel (1)
- # figwheel-main (11)
- # fulcro (59)
- # graphql (10)
- # hyperfiddle (3)
- # keechma (5)
- # leiningen (26)
- # luminus (1)
- # nrepl (5)
- # re-frame (5)
- # reitit (10)
- # shadow-cljs (64)
- # spacemacs (29)
- # tools-deps (6)
- # uncomplicate (8)
- # vim (2)
- # yada (4)
@thheller after I bumped I'm getting a ton of these:
[:failed-to-compare "^2.2.5" "2.2.6" #error {
:cause nil
:via
[{:type java.lang.NullPointerException
:message nil
:at [shadow.cljs.devtools.server.npm_deps$make_engine invokeStatic "npm_deps.clj" 20]}]
:trace
[[shadow.cljs.devtools.server.npm_deps$make_engine invokeStatic "npm_deps.clj" 20]
[shadow.cljs.devtools.server.npm_deps$make_engine invoke "npm_deps.clj" 11]
[shadow.cljs.devtools.server.npm_deps$fn__18305$fn__18306 invoke "npm_deps.clj" 27]
[clojure.lang.Delay deref "Delay.java" 42]
[clojure.core$deref invokeStatic "core.clj" 2312]
[clojure.core$deref invoke "core.clj" 2298]
[shadow.cljs.devtools.server.npm_deps$fn__18305$fn__18308 invoke "npm_deps.clj" 33]
[shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_ invokeStatic "npm_deps.clj" 163]
[shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_ invoke "npm_deps.clj" 157]
[shadow.cljs.devtools.server.npm_deps$main$fn__18389 invoke "npm_deps.clj" 179]
[clojure.core$complement$fn__5391 invoke "core.clj" 1433]
[clojure.core$filter$fn__5614 invoke "core.clj" 2813]
[clojure.lang.LazySeq sval "LazySeq.java" 40]
[clojure.lang.LazySeq seq "LazySeq.java" 49]
[clojure.lang.RT seq "RT.java" 528]
[clojure.core$seq__5124 invokeStatic "core.clj" 137]
[clojure.core$seq__5124 invoke "core.clj" 137]
[shadow.cljs.devtools.server.npm_deps$main invokeStatic "npm_deps.clj" 181]
[shadow.cljs.devtools.server.npm_deps$main invoke "npm_deps.clj" 172]
[shadow.cljs.devtools.cli$main invokeStatic "cli.clj" 162]
[shadow.cljs.devtools.cli$main doInvoke "cli.clj" 153]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
the compilation still works, but that's making the console unusable
@wilkerlucio hmm odd. should be fixed in 2.6.12
I've been reading https://github.com/thheller/shadow-cljs/issues/238 but cannot figure out a way to require the go macro from cljs.core.async
I get
File: jar:file:/home/hukka/.m2/repository/thheller/shadow-cljs/2.4.21/shadow-cljs-2.4.21.jar!/shadow/cljs/devtools/client/hud.cljs:1:1
--------------------------------------------------------------------------------
1 | (ns shadow.cljs.devtools.client.hud
-------^------------------------------------------------------------------------
Invalid :refer, var cljs.core.async/go does not exist
--------------------------------------------------------------------------------
2 | (:require
3 | [shadow.dom :as dom]
4 | [shadow.xhr :as xhr]
5 | [shadow.animate :as anim]
--------------------------------------------------------------------------------
no matter what kind of requires I use in my code@tomi.hukkalainen_slac you have an old incompatible core.async
version in your classpath
I hadn't realized that <!! is not available on cljs, so I couldn't do the quick hack I needed anyway 😞 But thanks again for the lightning fast help. I wouldn't have guessed the problem from that error and my googling wasn't good enough
@thheller fix confirmed, thanks!
If I
1. start MY_ENV=foo shadow-cljs server
,
2. connect via nrepl and compile a node-script
build,
3. start the script with MY_ENV=bar node out/my-script.js
,
4. connect a node-repl,
then (.-MY_ENV js/process.env)
has the value foo
. How come? I’d expect bar
.
I have an :npm-module
project that's being yarn install
ed from a git repo by a website, and so runs shadow-cljs release npm
in the package.json
postinstall hook.
Unfortunately the module uses Reagent, which needs (but doesn't explicitly depend on) other packages, so shadow-cljs apparently doesn't have some namespaces (for example, create-react-class
) available at this point.
The dependencies are installed by yarn, but in the main website's node_modules
, which I guess isn't accessible to each individual package's postinstall command.
Are there any good/recommended ways of making such packages available when the project is installed as a dependency?
I'm currently looking at ways to just distribute the transpiled javascript instead, but I might just be missing something, so advice is welcome.
Hi. Is there a way to get the access to the data from shadow-cljs.edn in my cljs files?
@mel.collins never use shadow-cljs
in a postinstall
hook, thats just way too slow. instead you do the release
and just publish the compiled files instead
@thheller E.g. TinyMCE has an option to explicitly provide it with the paths to themes and skins that it downloads when it's used for the first time.
not sure what you'd want to do with that? it only contains the files generated by the compiler
Maybe my logic is a bit convoluted, yeah. Right now, I use a build hook to copy all relevant files from node_modules
to :asset-path
, and then use the copied files either as arguments to TinyMCE or somewhere in index.html
(e.g. CSS files).
OR just discover it dynamically by looking for the script
tag in the DOM and taking its src
attribute
Would it make sense to add an access to shadow-cljs.edn
via some marco that just inlines all requested values?
you already copied the files yourself. assume for a second that you copied them somewhere NOT in :asset-path
I would have to write this other path in:
1. Some cljs files that use them (currently an issue with :asset-path
as well)
2. In index.html
(not an issue with :asset-path
since the server can just read the EDN and inline all values in the HTML template)
3. In nginx.conf
(not an issue since this file is being generated from different files, including the EDN)
Of course, for (1) I could use the same thing as in (2) or (3), but it would become much more convoluted than it is now, and also it would probably lose some integration with IDE since I would have to use some kind of templating.
Another solution would be to read the EDN with some Lein plugin (I also use project.clj). I think something like that can be achieved since there's already lein-environ
plugin that does something similar.
say in webpack you can require("./some-path/some.png")
and it'll return the path to that file
or is it just a bunch of files with a specific naming convention where the entire folder needs to be copied?
the compiler would only copy the path you actually asked for but could maybe support wildcards
the problem with having a macro access the config is cache invalidation since the code must be recompiled if the values change
It's both. CSS are used in just the way you described, with require
. That is, in JS. In CLJS, I just include the relevant CSS files in index.html
and copy them from node_modules/something
to :asset-path
.
And some things, like TinyMCE require a user to supply a bunch of files with a specific naming convention. So in this case, I just copy the whole folder from node_modules/tinymce
to :asset-path
and then pass the configured path (mapped in nginx.conf) to tinymce.init
.
> the problem with having a macro access the config is cache invalidation since the code must be recompiled if the values change
Ahhh, that's right. I remember having this issue with lein-environ
. Thanks for making me aware of that.
Would the option with goog-define
that you've suggested solve it? If so, could you please describe it a bit more? I have no clue on how one would link it with shadow-cljs.edn
.
you don't "link" it. you create (ns your.config) (goog-define asset-path "/foo")
and in the config :closure-defines {your.config/asset-path "/bar"}
Ah, so I will have to repeat the value of :asset-path
- in :asset-path
itself and in :closure-defines
?
since you decide what the asset path is when you include the <script src="/something/foo.js">
development builds just need to know the path since they dynamically load more code later (eg. hot-reload)
@thheller upgraded to 2.6.12 and randomly got an exception and now seems stuck/hanging: https://gist.github.com/kanwei/fee660eb1cdeb22934402cd5ee8ef2ed
The HUD seems to regularly malfunction on me when I’m working with errors like this:
#error {:message
"Invalid symbol: cloj … lang.ExceptionInfo:."
, :data {:type :reader-exception, :ex-kind :reader-error}}
shadow$cljs$devtools$client$env$process_ws_msg @ env.cljs:151
(anonymous) @ browser.cljs:343
I’ve been seeing this for some time. sometimes HUD works, but often it just spins and I have to look in the console to understand the error