This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-21
Channels
- # admin-announcements (2)
- # aws-lambda (2)
- # beginners (26)
- # boot (179)
- # cider (36)
- # cljs-dev (118)
- # cljsrn (23)
- # clojure (150)
- # clojure-android (1)
- # clojure-austin (7)
- # clojure-austria (3)
- # clojure-canada (1)
- # clojure-dev (7)
- # clojure-dusseldorf (4)
- # clojure-germany (3)
- # clojure-greece (34)
- # clojure-nl (4)
- # clojure-quebec (9)
- # clojure-russia (30)
- # clojure-spec (38)
- # clojure-uk (3)
- # clojurescript (46)
- # clr (1)
- # core-async (2)
- # css (2)
- # cursive (17)
- # datomic (12)
- # devcards (8)
- # dirac (1)
- # docker (2)
- # hoplon (216)
- # jobs (2)
- # kekkonen (1)
- # lein-figwheel (18)
- # leiningen (2)
- # luminus (1)
- # mount (4)
- # off-topic (2)
- # om (15)
- # onyx (1)
- # parinfer (1)
- # pedestal (2)
- # planck (26)
- # reagent (98)
- # spacemacs (6)
- # specter (19)
- # spirituality-ethics (54)
- # untangled (22)
- # vim (24)
- # yada (4)
see https://reagent-project.github.io/news/news050.html for more info
or take https://github.com/anthonyjgrove/react-google-login/blob/master/dist/google-login.js directly
https://github.com/cljsjs/packages - Wiki explains how to work with that
im trying to figure out how to recreate https://developers.google.com/identity/sign-in/web/ in reagent
There are alternatives to Cljsjs if you need to quickly use a JS lib and the extern generator doesn't work. If should be easy to include a JS file in the build with deps.cljs
and you can use Fence to write the interop code: https://github.com/myguidingstar/fence so you don't need the externs
This should help with including foreign JS lib in the Cljs build: https://github.com/clojure/clojurescript/wiki/Packaging-Foreign-Dependencies
@pvinis: :on-mouse-over
there should be a guide for that stuff.. reagent and hiccup and all that stuff are hard just because its a guessing game
@pvinis: Reagent builds on top of React and React build on top of normal DOM: https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onmouseover
@pvinis: kebab-case 🙂
so i have this like https://developers.google.com/identity/sign-in/web/ this suggests
but now i get this WARNING: Wrong number of args (0) passed to test.reagent/handle-google-signin at line 21 src/cljs/test/reagent.cljs
I want to build a component that takes another one as a child and wraps that. Here's what I have now:
(defn wrapper [component]
(r/create-class
{:component-did-mount #(do-something)
:reagent-render (fn [] component)}))
However, that doesn't seem to have quite the same behavior as the original
I'd like to use it as
[wrapper [some-other-component {:some :props})
damn you rookie mistake!!!
So am I right to think that the main reasons people use secretary in reagent SPAs are 1. to give users descriptive URLs, and 2. to make history work? I don't need either of those and am thinking of letting it go and having a render function that derefs a layout atom, and then let all the "routing" happen by state changes to that atom... but I feel like that has to be a mistake, and will lead to disaster in some way I can't now discern! It can't be that simple.. can it?
@gowder: If you don't care at all about URLs, I think it can be that simple.
When trying to render an externally imported pure JS react component (not with cljsjs) I get
Uncaught Error: Assert failed: Invalid tag: ‘’
I’ve read previous discussions here but still can’t figure out the problem. Anyone? (sorry for the noob question)@tomerweller: Some example code of what your currently doing would be helpful
This:
;For the sake of explaining this issue I'm using react-bootstrap (not the cljsjs port)
;I've placed the react-bootstrap package in window["deps"]["react-bootstrap"] with an external <script> tag
(def bootstrap-button (aget js/window "deps" "react-bootstrap" "Button"))
(defn my-app
[]
(let []
(fn []
[:div
[:h1 "my app"]
[:> bootstrap-button {:bpStyle "primary"} "A BUTTON"]])))
(defn ^:export main []
(reagent/render [my-app]
(.getElementById js/document "app")))
results in Uncaught Error: Assert failed: Invalid tag: ‘’
@juhoteperi: I think that’s the gist of it (had to extract from a larger project). Hope it conveys my issue
are you using reagent 6.x?
Yes. that’s with reagent 0.6.0-rc
Do you have more error trace?
Just a sec. it might have been an old version. I did a lein clean
now and getting different errors
I mean invalid tag signifies that the hiccup parsing is not occurring correctly
can you have a hypen in a reagent component name
component name is :>
, bootstrap-button is just a symbol referring to JS var, should be okay
also just verified you can have a hypen
base don the regex in the source
why is my-app wrapped as a fn?
Shit. awkward. I was on an old reagent version.
the let binding is empty..that could be throwing errors
Nah, empty let is fine
well an empty let is fine but [my-app]
would return a fn?
does it handle that fine
my project.clj had the newer version declared and I thought it just updates automatically with build. it didn’t.
render
call? should be correct, it takes in hiccup form which in this case refers to a component
ok well apparently it was build error 😛
just eliminating all possible scenarios
Thanks for the help guys. Sorry for the no-op.
@sbmitchell: your first question about the version nailed it 🙂
@tomerweller: What cljs version are you on? There was some change related to cache invalidation some time ago (few months)
[org.clojure/clojurescript "1.7.170"]
cool @tomerweller good luck into your foray of CLJS I was helping you on reddit as well 😛
@sbmitchell: well appreciated!
I think this might help with cache invalidation after changing deps: 1.7.228: CLJS-1487: Fix handling of timestamp comparison for dependencies in JARs
Good idea. I’ve been using what came with reframe without thinking about it.
Im surprised the re-frame template hasnt upgraded to 1.8
Seems like most of the dependencies are a bit outdated.
@sbmitchell If referring to re-frame-template it uses 1.8 as of this week. @tomerweller aside from reagent, any other deps out of date? Been holding off on upgrading reagent until it is an official release as opposed to alpha or rc ... release has just taken quite a while.
Oh cool @gadfly361 I didn't actually look was basing it off tomers deps. Good to know though
Yeah, i tend to use whatever clojure / clojurescript deps are recommended by bruce in the figwheel readme. Makes it easier to keep figwheel turning lol :)
@gadfly361: I actually started this as a sandbox from the todomovc example, not from the template.
Can I point reagent to a global react instance (pure JS) instead of the react cljsjs package it depends on? (and react-dom, of course)
you can if you exclude those libs in your project.clj
I think you'd have to add a react ns though to make sure it get included first or something along those lines
We had to do something along those lines when MaterialUI was using its own reactJS and we didnt have a workaround at the time
reference?
I found the part about excluding but not sure about fixing the namespace with my own
so in project.clj youll want to do something like [reagent "xxxxx" :exclusions [cljsjs/react cljsjs/react-dom]]
then add a cljsjs folder under src with a single file react.cljs
with (ns cljsjs.react)
so other stuff will work with the react version you want
then just include react in your index.html as you would
I think that will work
Works! 🙂
Simpler than I thought. I forgot that in the end it just picks React from the global context
Thanks a bunch @sbmitchell !
coolio 🙂