Fork me on GitHub
#clojurescript
<
2018-01-29
>
dpsutton19:01:48

i see that omcljs/om has react 16 support but there hasn't been a release since May. is there something preventing a beta-2 release? (current release is 1.0.0-beta1

sova-soars-the-sora21:01:24

this is probably aksed frequently, but, can I make cross-platform native apps wrapping my cljs project in a thing?

sova-soars-the-sora21:01:33

where thing is docker or electron or whatever? (recommendations welcome!)

manutter5121:01:21

You might want to look into react-native, there's cljs libs for that.

pablore21:01:54

Is there any wrapper for http://Socket.io client in clojurescript? If not, how can i make a wrapper for a npm package?

Graham Seyffert21:01:46

I’ve never used it before, but that’s the first one I’d try

pablore22:01:13

wait socket-io and http://socket.io are not the same?

zalky17:01:54

@U7V9HE682, if you haven't already seen it, you might want to check out the sente library. https://github.com/ptaoussanis/sente

pablore18:01:36

Looks great! But I need to connect with an existing socket-io service

Graham Seyffert22:01:43

I believe socket-io is just the cljsjs package for http://socket.io

pablore22:01:16

If I do this on js:

var socket = require('socket.io-client')('');
socket.on('connect', function(){});
socket.on('event', function(data){});
socket.on('disconnect', function(){});
How would I do it on cljs?

pablore22:01:07

(let [socket (js/io.connect "`)]
  (do (.on socket "connect" #())
         (.on socket "event" #())))
??

noisesmith22:01:02

do inside let is redundant btw

Graham Seyffert22:01:06

Haven’t been able to find a cljs wrapper for the socket.io-client JavaScript library, but there is a clj wrapper for the Java library - https://github.com/ejschoen/clj-socketio-client

pablore22:01:05

This is great, but is a Clojure implementation, I need a clojurescript one

Graham Seyffert22:01:44

Yeah I thought you might 😕 At any rate, the cljsjs wrapper for http://socket.io might be helpful in writing your own wrapper for socket.io-client

noisesmith22:01:27

but you can use doto there (doto socket (.on "connect" #()) (.on "event" #()))

xiongtx22:01:10

Is it conventional to put cljs dependencies in the :provided leiningen profile so they’re available at compile-time but are not packaged into the Uberjar?

Graham Seyffert22:01:55

Anyone have a good idea about why trying to resolve a multi-method would work in my cljs repl but not in a .cljc file? Specifically, (methods @(resolve (quote sym))) works in my repl, but throws the following error - Uncaught Error: No protocol method IMultiFn.-methods defined for type cljs.core/Symbol: - when called in a cljc file that doesn’t explicitly :require the namespace that the multi-method lives in. Just to be clear, I have a cljs file that’s calling a function in a cljc file that’s trying to resolve a multi-method defined in another cljc file, but both cljc files are (:require)’d in the cljs file

xiongtx23:01:55

Why would you want to put temporary files used during compilation into the resources dir, as shown in the compiler options page? https://clojurescript.org/reference/compiler-options#output-dir Wouldn’t this include them in the Uberjar, which is unnecessary?