This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-18
Channels
- # announcements (1)
- # babashka (15)
- # beginners (152)
- # calva (28)
- # circleci (1)
- # clj-kondo (24)
- # cljsrn (8)
- # clojure (137)
- # clojure-berlin (3)
- # clojure-czech (2)
- # clojure-dev (20)
- # clojure-europe (69)
- # clojure-finland (5)
- # clojure-france (3)
- # clojure-italy (11)
- # clojure-my (1)
- # clojure-nl (4)
- # clojure-uk (15)
- # clojuredesign-podcast (1)
- # clojurescript (13)
- # conjure (15)
- # cursive (13)
- # datomic (41)
- # deps-new (50)
- # events (1)
- # fulcro (9)
- # graalvm (27)
- # joker (2)
- # kaocha (11)
- # off-topic (22)
- # pathom (48)
- # rdf (6)
- # reagent (25)
- # reitit (47)
- # reveal (10)
- # ring-swagger (1)
- # rum (4)
- # sci (27)
- # shadow-cljs (73)
- # tools-deps (49)
- # vrac (2)
- # xtdb (4)
any places to look when running with a release build, I get undefined is not an object (evaluating 'Z4.$l')
but it works just fine when running dev builds?
Issues with externs. Likely whatever Z4
was before, it shouldn't have been renamed.
Or you have something different happening in the release build so that Z4
is a genuine variable that has a value of undefined
.
@benny turn on externs inference if it isn't on (wasn't the default as of very recently) https://shadow-cljs.github.io/docs/UsersGuide.html#externs
Is it possible to not start nrepl server when using shadow.cljs.devtools.server/start?
Is there some gotchas when hot-reloading a namespace that uses macros? Trying to use clara-rules defrule macro and every time I save the namespace shadow complains about undeclared vars, which are functions defined in the namespace and originally compiled fine
(ns notifications.notifications
(:require [clara.rules :as clara])
(:require-macros [clara.macros :refer [defrule defsession]]))
(defsession session 'notifications.notifications
:fact-type-fn :type)
(defn testz [user-id]
{[:user/id user-id] [:user/id]})
(defrule follow
"A rule which isd fired on every follow"
[:context [env] (= ?env env)]
[:follow [{followed-id :followed/id user-id :user/id}]
(= ?followed-id followed-id)
(= ?user-id user-id)]
=>
(testz ?user-id))
(defn handle-event [env event]
(-> session
(clara/insert (merge env {:type :context})
event)
(clara/fire-rules)))
so could be likely that it also doesn't play well with incremental compilation at all
yeah it looks like it's something like that because rules that are deleted keep throwing undeclared-var compilation errors
Hi, I'm wondering how to manage subproject through shadow-cljs. My situation is the following: I want to create a main project on a private repository and this project should use an "embedded" subproject which is public and should remain public. Both on them will use shadow-cljs.edn as build configuration file. Is there a convenient way to embed a subproject with shadow-cljs?
well you can just add :sources-paths ["src/main" "../that-subproject/src/main"]
if its just about source paths
interesting even after completely disable the cache the initial compilation works then I get undeclared variables 😕
@yenda diid you restart the shadow-cljs process? as I said the library keeps some CLJ side state that isn't part of any shadow-cljs cache or so you could reset
you might also need ^:dev/always
on the ns https://shadow-cljs.github.io/docs/UsersGuide.html#_lifecycle_hooks
OK, thank you @thheller, always reactive, always amazing ! Yes, I can manage this with the classpath, but I don't want to duplicate the dependencies of the subproject in the main project. I'll try the deps.edn approach, thank again
Hi, I am just getting into clj/cljs dev. Is there a way to only use the shadow-cljs commandline tool for managing all deps (clj and cljs)? Or are deps.edn and/or lein always needed for the backend(clj) side?
@slack1781 as far as I know, shadow-cljs is dedicated to clojurescript project, or javascript aspect of a project.
So I have a shadow-cljs project, and I want to disable CORS (i.e. inject permissive CORS headers) for the shadow-cljs watch
command. How can I make this happen?
FWIW I thought the :push-state/headers
key as described in the docs (https://shadow-cljs.github.io/docs/UsersGuide.html#dev-http) seems promising for this, but adding it doesn’t seem to have any effect
Maybe I’m putting it in the wrong place?
Nevermind, I figured it out 🙂
how can I set environment vars for development vs prod. I am reading this section of the docs (https://shadow-cljs.github.io/docs/UsersGuide.html#shadow-env), but I am used to starting shadow with Cider, so I am not even sure how I set the env vars there.
I just want to point the api endpoint to somewhere else, so it's something quite trivial
{...
:builds
{:app
{:target :browser
...
:modules {:app {:entries []}}
;; to enable in development only
:dev {:closure-defines { true}}
;; to enable always
:closure-defines { true}
;; you may also enable it for release as well
:release {:closure-defines { true}}
}}
you could use :dev
and :release
to use hardcoded versions. or start shadow from the command line and then cider-connect-cljs to the already running instance with easily set env varsyou could also call (setenv VARIABLE VALUE)
. make a function that does this and then calls cider-jack-in-cljs and you might be good if you really wan to stay in emacs
Awesome, thanks
for work i use
(cider-connect-cljs (list :host "localhost"
:port 7888
:cljs-repl-type 'figwheel-connected
'project-dir "~/projects/aclaimant/acl"))
in a function. you could adjust that as needed with a call to set-envHas anyone seen npx shadow-cljs watch :main
running forever? Like so:
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.33s)
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.33s)
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.49s)
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.49s)
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.39s)
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.35s)
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.33s)
[:main] Compiling ...
[:main] Build completed. (286 files, 2 compiled, 0 warnings, 0.34s)
... (forever) ...
And if I delete the compiled folder, and restart the watch, the problem resolves ... weird
@thheller But isn't that usually the case? for example, I usually use "resources/public/js" as the output directory, but "resources" is usually one of the source-paths
yes, but that is filtered. the filter is very basic so it may not properly filter all the stuff
I thought I fixed most cases but maybe I didn't. not saying that this is the cause of your problem. just a guess.