Fork me on GitHub
#clojurescript
<
2016-01-04
>
yaniv01:01:56

hey all - i’m trying to include some react components i built into a cljs project. i’ve specified the foreign-libs but i’m having some issues. i built the react components with webpack with react listed as an external so as to not bundle in multiple copies of react. when i require the components from my cljs project it complains that react isn’t defined even though i’m using om and should have react in my project. what’s the right way to declare that dependency?

crocket03:01:32

https://github.com/crocket/cljs-npm-template is a leiningen template for developing nodejs programs and npm executables in clojurescript. It became stable yesterday.

easystreet04:01:11

@yaniv: om brings in react via the cljsjs package, so this should solve your issue:

:foreign-libs
  [{:file "resources/js/mywebpackstuff.js"
    :provides  ["my.stuff"]
    :requires ["cljsjs.react"]}]

yaniv04:01:39

thanks @cascada-io i tried that at one point. i’ll put that back. I solved it in the short term by bundling everything including react with the components. however i’m getting undefined when trying to log the components so it’s not importing right

yaniv04:01:27

i’m using the same name as the :provides

atroche04:01:16

is anyone else using prismatic's fnks with reagent?

atroche04:01:29

have you had issues with the way you can put metadata on them?

glenjamin13:01:17

@yaniv: https://github.com/glenjamin/cljs-webpack-deps is an example i’m working on for what you describe - it’ll be part of a blog post at some point, but at the mo it’s just some example code

pat17:01:13

In the absence of extend, does anyone see any problems with clobbering over a default impl-method with specify! ? This seems like a great pattern but I have not seen it

dnolen18:01:22

@pat that’s what it’s there for

pat18:01:34

@dnolen: awesome, this is great

andrewboltachev19:01:18

When I'm trying too (apply .foo js/bar [...]) it gives me Uncaught SyntaxError: Unexpected token . Should I appeal to native JS's apply or what?

jr19:01:07

(apply js/bar.foo should work

andrewboltachev19:01:27

at least I don't see an error. will test the whole thing in a moment, thanks @jr !

misha20:01:44

greetings, gentlemen. which the largest public single-/multiple-page app written in cljs you know of?

misha20:01:31

the one I can share link to (no registration required, etc.)

misha20:01:23

@jr yeah, I tried to find some "action" screenshots there, but could not.

misha20:01:28

I need an actual UI, not the code. Like proof of "there are huge UIs build with cljs out there, look: ..."

misha21:01:26

I am aware of the "huge UI is not necessarily a good thing", etc.

misha21:01:26

@jr that's where I looked for some "forms action", not in their repo simple_smile

borkdude21:01:40

@misha: I've built a user facing app for schools, but it's behind a login, because it's a paid service

misha21:01:17

@borkdude: do you have any screenshots or videos? it does not have to be live UI.

borkdude21:01:30

yes, I've got a video, wait a minute

borkdude21:01:20

it's only in Dutch sorry simple_smile

misha21:01:18

that's fine, thank you, @borkdude

borkdude21:01:14

it's basically a crud app that stores text (questions and answers) and uploads for several roles: admin, teachers and students. The idea is that admin and teachers can create questions that students have to answer and/or upload a file with it and also teacher can track progress

borkdude21:01:06

it could have been built with Ruby on Rails or whatever, but I chose Clojure. The single page aspect wasn't necessary per se, but it seemed much better to me doing it with Reagent than jquery/old fashion style

gdulus22:01:46

hey. does anyone have and example how to get response headers with cljs-ajax library. its kind of black magic

dnolen23:01:16

@gdulus an alternative if you are stuck is just to use Closure XhrIo class directly. It’s decently documented.