This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-08
Channels
- # 100-days-of-code (1)
- # admin-announcements (1)
- # aleph (1)
- # announcements (9)
- # beginners (125)
- # cider (1)
- # cljs-dev (80)
- # cljsrn (2)
- # clojure (82)
- # clojure-czech (1)
- # clojure-dev (5)
- # clojure-finland (1)
- # clojure-italy (16)
- # clojure-nl (6)
- # clojure-spec (24)
- # clojure-uk (39)
- # clojurescript (35)
- # community-development (49)
- # core-async (3)
- # cursive (31)
- # data-science (17)
- # datomic (21)
- # emacs (5)
- # fulcro (92)
- # graphql (1)
- # jobs (2)
- # lambdaisland (1)
- # leiningen (19)
- # luminus (9)
- # off-topic (21)
- # parinfer (6)
- # pedestal (1)
- # portkey (2)
- # re-frame (12)
- # reagent (8)
- # reitit (4)
- # shadow-cljs (117)
- # spacemacs (5)
- # specter (4)
- # sql (2)
- # testing (2)
- # tools-deps (3)
- # vim (1)
@loganpowell you missed the upgrade message I guess. shadow-cljs 2.7.0 REQUIRES CLJS 1.10.439
@thheller thank you. I was going crazy.
@thheller btw. When I'm using reagent
with npm React
with shadow-cljs
do I need to exclude cljsjs/react
from reagent
dependency and add empty cljsjs/react
ns definitions to the project or it is taken care of automatically?
its taken care of automatically. cljsjs is just ignored and won't be used so besides the extra download it doesn't hurt
only manual thing you need to do currently is npm install react react-dom create-react-class
should be fine without yes. turning on externs inference just in case helps though https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs
@thheller do you have a patreon?
I would like to support your work
Please do, I think others might be happy to help you help them
You may be interested in giving to clojurists together: https://www.clojuriststogether.org/news/q3-2018-funding-announcement/
@thheller hello, I did the upgrade here, I noticed now we are back on logging the warnings every time for third part libraries (before they usually only happened in first compile if I remember right), was this change intended?
but you may be getting new warnings that weren't there before due to the stricter checks regarding symbols with dots
I actually started to get warning on every compile with specter. And pretty weird ones:
------ WARNING #1 --------------------------------------------------------------
File: com/rpl/specter.cljc:1275:19
--------------------------------------------------------------------------------
1272 | ns (namespace structure)]
1273 | (cond (keyword? structure) (keyword ns new-name)
1274 | (symbol? structure) (symbol ns new-name)
1275 | :else (i/throw-illegal "NAME can only be used on symbols or keywords - " structure)
-------------------------^------------------------------------------------------
Use of undeclared Var com.rpl.specter/java
--------------------------------------------------------------------------------
1276 | ))))
1277 |
1278 | (defnav ^{:doc "Navigates to the namespace portion of the keyword or symbol"}
1279 | NAMESPACE
--------------------------------------------------------------------------------
------ WARNING #2 --------------------------------------------------------------
File: com/rpl/specter.cljc:1288:19
--------------------------------------------------------------------------------
1285 | new-ns (next-fn (namespace structure))]
1286 | (cond (keyword? structure) (keyword new-ns name)
1287 | (symbol? structure) (symbol new-ns name)
1288 | :else (i/throw-illegal "NAMESPACE can only be used on symbols or keywords - " structure)
-------------------------^------------------------------------------------------
Use of undeclared Var com.rpl.specter/java
--------------------------------------------------------------------------------
1289 | ))))
1290 |
1291 | (defdynamicnav
1292 | ^{:doc "Adds the result of running select with the given path on the
--------------------------------------------------------------------------------
yeah, I think the initial warning is ok, but I remember we this discussion before about then showing up after the first compile
com.rpl.specter.NAME_transform_STAR_ = (function com$rpl$specter$NAME_transform_STAR_(structure,next_fn){
var new_name = (function (){var G__36732 = cljs.core.name(structure);
return (next_fn.cljs$core$IFn$_invoke$arity$1 ? next_fn.cljs$core$IFn$_invoke$arity$1(G__36732) : next_fn.call(null,G__36732));
})();
var ns = cljs.core.namespace(structure);
if((structure instanceof cljs.core.Keyword)){
return cljs.core.keyword.cljs$core$IFn$_invoke$arity$2(ns,new_name);
} else {
if((structure instanceof cljs.core.Symbol)){
return cljs.core.symbol.cljs$core$IFn$_invoke$arity$2(ns,new_name);
} else {
throw (new java.lang.IllegalArgumentException(com.rpl.specter.impl.smart_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["NAME can only be used on symbols or keywords - ",structure], 0))));
}
}
});
#?(
:clj
(defmacro throw-illegal [& args]
`(throw* IllegalArgumentException ~@args))
I can confirm that I have been some "new" errors from third-party libraries (Specter included)
But I'd rather know now that this won't work in javascript then trying to debug after release 😄
(defun ...
is a third-party library
I barely ever use the .
notation
unless I'm interop'ing with js
but when I look into specter/impl.cljc where the macro is defined, there is cljs
version too:
#?(
:clj
(defmacro throw-illegal [& args]
`(throw* IllegalArgumentException ~@args))
:cljs
(defn throw-illegal [& args]
(throw (js/Error. (apply str args)))))
That might be the issue with defun
as well. It's a macro over the core.match
macro 😄
is it something I'm doing wrong?
btw, I can also confirm that - besides the new error - it looks like AdoptOpenJDK is now working 😉
bye bye Larry Ellison
Don't know if it will help, but here's the log from my repl
23 | (defun.core/defun deploy-census-function
-------^------------------------------------------------------------------------
IllegalArgumentException: Invalid signature "..." should be a list
clojure.core/assert-valid-fdecl/fn--8348 (core.clj:7405)
clojure.core/map/fn--5587 (core.clj:2747)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
sorry, I truncated the code
@loganpowell in the output above I can't see what you did
Cursive (IDEA)
nrepl (remote)
Just the args?
wait, now it's not throwing the error
let me track this down a bit more
could be me making a stupid mistake
let me work on it
don't worry about it... It probably has something to do with all the reorganization of the code I did to get namespaces looking like https://shadow-cljs.github.io/docs/UsersGuide.html#_the_classpath
intellij freaked out
Please let us know when you have the Patreon setup.
In the meantime, just wanted to say that I believe the work you're doing is really important for the future of ClojureScript
The existing tooling is - by far - the biggest barrier for newbs
I think you should rename it to "lumin" instead of "shadow" 😄
it's a joke
it's just so much "easier" than anything else...
"bringing cljs into the light"
anyway, enough gushing... I'll be bach
I am looking for a dataviz library to use with clojurescript. My background is not Javascript so importing and using d3 seems complicated from cljs . The most promising library for my purpose is hanami https://github.com/jsa-aerial/hanami/blob/master/src/cljs/aerial/hanami/core.cljs . Yet loading the ns raises the following error: >conflict on "h-box" by "re-com.box" used by "re-com.core" I think it's to do with cljsjs packages required in the library. It requires:
[cljsjs.vega]
[cljsjs.vega-lite]
[cljsjs.vega-embed]
[cljsjs.vega-tooltip]
as well as:
[re-com.core
:as rcm
:refer [h-box v-box box gap line h-split v-split
button row-button md-icon-button md-circle-icon-button info-button
input-text input-password input-textarea
label title p
single-dropdown
checkbox radio-button slider progress-bar throbber
horizontal-bar-tabs vertical-bar-tabs
modal-panel popover-content-wrapper popover-anchor-wrapper]
:refer-macros [handler-fn]]
[re-com.box
:refer [h-box v-box box gap line flex-child-style]]
[re-com.dropdown
:refer [filter-choices-by-keyword single-dropdown-args-desc]]
[aerial.hanami.utils
:refer [title2 href]]
importing d3
is not complicated at all. just (:require ["d3" :as d3])
and then (d3/whatever ...)
do I not need to add dependencies to the package.json file? is npm install d3
all I need?
I see about the conflicting refers...
I can't seem to get very far with this. is:
(def circle-demo
(
-> d3
(.select "#myCircle")
(.append "svg")
(.attr "r" "30")
(.attr "cx" "50")
(.attr "cy" "50")
(.attr "fill" "grey")
)
)
a valid syntax?
That's with "d3" required as d3hi, shadow-cljs doesn't seem to recognize a new cljs file when it is added in src and doesn't load the file automatically to repl. Is there a way to fix that?
files never get loaded automatically, you have to require it from another file that's already been used, or manually load the file into the REPL (using the load file feature from your editor)
I have a problem in downloading transitive dependencies from deps.cljs
in shadow...it looks like it does not read our custom registry setting in .npmrc
...has anyone tried that?
uhm it looks like shadow is trying to guess, I have just discovered the :managed-by
option 😄
but I don't see where it should go actually