This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-14
Channels
- # announcements (3)
- # aws (7)
- # babashka (108)
- # beginners (222)
- # bristol-clojurians (3)
- # calva (8)
- # chlorine-clover (1)
- # cider (14)
- # clj-kondo (4)
- # cljdoc (6)
- # cljs-dev (89)
- # cljsrn (13)
- # clojars (6)
- # clojure (89)
- # clojure-australia (1)
- # clojure-europe (11)
- # clojure-italy (9)
- # clojure-losangeles (11)
- # clojure-nl (6)
- # clojure-spec (2)
- # clojure-sweden (1)
- # clojure-uk (9)
- # clojurescript (47)
- # conjure (18)
- # datomic (7)
- # docker (1)
- # figwheel (43)
- # figwheel-main (2)
- # fulcro (31)
- # kaocha (3)
- # leiningen (7)
- # luminus (2)
- # nrepl (14)
- # off-topic (24)
- # pathom (5)
- # pedestal (5)
- # rdf (4)
- # re-frame (49)
- # reagent (12)
- # reitit (9)
- # rum (21)
- # shadow-cljs (109)
- # tools-deps (35)
- # vim (8)
- # wasm (1)
We've put out the first early releases of Chui, a new cljs test runner for the browser. Works best with Shadow for now, and integrates nicely with shadow's reloading. If that sounds interesting please do give it a spin and report back in #lambdaisland or #kaocha https://github.com/lambdaisland/chui
Was #?(:shadow/cljs)
ever a thing / How can I do the equivalent of https://clojurescript.org/guides/javascript-modules in a portable (shadow & non-shadow) way?
https://shadow-cljs.github.io/docs/UsersGuide.html#classpath-js okay, I see you're aware of this conflict. So how can I write code which works for both?
One approach that seems to work is using goog.module with the latest versions of ClojureScript.
@dominicm show me what you want to use in CLJS (thats actually working) and I'll make sure it works in shadow-cljs too
but I've never seen the guide you linked lead to something that actually works in practice? š
@thheller https://github.com/Lokeh/helix/blob/fix-figwheel/src/helix/impl/classes.js this doesn't work in shadow
You didn't tell me anything, but you might have told @lilactown. I took his word that it didn't work in shadow, confirming for myself now.
yeah I meant @lilactown
ESM might work differently but should also work. whatever works in standard CLJS should work in shadow-cljs
with the exception of :foreign-libs
meaning actual foreign-libs though, so files that aren't processed just prepended
what classpath-js is referring to is requiring files by their actual filename, even allowing relative-paths. that was rejected from CLJS and won't work there.
Right you are, works perfectly. I'll wait for him to to tell me what particular scenario doesn't work I guess!
@thheller while I'm here, do you still not support providing imports via API (i.e. not via shadow-cljs.edn)?
Ah, looks like shadow-cljs problem was something specific that's now been fixed: https://github.com/thheller/shadow-cljs/issues/638
@dominicm that has always worked? you lose a bunch of features but that has always worked? I can't remember context if we talked about that before?
@thheller we did, you told me that using via api wouldn't be supported as I recall... There was something that errored if you used the api without shadow-cljs.edn file existing containing a particular parameter.
you can't use the official API fns that refer to a build by id and have that load from something other than shadow-cljs.edn. that is true and won't be supported ever.
but you can pass the entire build config instead to the underlying API fns. shadow-cljs does not need to know where it came from?
basically the gist is that (shadow/release :some-id)
will load the build config for :some-id
from shadow-cljs.edn
and call release*
with it
but yeah its not something I recommend doing and if you want to do that as part of some tool moving configuration elsewhere I'll fight you š https://github.com/day8/re-frame-template/issues/128
This is what I want to do, yeah. I already have a config.edn where I can distinguish between dev/prod. I can also read from env, AWS or wherever else in it. I wouldn't be as evil as lein-shadow though, I mostly just want to pass through the user's arguments into shadow. Maybe one or two small tweaks for disabling anything that doesn't make sense in that context (e.g. for figwheel I disable open-url as you don't want that to happen on (reset) & I already have a mechanism for linking to auto-testing if it's enabled.)
but if you want that as part of something your own projects build pipeline you can see this as fully supported
What has higher priority projectās deps.edn
or user-config ~/.shadow-cljs/config.edn
? Iām trying to override dependency specified in projectās deps.edn with shadow user config, but it doesnāt have any effect
if you want more complex things you use clj
directly without going through shadow-cljs
?
Iāve added
{:dependencies
[[cider/cider-nrepl "0.25.0-SNAPSHOT"]]}
to .shadow-cljs/config.edn
assuming it would override cider-nrepl dep from deps.edn
, but itās nothmm bit it might merge in the wrong order too so you probably want to get rid of that in the project deps.edn?
Hey there, looks like there might be a juicy new compilation target for shadow: https://deno.land/v1 š
was just reading about that. doesn't seem useful? no npm support. its value add is native TSC which it calls "unsatisfyingly slow". eventually typechecking needs to happen in Rust but that "will be a massive undertaking and will not happen any time soon"
yeah its meant to fix the issues he talked about here https://www.youtube.com/watch?v=M3BM9TB-8yA
this using urls for deps thing is not sometimes I think will work in practice but we'll see
it provides enough justification so everything can be re-written to make things "better" š
I don't know what the eval
situtation is like for deno so don't know about hot-reload or REPL but creating output that is consumable by it is trivial
hey thheller, re: ^:const
- what did you mean by ādoesnāt do what everyone thinks it doesā ?
Iām seeing this error still using latest shadow-cljs: https://github.com/thheller/shadow-cljs/issues/643
hereās a (not so minimal) repro: https://github.com/Lokeh/helix/tree/shadow-goog-provide
please don't refer to old tickets. that ticket is talking about react-native. you are not doing react-native are you?
https://recoiljs.org/ looks like react-world found re-frame š
yeah the issue is polyfills. CLJS doesn't do any polyfill handling for :none
builds. maybe I should do that too?
nothing? I will figure out how to deal with this ... even if I just bail on polyfills for dev builds like CLJS does
does ābailingā mean you always load them? or donāt transpile to ES5 for dev builds?
don't transpile language features . I'm pretty sure CLJS doesn't, will verify when I have some time
polyfills have been a pain forever so I want to figure this out cleanly once and for all
and right now, doing a release build w/ goog.provides I see no jscomp error. so the polyfills must be loaded in the correct order there
Which sources correctly load polyfills? Is there a workaround where we could force-load the polyfills earlier somehow (maybe via an npm or esm?)
during dev closure-js doesn't handle them correclty (so goog.provide/goog.module on the classpath)
when to choose note-test over browser-test targets? only when the thing to test is not related with a āDOM/Browserā? what if I want to test a re-frame handler?
any suggestions regarding? https://shadow-cljs.github.io/docs/UsersGuide.html#failed-to-load
@wvelezva :browser-test
is currently rather limited and doesn't work great for automated testing env. :node-test
generally works better if you can live without the DOM/browser APIs
thanks @thheller, and karma is only suitable if I'm planning to use continuous integration, right?
hello folks, I hope all is well
I have an issue in windows, just installed clojure and shadow-cljs
this is my package.json
{
"dependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1",
"shadow-cljs": "^2.9.3"
}
}
and this is my deps.edn
{:paths ["src/main" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
com.fulcrologic/fulcro {:mvn/version "3.0.10"}}
:aliases {:dev {:extra-paths ["src/dev"]
:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.742"}
thheller/shadow-cljs {:mvn/version "2.8.107"}
binaryage/devtools {:mvn/version "0.9.10"}}}}}
this is my shadow-cljs.edn too
{:deps {:aliases [:dev]}
:dev-http {8000 "classpath:public"}
:builds {:main {:target :browser
:output-dir "resources/public/js/main"
:asset-path "/js/main"
:modules {:main {:init-fn app.client/init
:entries [app.client]}}
:devtools {:after-load app.client/refresh
:preloads [com.fulcrologic.fulcro.inspect.preload]}}}}
it's giving the message
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate shadow/cljs/cli__init.class, shadow/cljs/cli.clj or shadow/cljs/cli.cljc on classpath.
am I missing something?
oh ok
thanks