Fork me on GitHub
#clojurescript
<
2018-12-05
>
ichernetsky03:12:01

Got it. Thank you for the clarification, @dnolen

sree08:12:31

Hi Folks, Can I use Clojure for writing a library that can easily (read without glue code) be used by an Android app?

danielstockton09:12:06

Is there a compiler option to specify assets with an absolute path with :optimizations :none? (goog/deps etc..) I want a development build that I can serve on a different URL

cheatex13:12:38

Shouldn't CLJS DevTools also apply formatters in the react tools extension? Do we have a way to present cljs's data well in react tools?

darwin13:12:59

@cheatex If you mean this[1] then I think you would have to fork it and implement support there by hand, I think they display stuff with their own custom code [1] https://github.com/facebook/react-devtools

darwin13:12:39

I did just a brief look and they have a bunch of react components rendering their views, they do not (and technically cannot) defer rendering of js values to devtools https://github.com/facebook/react-devtools/blob/master/frontend/PropVal.js#L54

darwin13:12:26

also they want their code to be portable between chrome and firefox, so this makes sense even if it was possible to re-use internal devtools console rendering machinery

darwin13:12:04

ah, you might want to subscribe to this issue: https://github.com/facebook/react-devtools/issues/989 I think it could be technically possible to implement custom formatters, but it is quite some work. React devtools would have to inspect page’s javascript context for custom formatters, and learn how to render JsonML if present

✔️ 1
Whiskas13:12:50

Anyone here knows what is this? :

Whiskas13:12:17

it is happening on a brand new lein new reagent project

darwin13:12:22

looks like you are using java 11, I’m not sure if everything is updated to play well

darwin13:12:27

see java -version

Whiskas14:12:00

yeap, it’s java 11

Whiskas14:12:22

what is the current version of it ?

darwin14:12:11

well, it looks like you are loading cider and bunch of other dependencies, it depends when that code was last updated

darwin14:12:18

most stuff should work with java 8

Whiskas14:12:38

alright, i will try to overwrite java 11 with java 8

Whiskas14:12:46

do you know an easy way to do this in MacOs?

dpsutton14:12:32

is it strange to see clojure.core.incubator?

dpsutton14:12:37

this seems largely abandoned?

darwin14:12:06

if you are on a mac, this could help in your .bash_profile export JAVA_HOME=$(/usr/libexec/java_home -v 11)

darwin14:12:26

this is how I switch between various java versions depending on project I want to work on

darwin14:12:40

of course replace 11 for 8, or whatever

darwin14:12:16

I prefer to install direnv via homebrew and go from there

Whiskas14:12:37

I simply cannot understand how on earth i’m getting these errors .-.

Whiskas14:12:00

yesterday i was able to make a lein new reagent project to work fine with cider when i added the dependencies on a :repl profile

darwin14:12:04

didn’t you tweak ~/.lein/profiles.clj?

Whiskas14:12:00

i tested some stuff on profiles.clj but then i deleted it again

johnj16:12:01

@dannyfreeman lol

lispers-anonymous16:12:36

He will be missed 🙏

Whiskas16:12:14

any info about this error? It looks like it is an error on Piggieback

Whiskas16:12:14

any info about this error? It looks like it is an error on Piggieback

lispers-anonymous16:12:05

I’d start by making sure your parens are balanced and that there aren’t any weird symbols that the reader doesn’t expect. Perhaps an opening or closing paren was commented out? Would have to see the code

Whiskas16:12:59

the error is being generated when i run a leinegan template + cider on profiles.clj

Whiskas16:12:11

i think it’s something related to piggieback

Whiskas16:12:17

but i don’t know

ClashTheBunny16:12:32

You could post the file or form you're trying to eval...

ClashTheBunny16:12:43

It would be easier to figure out.

Whiskas16:12:21

i will zip the project, since i made it with

lein new re-frame +10x +routes +test +re-com
and updated the version of some dependencies by using
lein ancient
, and i also have a repl profile to use piggieback on ~/.lein/ . i will zip everything

dpsutton16:12:57

don't zip it. no one will look at it

dpsutton16:12:03

do you have a repl up and running at all?

dpsutton16:12:21

then it is not a piggieback issue

dpsutton16:12:24

piggieback is working

dpsutton16:12:31

if you can evaluate forms like (+ 1 1)

dpsutton16:12:00

how did you trigger that error?

Whiskas16:12:33

i ran

lein repl
then i ran this command:
(require '[figwheel-sidecar.repl-api :as figwheel])(figwheel/start-figwheel!)(figwheel/cljs-repl))  
to start fighweel

Whiskas17:12:05

things seems to be working, i’m just curious about this error message because it’s not good to ignore them

dpsutton17:12:34

there are unbalanced parens in that form which is what the error message is saying

👍 1
Whiskas17:12:09

ooh, i just realized it now when i posted, hah

Whiskas17:12:20

everything is working nicely now

borkdude19:12:12

I am trying to do something like this:

(eval (list 'resolve '+))
while requiring cljs.js. The reason I’m using eval is that I want to resolve a function while the symbol is not known at compile time.

borkdude19:12:20

but this doesn’t work (yet). any pointers?

dustingetz21:12:59

@borkdude eval in cljs is not so simple, what function exactly are you calling when you say eval

dustingetz21:12:14

cljs.js/eval ?

borkdude21:12:41

I want to resolve a symbol to a function. Now I do it like this:

(defn sym->fn [sym]
  #?(:cljs
     (let [ns (munge (namespace sym))
           nm (munge (name sym))]
       (gobject/get (js/eval ns) nm))
     :clj (resolve sym)))
which seems to work, since the symbol I’m using is already fully qualified

borkdude21:12:48

I might have to fall back to self-hosted eval because of some other stuff

dustingetz21:12:49

(aget js/window "x") ?

borkdude21:12:17

yeah that would also work instead of js/eval, thanks

borkdude21:12:35

unless I’m not in a browser…

dustingetz21:12:05

you can use js/global for node, if that wasnt clear

mseddon21:12:37

Is there a reliable, and perhaps even idiomatic way to detect a production build within a macro (so I can for e.g. elide various dev-mode asserts etc?)

mseddon21:12:12

oh. duh. goog.DEBUG, excuse me.

thheller22:12:30

@borkdude you will not be able to look up things by name in :advanced optimized builds. in unoptimized builds you can just use (js/goog.getObjectByName "some.ns.foo")

lwhorton00:12:37

might be able to get away with it if you ^:export the ns though. also, shameless plug: https://lwhorton.github.io/2018/10/20/clojurescript-interop-with-javascript.html

borkdude22:12:03

@thheller yeah, I’m aware of that. my project won’t work with advanced anyway, so that should be good

borkdude22:12:16

@thheller very cool, thanks!