This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-01
Channels
- # aleph (1)
- # architecture (7)
- # aws (1)
- # beginners (52)
- # boot (3)
- # cider (27)
- # cljs-dev (9)
- # cljsrn (16)
- # clojure (82)
- # clojure-dev (75)
- # clojure-italy (14)
- # clojure-nl (11)
- # clojure-spec (10)
- # clojure-uk (31)
- # clojurescript (49)
- # core-async (13)
- # datascript (11)
- # datomic (15)
- # duct (11)
- # emacs (8)
- # fulcro (46)
- # heroku (2)
- # jobs-discuss (27)
- # jobs_rus (1)
- # juxt (25)
- # keechma (1)
- # off-topic (59)
- # om (2)
- # pedestal (4)
- # portkey (113)
- # portland-or (1)
- # re-frame (14)
- # reagent (11)
- # shadow-cljs (278)
- # vim (2)
- # yada (2)
✌️:skin-tone-6: Hi Everyone, I made this with ClojureScript and Clojure, check it out! https://news.ycombinator.com/item?id=16964170 https://nonforum.com/
Looks like you are using :optimizations :none
for clojurescript build. Please consider to switch to :optimizations :advanced
) With that option enabled all your js resources will be in one minified file instead of multiple not optimized chunks
Hmmm... thanks for the suggestion. Out of curiosity, how were you able to tell? Just general latency?
The delay gave me the first clue and I also looked at network tab in Chrome Dev Tools
Cool. I have changed it, and subsequent reloads are very fast. Thanks for the help. 😃
So println
can print cljs structures, but not javascript objects.. and the opposite goes for console.log
@ramblurr install cljs-devtools and use console.log
Hi everyone, does anyone know of any resources that explain how self-hosted cljs handles macros using, importing, defining...? thanks!
@fj.abanses The nice summary is that there is intended to really be no difference. The primary inherent difference is that macros have to be compilable as ClojureScript.
thanks @mfikes. ( and thanks for helping around so much)
I am Trying to get a clear mental image of the 3 ( clj,cls, bootstrapped) and their differences.
So when compiling regular cljs I have access to cljs.env/*compiler*
dynamic var where i can see the options passed to the compiler...
so ... can i access the corresponding var in the bootstrapped environment? or am i getting this wrong?
I am writing a browser repl for UI composition and, taking a queue form devcards and this macro https://github.com/bhauman/devcards/blob/ae6d1a459b91cfbccb4594c0e6970b2de289a4b3/src/devcards/core.clj#L133 ,
I am exploring making test writing more visual and immediate,and still keep tests compatible with cljs.test test suites/runners.
Yes, you can access cljs.env/*compiler*
in self-hosted ClojureScript. In fact, you can access it at runtime.
you are right, (.log js/console cljs.env/*compiler*)
in my browser repl gets me the atom, thanks
stupid question maybe but is there an equivalent of (is (thrown? java.lang.AssertionError)..
for Clojurescript?
to check if some assertions are raised in tests?
assertions seems to be raised as #object[Error Error: Assert failed: false]
not quite clear to me what I can match on from that error
Does lein cljsbuild once
affect CSS in any way? I have a weird problem where I get a misplaced loading symbol when viewing my app in a browser, after building the app with lein uberjar
(I've added cljs-hooks). If I run lein cljsbuild once min
, the styling issue goes away. Can anyone give some tips ?
i was checking the source of cljs.core/number?
and it seems to return (cljs.core/number? x)
. how does this work?
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L241
@dpsutton the cljs.core/number? refers to this macro: https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L989
See this for a bit more info http://blog.fikesfarm.com/posts/2015-12-12-clojurescript-macro-functions.html
was hoping there was a protocol i could use. thanks so much. i really appreciate your writing to make things more approachable
Is it possible to define Closure type annotations for clojure functions (from core, third-party libraries or my own namespaces) in externs files? For example:
/**
* @externs
*/
var cljs = {};
cljs.core = {};
/**
* @param {number} value
* @return {number}
*/
cljs.core.inc = function (value) {};
This doesn't work, so I'm trying to figure out whether it's generally not possible or I'm just missing something.Are Javascript modules supported in 1.10.238? A hello-world example from the docs works for 1.9.x but throws errors for 1.10.238. https://clojurescript.org/guides/javascript-modules
node main.js
return module$home$neo$git$cljs$hello_modules$src$js$hello.sayHello();
^
TypeError: module$home$neo$git$cljs$hello_modules$src$js$hello.sayHello is not a function
at Function.hello_modules.core._main.cljs$core$IFn$_invoke$arity$variadic (/home/neo/git/cljs/hello-modules/out/hello_modules/core.js:28:60)
at hello_modules$core$_main (/home/neo/git/cljs/hello-modules/out/hello_modules/core.js:24:33)
at Object.cljs$core$apply_to [as apply_to] (/home/neo/git/cljs/hello-modules/out/cljs/core.js:12944:81)
at Function.cljs.core.apply.cljs$core$IFn$_invoke$arity$2 (/home/neo/git/cljs/hello-modules/out/cljs/core.js:13388:18)
at cljs$core$apply (/home/neo/git/cljs/hello-modules/out/cljs/core.js:13346:24)
at Object.<anonymous> (/home/neo/git/cljs/hello-modules/out/AEF573C.js:10:17)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)