Fork me on GitHub
#clojurescript
<
2017-10-12
>
tobowers06:10:41

anyone have protobufs working in cljs?

lovuikeng07:10:19

@tobowers try transit if possible... from @rgm #re-frame "the 7-8 sec CSV parse is now < 1s using JSON Transit. gzipped size of the CSV and Transit are both around 350kb"

tobowers09:10:01

@lovuikeng unfortunately no, need to get protobufs working… for some reason https://www.npmjs.com/package/protobufjs doesn’t go through clojurescripts browserify correctly.

tobowers09:10:27

However… I got protoc from google working because it has google closure require/provide… makes my :libs section ugly though… but works

Bravi11:10:43

can I do something like this in garden?

(defn button-css [colour]
  (g/css [:.btn-colour {:background-color colour
                        :color "white"
                        :cursor "pointer"}]))

Prado13:10:23

For those that have any experience with unit testing, please, check my post at #testing . Thanks!

Petrus Theron14:10:17

Reagent and React Native complaining about:

No such namespace: cljsjs.react, could not locate cljsjs/react.cljs, cljsjs/react.cljc, or JavaScript source providing "cljsjs.react" in file ..boot-expo/zbu/-d8mh6z/main.out/reagent/impl/util.cljs
Been stuck on this for a few hours. Any help would be appreciated. Am I missing a dependency or an exclusion?

lovuikeng14:10:06

check your project file

manutter5114:10:48

I haven’t experienced this personally, but I’ve seen it described as being a dependency conflict

manutter5114:10:39

You can get clues about where the conflict is by running lein deps :tree

manutter5114:10:58

(assuming you’re using lein)

cjsauer15:10:16

I can't for the life of me get the format function to cross-compile. Here is my ns header:

(ns my-ns.validation
  (:require [struct.core :as st]
            #?(:cljs [goog.string :refer [format]])
            #?(:cljs [goog.string.format])))

cjsauer15:10:25

Does anyone have any ideas why this wouldn't work?

cjsauer15:10:41

Getting this in the browser: Uncaught TypeError: Cannot read property 'call' of undefined

cjsauer15:10:03

I used that as my reference, but that's for cljs specifically. I'm trying to port that over to cljc.

cjsauer15:10:39

Hence the :refer [format] portion; I'd like to not have to use gstring/format reader conditionals all over 😕

darwin15:10:31

I barely remember someone worked around it with #?(:cljs (def format gstring/format))

darwin15:10:50

but you have to stick to the original requires from the SO answer

cjsauer15:10:20

@darwin that did the trick. A thousand thanks!! 🎊

colindresj17:10:54

What’s an idiomatic way of doing class MyClass extends BaseClass { ... } in clojurescript?

wpcarro18:10:56

Hey guys. Newcomer to CLJS… I’m using garden and cljss to manage styles, etc, and I’m coming from a Sass background. I’m looking for functions like saturate, lighten, opacify, etc … does anyone have any library recommendations?

wpcarro18:10:50

@selfsame interesting… looks like a bulk of the functionality is in conversions, etc… is that not the case?

selfsame18:10:41

well, if you convert to HSL (Hue Saturation Lightness) you can just alter the values

wpcarro18:10:08

@selfsame true that’s a good call

hkjels20:10:04

@wpcarro garden has a whole lot of color-manipulation functions built-in

wpcarro20:10:40

@hkjels that’s probably that most preferable solution. Thanks for sharing