This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-21
Channels
- # announcements (6)
- # bangalore-clj (1)
- # beginners (46)
- # cider (21)
- # cljs-dev (30)
- # cljsjs (3)
- # clojure (131)
- # clojure-dev (20)
- # clojure-europe (2)
- # clojure-italy (12)
- # clojure-nl (11)
- # clojure-russia (4)
- # clojure-spec (55)
- # clojure-uk (57)
- # clojurebridge (1)
- # clojured (1)
- # clojurescript (55)
- # cursive (11)
- # data-science (1)
- # datomic (23)
- # duct (1)
- # emacs (1)
- # events (1)
- # figwheel-main (2)
- # fulcro (219)
- # graphql (16)
- # immutant (1)
- # jackdaw (3)
- # java (6)
- # juxt (30)
- # kaocha (8)
- # mount (3)
- # nyc (1)
- # off-topic (16)
- # pathom (48)
- # pedestal (1)
- # re-frame (71)
- # reagent (17)
- # ring-swagger (3)
- # shadow-cljs (96)
- # spacemacs (21)
- # specter (8)
- # speculative (20)
- # sql (21)
- # test-check (2)
- # tools-deps (12)
- # vim (6)
Hello, I have a shadow-cljs project and I run npm alias (`shadow-cljs watch :main :renderer`) for my development workflow. I wanted to add a project.clj and move my dependencies to it (in :profile {:cljs...
so I get a decent intellij + cursive support. I just moved the dependencies to the project file and added :lein {:profile "+cljs"}
in my shadow-cljs.edn. Now i am getting the following exception:
(defproject example-app "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License" :url ""}
:dependencies [
[org.clojure/clojure "1.10.0"]
;[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.520"]
;; Needed for shadowcljs if run using lein
[thheller/shadow-cljs "2.8.7"]
]
:profiles {:cljs
{:dependencies [[reagent "0.8.1"]
[re-frame "0.10.6"]
[clj-commons/secretary "1.2.4"]
[cljs-ajax "0.8.0"]
[day8.re-frame/re-frame-10x "0.3.6-react16"]
[binaryage/devtools "0.9.10"]
]
;:target-path "target/%s"
:source-paths ["src"]}}
)
I tried changing the shadow-cljs version in my project.clj (package.json still has the latest version: 2.8.7) down up to 2.7.7 where it still fails. Then if i use 2.7.6 it works fine
@neupsh that is caused by a dependency conflict. check lein with-profiles +cljs deps :tree
closure versions should be
[com.google.javascript/closure-compiler-unshaded "v20190121"]
[org.clojure/google-closure-library "0.0-20190213-2033d5d9"]
Invalid configuration
-- Spec failed --------------------
{:output-dir ...,
:compiler-options ...,
:build-hooks ...,
:modules ...,
:module-hash-names ...,
:devtools ...,
:build-id ...,
:asset-path "",
^^
:target ...}
should satisfy
non-empty-string?
By why? Why can't I just write /main.js
in my index.html
?the intention is that :output-dir
is a directory dedicated to the output of shadow-cljs
Subdirectory != server path. I can output to a separate directory and still use {:asset-path "."}
.
I can change the spec. It just doesn't fit into my mental modal to put everything at the "root"
For objects that are explicitly required in at the top of the namespace, so they should be available!
did you try shadow-cljs release your-app --pseudo-names
to identify what is missing?
Can reproduce with 2.8.7. And one of my colleagues says it works with release builds. More info incoming...
(sandi.main.view is a transitive require of the module-loaded namespace; it's not required anywhere else at the point when this file is loaded)
sandi.onboarding.view requires sandi.main.view. It's not required anywhere in the shared module.
well it will be neat once I actually come up with a proper design for all this UI stuff 😉
and if I (def x sandi.main.view/content*)
after the requires then I can see it loads with no errors.
So sandi.onboarding.view/content
is being called before sandi.onboarding.view/content*
is loaded.
And I can confirm the on-load
function for that module is called before we try to resolve sandi.onboarding.view/content*
.
Sorry! The code checks that the on-load
is called before trying to resolve view for that module.
module is hash-map. It's used to initialise that module (set state in the app-db etc.). Crucially though, after on-load!
is called a flag is set that allows the view in the module to be resolved.
This stuff has been working well and not been touched in quite a while. That's not to say there's not a latent bug in it!
Uncaught TypeError: Cannot read property 'view' of undefined
at sandi$onboarding$view$content (/dist/cljs-runtime/sandi.onboarding.view.js:16)
at Object.G__95768__1 (cljs.core.js:3993)
at Object.G__95768 [as call] (cljs.core.js:4166)
at reagent.impl.component.js:130
at Object.reagent$impl$component$wrap_render [as wrap_render] (reagent.impl.component.js:153)
at Object.reagent$impl$component$do_render [as do_render] (reagent.impl.component.js:201)
at day8.re_frame_10x.js:105
at Object.reagent$ratom$in_context [as in_context] (reagent.ratom.js:61)
at Object.reagent$ratom$deref_capture [as deref_capture] (reagent.ratom.js:70)
at Object.reagent$ratom$run_in_reaction [as run_in_reaction] (reagent.ratom.js:1485)
Good question. It is used in the project, but I'm pretty sure removing it had no effect.
Well a workaround for now is to (def chrome-72-hack sandi.view.main/content*)
at the top of each module view namespace, and I think I'm right in saying it'll be DCE in release (not that it matters all that much).
why happens if you (js/console.log sandi.view.main/content*)
instead and use it as normal?
it seems that when I compile my cljs for production this call: (.-token js-object)
is munged and doesn't work anymore, is my only choice to use aget
?
I knew you'd reply if I mentioned I would use aget
, your worst enemy
🙂 thank you
@mateus.pimentel.w I wrapped chartjs some time ago https://github.com/JoelSanchez/ventas/blob/master/src/cljs/ventas/components/chart.cljs
@joelsanchez cool, there is a guide to use it?
that wrapper served me well at the time, to draw realtime traffic stats
the code might be a bit bad but you can base yourself off it
chartjs is quite easy