Fork me on GitHub
#clojurescript
<
2017-07-15
>
lwhorton00:07:55

is there an idiomatic way to decide if an argument is a fn? there’s fn? but that doesn’t work for multimethods. there’s ifn? but that works on lots of stuff like keywords / maps.. is that is good as it gets?

lwhorton00:07:38

i suppose it is, since who are you as the provider to decide what is and is not a function.. whether it be a keyword accessor or others

qqq00:07:07

Is gorilla-repl the closest Clojure has to ipython notebooks? I feel like jupyter notebooks are "more powerful repls" than most clojure repls I have seen; despite scheme having repl looks long long ago.

jsa-aerial17:07:20

There are actually many of these sort of things. If you like Jupyter, there are at least a couple Clojure kernels for it. For example, https://github.com/roryk/clojupyter.

jsa-aerial17:07:15

I kind of like gorilla myself, though it needs more in the graphics area. I worked on improving that (it is just Vega, which makes the connection to D3 features nice), but didn't have enough free cycles to make it pollished...

jsa-aerial17:07:46

Actually, combining gyptis with gorilla renderer might be a good way to go - it is much stronger than base gorilla plotting. Actually, the right way to go about this probably would be to take gyptis and reagent/re-frame and just make a real state of the art SPA notebook...

qqq23:07:36

it's not so much the plotting that interest me

qqq23:07:44

but changing my dev cycle

qqq23:07:55

this may be a real contender to emacs

jsa-aerial14:07:13

Jupyter Clojure or ?? Notebooks are kind of nice - a bit like 'literate' programming. WRT something like emacs, I haven't seen any with the level of editor/ide support you get with things like emacs. Maybe protorepl could be used for that piece?

Oleh K.08:07:10

I can not require moment from npm-depth: $moment is not a function. Clojurescript 1.9.671 `(ns horago.screens.drawer.profile.profile (:require [moment])) (fn [date] (dispatch [:user (assoc @user :dob (.format (moment date) server-df) )]))`

Oleh K.08:07:59

Could be it's just a react native issue

Oleh K.08:07:41

but I don't understand how it can differ from simple cljs dependencies which just works

Oleh K.08:07:13

I've tried lein prod-build and all is working! Seems like it is a figwheel issue

Oleh K.08:07:00

I use [lein-figwheel "0.5.11"]

ajs09:07:34

I have an Om 0.8.7 project. It's running on a much older version of cljs. I want to upgrade cljs to at least 1.7+. For some reason, the act of doing this only, without touching the Om dependency, throws lots of React errors like

Uncaught Error: Invariant Violation: receiveComponent(...): Can only update a mounted component.
I also tried upgrading Om to 0.9.0 with no difference there. When upgrading to Om 1.0, I get a different error:
Uncaught ReferenceError: ReactDOM is not defined
Any guidance is appreciated so I can at a minimum use a recent version of cljs with my standard Om Now codebase.

akiroz09:07:45

those look like react errors.. react is constantly introducing breaking changes so it's a bit of a pain to upgrade. have you tried doing the standard lein clean & rebuild stuff? @ajs

akiroz09:07:15

If it doesn't work, try lein deps :tree to see if any other lib is causing dependency conflicts (the order of deps in your project.clj matters)

Oleh K.10:07:50

Sorry, these files are not empty, they have namespaces

ajs10:07:08

i did indeed find an obscure item in my deps that was depending on an older version of Om, which causes the wrong React to load. Still trying to fix. In general, should I expect that my Om 0.8.7 code base should run under Om 1.0.0 ? I use only the om.dom and om.core namespaces, which I think I have read are compatible with 1.0.0

henshinger12:07:03

Hi guys, is there a good example for react native with expo using clojurescript with routing? I cloned this repo(https://github.com/vikeri/re-navigate), but nothing happens when I press the button. Is there a better example I could look at? Thanks

vikeri18:07:01

henshinger: This is not using expo, check out this repo for expo: https://github.com/seantempesta/expo-cljs-template

vikeri18:07:14

If it doesn’t work without expo either, please file an issue

Drew Verlee12:07:24

Why doesn't hiccup allow for seqs as part of it's dsl? I find it some what of burden to always have vectors.

metametadata12:07:37

@drewverlee at least in Reagent flavour of Hiccup sequences have a special meaning: their elements are turned into child React components. There's a nice explanation at https://presumably.de/reagent-mysteries-part-1-vectors-and-sequences.html

metametadata12:07:03

and it looks like the same logic is applied to seqs in the original Hiccup lib:

user=> (html [:ul
               (for [x (range 1 4)]
                 [:li x])])
"<ul><li>1</li><li>2</li><li>3</li></ul>"

Drew Verlee12:07:25

Is that why list comperhesions are so popular in hiccup? I was looking at some example code and it tended that direction

metametadata12:07:52

I'm not sure I understand the question

Drew Verlee13:07:26

Meaning, it seems easier to construct the HTML using a list comperhensions because they keep things as vectors.

ajs14:07:39

The function "into" is a common idiom to keep things as vectors

dasibre14:07:21

trying to use garden css with my project; with re-frame, reframe template creates a clj and cljs dir.. the clj dir contains the css.clj, can garden css use a css.cljs file

akiroz18:07:45

No, that wouldn't work because garden is compiled to CSS using a separate clojure (java) process.

m3tti19:07:01

damn reagent is awesome

m3tti19:07:49

i have to use react at work and against reagent it feels like pain in the as

roklenarcic19:07:40

I have tried to use two bootstrap component wrappers and both seem to be using om.tools, and with the latest cljs, om.tools seems to fail with nullpointerexception when compiling

roklenarcic19:07:52

Neither of these compile for a hello-world type of app with latest cljs and latest om

roklenarcic19:07:03

due to om-tools

roklenarcic19:07:14

does anyone else have this same problem?

roklenarcic20:07:59

I'm just looking for a component library to use with my om project

roklenarcic20:07:29

Material-UI has the unwanted proprety of generating style directly on each DOM element

roklenarcic20:07:54

creating much bloat and condemning any CSS efforts to '!important' spam

roklenarcic20:07:23

does anyone have a good component library they use

roklenarcic20:07:48

@mobileink is there a cljs wrapper for it?

roklenarcic20:07:00

hm polymer seems to be more than just a component library

mobileink21:07:08

roklenarcic: definitely just a comppnent lib, or rather framework, maybe. but it does extend the standards, for example the data binding stuff. stiil, that's built on the standards.

rgdelato21:07:19

I've heard people say good things about semantic-ui, though haven't used it myself

mobileink21:07:22

@roklenarcic that's actually kind of a ticky question. i've wriiten https://miraj-project.github.io, which you could call a wrapper, but that's not the only way to do it. main point is webcomponents are very useful (poke around in https://www.webcomponents.org). but i've only just started thinking how to integrate them with reactish components. i see no reason why they should not work very well together, but i have no details yet.

roklenarcic21:07:28

I've used MaterialUI wrapper but I'm not satisfied with its styling characteristics

roklenarcic21:07:39

and it's not very pretty

roklenarcic21:07:11

the fact that it will spit out a massive style attribute on every element in a list is just terrible

mobileink21:07:46

that's a design thing. webcomponents are a completely different ball 'o wax.

roklenarcic21:07:58

I know that's just design

robert-stuttaford21:07:03

highly recommend http://bulma.io if you’re looking for easy styles without any Javascript opinions mixed in

robert-stuttaford21:07:55

i looked for a long time and never liked material / semantic because you had to accept their js. bulma was such a breeze by comparison

roklenarcic21:07:24

I'm basically looking for 2 things: styling and possibly some basic animation (like handling list item being collapsed/expanded without having to actually write that as om state atom property)

mobileink21:07:32

@roklenarcic e.g. the polymer paper components implement material design. but other componemts do not, so you choose.