This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-09
Channels
- # announcements (1)
- # atlanta-clojurians (1)
- # beginners (198)
- # calva (4)
- # cider (16)
- # clara (8)
- # cljs-dev (14)
- # cljsrn (4)
- # clojure (204)
- # clojure-europe (3)
- # clojure-gamedev (2)
- # clojure-italy (8)
- # clojure-nl (17)
- # clojure-poland (3)
- # clojure-russia (20)
- # clojure-spec (32)
- # clojure-uk (45)
- # clojurescript (59)
- # community-development (1)
- # core-async (25)
- # cursive (20)
- # datomic (47)
- # emacs (7)
- # fulcro (8)
- # iot (1)
- # iotivity (2)
- # jobs (1)
- # jobs-discuss (8)
- # juxt (11)
- # luminus (5)
- # nrepl (4)
- # off-topic (136)
- # onyx (24)
- # other-lisps (1)
- # parinfer (74)
- # pedestal (1)
- # planck (3)
- # portkey (67)
- # random (1)
- # re-frame (28)
- # reagent (11)
- # reitit (9)
- # remote-jobs (3)
- # ring-swagger (2)
- # rum (3)
- # shadow-cljs (96)
- # slack-help (3)
- # spacemacs (6)
- # tools-deps (3)
- # unrepl (1)
- # vim (4)
I'm trying to use antizer library in clojurescript (https://priornix.github.io/antizer ) . When I run my build, I get The required namespace "cljsjs.antd" is not available, it was required by "brickmarket/ui.cljs".
My deps.edn includes
cljsjs/antd {:mvn/version "3.12.0-0"}
antizer {:mvn/version "0.3.1"}
any guess what i'm doing wrong?i've tried running npm install cljsjs/antd
but npm fails to install it.
once you’ve done that, you’ll need to create your own cljsjs.antd
namespace that exposes antd. See https://shadow-cljs.github.io/docs/UsersGuide.html#cljsjs
Thanks!
i always get this message in chrome console shadow-cljs: reloading code but no :after-load hooks are configured!
although I have put :devtools {:before-load cljs.dev/stop :after-load cljs.dev/start}
in my :builds profile
do not use namespaces starting with cljs.
. they are reserved for CLJS itself. the hooks are not allowed in cljs.*
I'm seeing intermittent issues when building a release, where it will fail with the error:
IllegalStateException: could not find where to put constant for module goog.labs.useragent.engine.js
shadow.build.closure.ReplaceCLJSConstants.process (ReplaceCLJSConstants.java:60)
...
Any suggestions for what kind of thing should I be looking for to track down what might be triggering this?it seems to have started occurring in a commit where I split some code out into its own file, with no other changes 😕
@mel.collins that is odd? do you have :depends-on
configured correctly?
we're just using a single module at the moment, so we don't have any :depends-on configured
yeah, I had an oversized myapp.views.main, and split out a bunch of the views into their own namespace
IllegalStateException: could not find where to put constant for module
this should only happen when :modules
are setup incorrectly. can't explain how it would happen otherwise.
do you have the correct closure-compiler
version? yes if using shadow-cljs.end, maybe not if using deps/lein
hmm, if I remove the .shadow-cljs
cache dir the build works once, but then fails on subsequent attempts
not that we've written anyway. I'm not sure about deps, but the deps didn't change when it started to break
hmm I have no idea how it would even be confused about goog.labs.useragent.engine.js
it doesn't make sense that is only work once as the input to the compiler will be identical to the first one when caching is used
hah, well it took its time falling over, since the config has been like that for months! Something about a camel's back 😄
but we've another branch with the same happening for goog.dom.dom.js
, even after with the :entries
fix
yeah, I just checked out a commit prior to the deps.edn change, and it's still complaining about goog.dom.dom.js
. But this is after :modules
has been removed!
the heck? This branch is complaining about goog.labs.useragent.engine.js
again. Same IllegalStateException, yeah.
This branch
. are you sure this branch has the updated build config? if you have a server instance running it may still be using an older version too?
yeah, I rebased on the updated config, and triple-checked that it was the right shadow-cljs.edn. No server instance running either.
huh, the first time I build I get IllegalStateException: could not find where to put constant for module goog.dom.dom.js
, but subsequent times I get the same error but for goog.labs.useragent.engine.js
again.
I'm not sure what is happening. I've never seen that error in :npm-module
builds before.
if you can please send me the contents of the .shadow-cljs/builds/<your-build>/release
directory. its all the cache files and generated JS. maybe I can find something?
I'm still investigating right now, but I'll zip and send you some stuff after lunch if I don't find anything
make sure you are on the correct directory on the correct machine. wouldn't be the first time that someone was debugging something locally but actually executing something via an ssh connection on a totally different machine 😉
okay, so this was unexpected.
It seems the mere presence of an :options
keyword in any view function is the trigger, even if the function isn't used.
right now
(defn secondary-config-mappings
[]
{:options nil})
triggers the error, but
defn secondary-config-mappings
[]
{:optionss nil})
does not. The function is not used anywhere in the code.on second thought, that might be also related to keywords, since the only occurrences in this code was from deconstructing maps
@mel.collins yeah the files would help. I cannot reproduce this in any way. build config would also help just in case there is something misconfigured
Does shadow not detect changes to macros for live-reload / compile purposes? Or do we have something configured incorrectly? Just saw a case where we made a change to a macro, saved, nothing kicked off by shadow, changed a line outside of macro and saved, and it behaved normally.
Hmmm okay. That at least gives us the “Okay something is wrong there” flag. haha. Thanks
Right… I need to read about them a bit more to understand, I think.
Would it change anything that it’s a macro from a library? a Spec macro in this case.
And we only changed how we called it, not the macro itself, I was mistaken before
What is the recommended strategy for developing locally on both client (browser) and server code with shadow? Does it make sense to have two completely separate clj projects? Should I spin up my server project's REPL, start the system, etc....and then configure my client project's :proxy-url
to point at the local server? Or maybe it's more appropriate to configure the client's :http-handler
to reference the server's main handler fn? This would suggest that the client/server projects are one monolith, or that the client project depends on the server project somehow.
Just trying to get a feel for what others have been doing...
I would separated a few source folders, start with shared
, server
, client
, so most of the code goes in shared, and in the others only specific code that calls to specific host features (like node FS or browser fetch, etc...)
then in a single project, have one build for each case (client/server)
That makes sense, and should be pretty straightforward with tools.deps and :local/root
. What about "integration" between client/server though? I think what I'm confused about is how do I replace the shadow development server with my own server? Is the :http-handler
setting the preferred approach?
those don't collide with each other, the shadow http is for pure cljs cases, what you gonna do is implement you own on the Node side (using express or whatever), then you run your server separated, maybe there is a way to hook on the shadow one, but I believe that would give you more headaches to deploy
@cjsauer I just put all the code in one repo and have multiple builds. easiest to share code that way
@thheller @wilkerlucio thank you, I think I've got it working now :thumbsup: