Fork me on GitHub
#clojurescript
<
2016-10-16
>
gtrak00:10:28

I'm having trouble getting transit to work on the cljs 1.8 and 1.9 and rhino repl, I get this error trying to read a json string, is this a known issue?:

org.mozilla.javascript.EcmaError: TypeError: Cannot call property call in object [JavaPackage com.cognitect.transit.reader]. It is not a function, it is "object". (rhino.clj#41)

gtrak00:10:02

seems to work fine in the browser

shaun-mahood01:10:08

@netchkin: I use Windows for clojurescript all the time with Reagent. How are you trying to run your program?

netchkin09:10:59

@shaun-mahood: I have followed this guide: http://blog.testdouble.com/posts/2016-01-21-isomorphic-clojurescript.html and created this related issue: https://github.com/testdouble/feedback/issues/22 I compile the code with lein cljsbuild once server, then use node [path]/server.js to run it

lxsameer10:10:57

hey guys, What do you suggest for testing clojurescript code ? I'm looking something simple and elegant, something like minitest for ruby

anmonteiro10:10:06

@lxsameer I think the current “standard” is to use cljs.test

anmonteiro10:10:38

I’m not familiar with Ruby at all, though, I don’t know what minitest is

lxsameer10:10:48

thanks buddy, what aboud doc generator @anmonteiro

anmonteiro10:10:18

a documentation generation library for ClojureScript apps / libraries?

lxsameer10:10:59

for a library containing both cljs and clj

anmonteiro10:10:39

which is more general but also contains a documentation generator

lxsameer10:10:10

thanks, I'm using codeina but it seems i can't force it to use both :clojure and :clojurescript readers

anmonteiro10:10:36

I’ve only ever used codox so I can’t help you there

lxsameer10:10:38

thanks for the handful information 🙂

lxsameer10:10:14

@anmonteiro what about codax ? how can i configure it to support both clj and cljs in the same project ?

anmonteiro10:10:11

never tried it, sorry

sattvik13:10:51

@anmonteiro It doesn’t help you now, but I am working on a documentation generator that will handle hybrid clj/cljs projects. I started working on it principally because I want to generate documentation for Dash, but it should be usable as a more general doc generator, as well.

dnolen14:10:10

@gtrak there could be bug in Rhino - there’s lots of little weird things that don’t work in that environment with respect to JS

dnolen14:10:49

@gtrak if you can hunt down the cause I could consider a fix to transit, but it’s not a priority enough for me to spend any time on finding the cause myself

dnolen14:10:39

@netchkin your error seems truncated, but it seems pretty clear that it can’t load some file

dnolen14:10:22

@nfisher did you try a simpler example like just following the guide first?

dnolen14:10:00

@nfisher to your other question - unknown - more people need to try the feature - I’m sure there are bugs

dnolen14:10:27

fortunately there are several people actively contributing to ClojureScript willing to see those issues get squashed, so try stuff and report

gtrak14:10:43

@dnolen thanks! I might look into it.

nfisher15:10:54

Ok cool thanks I’ll try to recreate a minimal test case. Currently in dependency fun-time…

netchkin16:10:07

@dnolen: actually, the error itself is the full output from console. The eact seems strange (of course it should be react). In combination with apparently incorrect path joining (C:\dev\my\testingcljs\reag2\demo\resourcespublicjsserver-side, obviously should have been C:\dev\my\testingcljs\reag2\demo\resources\publicjs\server-side), I think something in the compile or run process does not deal well with windows "\" path separator...

nfisher18:10:22

@dnolen got it working. I was expecting it to be name spaced. After reading this doc https://github.com/clojure/clojurescript/wiki/Dependencies I noticed that require can sometimes drop :foreign-libs in the js/ global namespace rather than the :provides

nfisher18:10:06

Got a working example here using :foreign-libs and lein: https://github.com/nfisher/cljs-foreign-libs

netchkin18:10:05

@shaun-mahood & @dnolen: thanks for helping me so far, guys. I have noticed that when cljs compiles to js, probably part of this stuff in reagent: (ns reagent.impl.util (:require [cljsjs.react] [reagent.debug :refer-macros [dbg log warn]] [reagent.interop :refer-macros [$ $!]] [clojure.string :as string])) gets compiled as this in js: cljs.core.load_file("resources\public\js\server-side\react.inc.js"); the \r in react gets then interpreted as carriage return character, which is the root of the problem...

shaun-mahood18:10:15

@netchkin: It's probably worth looking at it again, clojurescript and reagent both work very well with windows and shouldn't have any problem with any of the path seperators or line endings. The error message may not be helpful, but the issue is almosy guaranteed to be in your code and not the compiler or libraries.

shaun-mahood18:10:53

@netchkin: if you can post your full code somewhere I can take a look and see if I can find any issues.

netchkin18:10:03

@shaun-mahood: interesting, I'll try to take a look again, then... I was just starting to blame leiningen 🙂

netchkin18:10:19

@shaun-mahood: of course, just a sec

shaun-mahood19:10:43

@netchkin: ok thanks, I'll try and look at it this afternoon

mathpunk20:10:12

I'm making my first fullstack React application in cljs. I'm trying to get a page to pull data from my server, then stick it in a datascript db to build views against. But I can't seem to get my transact! function to run.

mathpunk20:10:25

if anyone has a moment to take a look, I'd greatly appreciate it. I'm stuck.

mathpunk20:10:56

I thought it might be a problem with asynchrony; yet, the transact function is in a handler given to the AJAX call which I thought meant it would only run once the call had completed. idk

mathpunk20:10:35

note: currently there's a state atom in addition to the datascript db; that's what i'm aiming to replace