This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-28
Channels
- # babashka (10)
- # beginners (140)
- # cider (6)
- # clj-kondo (10)
- # cljs-dev (39)
- # cljsrn (6)
- # clojars (1)
- # clojure (23)
- # clojure-europe (2)
- # clojure-spec (7)
- # clojure-uk (6)
- # clojurescript (1)
- # conjure (16)
- # cursive (3)
- # datomic (3)
- # emacs (6)
- # fulcro (13)
- # graalvm (3)
- # malli (8)
- # meander (4)
- # off-topic (43)
- # pathom (1)
- # pedestal (15)
- # re-frame (13)
- # reagent (3)
- # sci (25)
- # shadow-cljs (26)
- # sql (9)
- # testing (34)
- # tools-deps (80)
im thinking i must have botched a dependency version or something somewhere along the line, but just upgraded to [email protected]
with:
{:deps {:aliases [:cljs]}
:builds {:browser {:target :browser ,,,}}}
and i cant seem to figure out why this is happening:
$ shadow-cljs watch browser
...
CompilerException Unexpected error macroexpanding if-ns at (cider/piggieback.clj:22:1). #:clojure.error{:phase :macroexpansion, :line 22, :column 1, :source "cider/piggieback.clj", :symbol if-ns}
...
Caused by:
NoSuchFieldError ES3
is this looking familiar to anyone? i imagine i need to update piggieback
or something like that, but i havent been able to crack it...it seems pinning the com.google.javascript/closure-compiler-unshaded
version to the same version in the shadow-cljs/deps.edn
file eliminates that issue, but fails the build with:
[:browser] Build failure:
RuntimeException: No such resource: js/es6/util/createtemplatetagfirstarg.js
huh—removing the org.clojure/clojurescript
entry in the deps.edn
(i.e. not setting the clojurescript version explicitly) fixed the rest of the issues. apologies for the noise. will leave in case others stumble
Is there a rule of thumb for what vars to earmark as ^:export ?
my understanding is that you only need to mark vars which you need to call from outside cljs and therefore need a stable and predictable name
so not a rule of thumb. you either have a requirement to mark it as export to be able to know its name or your don't have that requirement
Ohh interesting. Cuz some of my variables are getting munged and "cannot call ab of undefined" and such when I used :advanced So ^:export probably won't help there
I figured it would preserve var names but yeah why would that be a problem if it had them all saved in a table or w/e
ah. i think the recommendation is to use :pseudo-names true
in your compiler options for your build
> You can use shadow-cljs release app --debug to enable both temporarily without touching your config. This is very useful when running into problem with release builds
Hmmm. I still get cannot call undefined.. pardon the Red
:export
you only need for things you are calling by name from the HTML or so. not required for anything else and never fixes any other naming issues.
Ah, if I want to call a function() from the javascript / html side I use :^export
okay I will try with release app --debug
and see
yeah it works with no optimizations, awesome-O, but creates a 2.1 mB file so ... would be nice to shave that down a tad.
shadow-cljs release app --debug
uses advanced optimizations. it sets :pretty-print
and :pseudo-names
to true to help you diagnose problems like these
> :pretty-print and :pseudo-names default to false. You can use shadow-cljs release app --debug to enable both temporarily without touching your config. This is very useful when running into problem with release builds
awesome.. thanks guys... mmm it seems like it comes down to my hydrate code. I wonder if I could post it in code-review