Fork me on GitHub
#clojurescript
<
2018-09-28
>
priornix02:09:38

Hi for cljsjs packaging, which is the recommended syntax? (deps-cljsjs :provides...) or (deps-cljsjs :foreign-libs [{:provides...}])

priornix02:09:05

And I see both syntax being used in cljsjs/react

Digital Baboon08:09:30

Hey! Do any of you have a "listen to pushState" tutorial by any chance saved somewhere? Would love a link. Examples I've tried thus far lead to no avail.

ingesol08:09:07

@im Off the top of my head, you could look at implementations of pushy and accountant. They are very limited in scope and not too hard to read. https://github.com/kibu-australia/pushy https://github.com/venantius/accountant

👍 4
Digital Baboon08:09:42

@ingesol pushy works like a charm. Made it work with secretary. Thank you!

👍 4
Pieter Koornhof12:09:28

Does anyone know about a 2d vector math lib for clojurescript. There are many js ones but all of them do the state mutation dance

Digital Baboon14:09:27

Hi! Consider this code that I have, which fires login-action on click, how can I get a hold of the email and password within login-action?

Digital Baboon14:09:23

I figured it out! I simply :onChange #(set-email %) and then (defn set-email [event] (js/console.log (-> event .-target .-value)))

bhurlow15:09:29

is there a standard way of creating a commonjs module from a cljs namespace using cljs.main?

bhurlow15:09:49

I'd like to use a few compiled cljs functions from a node javascript project

ana15:09:23

hi, a basic question - i'm getting an error when trying to require hiccup in a cljs file and then doing lein figwheel: No such namespace: hiccup.core, could not locate hiccup/core.cljs, hiccup/core.cljc, or JavaScript source providing "hiccup.core" - is there any way around this? i am very new to cljs so think i'm just missing something basic on how to use clj libraries in cljs.

bhurlow15:09:06

@atmalagon are you using deps.edn or lein?

ana15:09:18

hi @bhurlow! i'm using lein

bhurlow15:09:45

is hiccup in :dependencies in your project.clj?

ana15:09:38

ah yes, good point; i've got [hiccup "1.0.5"] in my :dependencies and ran lein deps before doing lein figwheel, and if i try requiring hiccup in a lein repl, everything seems to import without error

👍 4
heefoo19:09:49

As far as i know hiccup provides some macros. You might need to :require-macros for some hiccup functionality with cljs. Clj doesn't need to require macros explicitely

walterb23:09:00

hiccup is a clojure library and can not be used from clojurescript - there is a hiccup/core.clj but no hiccup/core.cljs

walterb23:09:20

@atmalagon a clojurescript alternative is goog.dom in the google closure library for generating html. If you are using react, there is https://github.com/r0man/sablono, uses hiccup style data and react to render html from clojurescript. Reagent also uses hiccup style data and react.

aisamu22:09:58

https://github.com/jeluard/hipo is also pretty nice ( plain html with reconciliation!) (@atmalagon)