This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-22
Channels
- # admin-announcements (7)
- # beginners (56)
- # boot (69)
- # cider (168)
- # cljs-dev (2)
- # clojure (170)
- # clojure-austin (25)
- # clojure-beijing (3)
- # clojure-belgium (2)
- # clojure-france (3)
- # clojure-poland (17)
- # clojure-russia (115)
- # clojure-uk (40)
- # clojurebridge (3)
- # clojurescript (87)
- # cursive (9)
- # datomic (30)
- # dirac (18)
- # editors (3)
- # emacs (14)
- # hoplon (195)
- # immutant (14)
- # jobs (3)
- # jobs-discuss (4)
- # leiningen (11)
- # melbourne (5)
- # mount (42)
- # off-topic (5)
- # om (24)
- # onyx (48)
- # parinfer (53)
- # proton (1)
- # protorepl (2)
- # re-frame (3)
- # reactive (2)
- # reagent (29)
- # rum (5)
- # spacemacs (4)
- # untangled (91)
- # yada (1)
Hi all! I have a question regarding Leaflet integration. (or maybe any js integration really) I use cljsjs
is that right?
(with-init!
(let [map (.setView (.map js/L "map-bazar") #js [51.505 -0.09] 13)]
(.addTo (.tileLayer js/L "http://{s}."
(clj->js {:attribution "leaflet"
:maxZoom 18}))
map)))
Because the browser displays this :
When I inspect the html from the browser I don't see any css lib
Is it outside cljsjs? Do we need to add it manually?
I don't see any js either
(in the <head> tag)
which I think is normal...
It seems like there is a css problem...
And when I add (link :rel "stylesheet" :href "
to the page, the map just disappear completely...
@micha Thanks for helping. Nope, no change...
the cljsjs package doesn't have any css in it, normal?
no just the source of cljsjs
(sift :move {#"^Leaflet-(.*)/dist/leaflet-src.js" "cljsjs/development/leaflet.inc.js"
#"^Leaflet-(.*)/dist/leaflet.js" "cljsjs/production/leaflet.min.inc.js"
#"^Leaflet-(.*)/dist/leaflet.css" "cljsjs/common/leaflet.inc.css"
#"^Leaflet-(.*)/dist/images/(.*\.png)$" "cljsjs/common/images/$2"})
where can I find leaflet.jar? (sorry)
[cljsjs/leaflet "0.7.7-2"]
so it will be something like ~/.m2/repository/cljsjs/leaflet/0.7.7-2/leaflet-0.7.7-2.jar
yes, it returns cljsjs/common/leaflet.inc.css
so it's there... hmm..
this must be added to my own boot.build right?
arggr.... still the problem
I put the (sift)
just before (hoplon)
in the dev task...
@micha when I look into leaflet repo dist folder I only find css but according to the cljsjs sift, there should also be leaflet.js and leaflet-src.js
ah no... https://github.com/Leaflet/Leaflet/archive/v0.7.7.zip leaves no dougt... there is leaflet.js files
I'm stuck folks, I'll take any suggestions...
Thanks in advance!
If I add this (link :rel "stylesheet" :href "cljsjs/common/leaflet.inc.css")
the map disappears...
I've tried with prior versions of the lib, without success
Ok, I might just do this :
Hammock Driven Development - Rich Hickey - YouTube
Good night!
@leontalbot: i should have some time today to look into your issue, can you make a minimal project in git that i can clone to reproduce the problem?
Thanks
Is it proper english? "Minimal leaflet integration to hoplon"
not sure about the "to"
@dm3: how'd your talk go? any conversions?
@dm3 thanks!
@alandipert: think it went pretty great I'm spreading the "lisp can do it!" mantra
@dm3: awesome!
"what should i do to get out of the way of lisp"
Hoplon was a big part of the presentation, but very little people are doing web dev, even less with clojurescript
that's interesting, in my experience people at meetups tend mostly to do web
I think lots of the concepts in the front end are applicable to the back end, FRP for instance
definitely what i struggle the most with
but at least with hoplon, i can deliver my terrible UIs quickly
also @alandipert you and Micha did a very impressive job with Boot, in terms of growing community
thanks! yeah unlike hoplon boot doesn't really have competition
I’d actually looked at reagent before Hoplon, reagent is nice but what i really liked about Hoplon was the conceptual simplicity and less moving parts
i haven't used any of them for work but if i had to, i would pick reagent for sure
i'm not on top of all developments but the various react things seem to be converging on something strongly resembling the hoplon way
so it's gratifying to know people will eventually be using hoplon whether or not they know it
we should try to be 2x as long as re-frame's
I think one issue is we let outlier companies like Facebook and Google set the pop culture for our industry. Thus Go and React, when in reality most companies / people will not really have those same problems and therefore don’t need a solution in the form of the current tool.
There is a rad section in Coders at Work where Joe Armstrong says people need to look inside the black boxes more often.
i don't really know, but i think it boils down to good old fashion marketing
like in the case of facebook, 4 years ago their OSS was in total shambles
their github was dozens of abandoned and undocumented PHP garbage projects
then they hired an OSS czar, james pearce, and started putting serious people and money behind a few of their top projects, and whipped their github into shape
it seems like it ties into the direction they want to go as a company, to be a platform... to be a platform, you need developer mindshare
the web framework space is so dense, it's hard to imagine being popular without full time marketing people & budget
hehe recruiting is definitely a key OSS effort kickback
has anyone else noticed that using and
& or
in hoplon generates cljs compiler warnings?
@raywillig: are you sure about and
and or
?
something like this Use of undeclared Var ui.component.donate/p1__59179#at line 35ui/component/donate.cljs
i was just hoping that wasn’t some signal that I shouldn’t use them. that would make life really hard
@micha, I'll go eat but stay available through my stack mobile app if you need anything. Thanks again!
@leontalbot: awesome i'm going to lunch too
@micha cool! maybe we are on the same time zone.. Where are you located?
I'm in Quebec City
@leontalbot: Durham, NC
In hoplon client apps, how are y’all handling routes, page locations in URL, etc? Are there any articles/blogs/whatever out there?
this looks interesting, but only one user responded: http://hoplon.discoursehosting.net/t/structuring-a-multi-page-hoplon-application/489
@leontalbot: can i push to your repo?
Yes! You are now a collaborator!
Fantastic!
Can I ask one question?
What is with-let
?
it is for handling side effects
right?
definitely
give a thing a name, do stuff to/with it, then return the thing
cool.
And why a timeout set to 0?
It is the first time I see do-watch
too
This is great btw! Beautiful. And hopefully it can help someone else!
Thanks for your help @micha
You guys are really awesome!
do-watch
is just covering a common case where you have some function f
and you want to both add a watch to some atom/cell that will call f when the atom/cell changes
the set-timeout 0
is pretty much the same as with-init!
in that it will run after hoplon has built the page, but it also works around an issue where with-init!
doesn't run asynchronously when boot-reload reloads code
@micha Excellent, thanks!
@micha I am getting a strange behavior when I drag the map
tiles seem not to want to load. Do you have this?
leaflet.inc.js:9061 Uncaught TypeError: Cannot read property 'removeChild' of null
when I zoom with the mouse wheel...
It's like tile positionning does not update
Should I wrap tiles into a cell?
@micha you are right!
(let [m (.map js/L $e)
t (.tileLayer js/L "http://{s}."
(clj->js {:attribution "with Hoplon"
:maxZoom 18}))]
(-> t (.addTo m))
(.on m "dragend" (fn [e] (.redraw t)))
It is not perfectly fluid though, it "fashes" a bit, but hey, it works!
thanks @micha!