This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # bangalore-clj (1)
- # beginners (16)
- # bigdata (1)
- # boot (16)
- # cljs-dev (79)
- # cljsjs (37)
- # cljsrn (62)
- # clojars (1)
- # clojure (260)
- # clojure-austin (3)
- # clojure-dev (3)
- # clojure-dusseldorf (3)
- # clojure-italy (1)
- # clojure-russia (32)
- # clojure-serbia (2)
- # clojure-spec (8)
- # clojure-uk (146)
- # clojure-ukraine (16)
- # clojurescript (66)
- # cursive (27)
- # datomic (57)
- # dirac (124)
- # emacs (10)
- # hoplon (12)
- # juxt (6)
- # keechma (6)
- # lein-figwheel (18)
- # leiningen (6)
- # lumo (51)
- # off-topic (1)
- # om (66)
- # onyx (41)
- # perun (1)
- # play-clj (1)
- # protorepl (9)
- # re-frame (20)
- # reagent (11)
- # ring (4)
- # ring-swagger (10)
- # rum (22)
- # specter (8)
- # sql (2)
- # test-check (5)
- # untangled (27)
- # yada (29)
@martinklepsch: I didn't even know this channel existed, awesome!
So openlayers seems to be a kind of unique package as it has both Closure and normal externs. For the externs in the deps.cljs file, it points everything to the
cljsjs/openlayers/common folder - but when I go to that folder in the JAR file there's nothing there. I assume the externs files at the very least should be there, is that correct? Do the full .js files also have to be included in the JAR for it to work? I've only started looking into all of this earlier this week so my understanding is still pretty minimal.
@shaun-mahood is there a bunch of stuff in the
cljsjs/openlayers/development/ directory in that jar?
@martinklepsch: Yes, the development directory has a bunch of stuff in it - looks like all the same GClosure files as in openlayers.
Openlayers also has some docs on compiling your own application with GClosure as well (https://openlayers.org/en/latest/doc/tutorials/closure.html), and it includes some externs files on top of the openlayers ones - but I can't find those externs files, or the ones included in the deps.cljs under
:externs in the JAR file.
but the release zip now has ol.ext folder, instead of externs folder which is used by the packaging script
the repository has been renamed -> the folder inside archive is also renamed -> regexes are broken
@juhoteperi Seems like the Circle CI stumbled:
clojure.lang.ExceptionInfo: User limit of inotify watches reached
@juhoteperi: Ok, so the cljsjs package doesn't have everything that it needs. I'm going to try and figure out how compile a JS app with Google Closure then, and I'll see about updating the cljsjs package after that (once I understand it well enough). Openlayers seems like it's more complicated than most things - but I really don't want to have to write my programs in JS so I'm pretty motivated to figure it out. 🙂
@shaun-mahood Also, depending on your mapping needs, I can recommend Leaflet. I guess it is a bit higher level lib.
@juhoteperi: Oh cool, thanks! I'll try the new package and see. The main reason I wanted to use openlayers is because I figured it would work better with CLJS, so maybe I'll try leaflet too and see if it's a good fit. I'm not sure what my mapping needs are quite yet.
I get the same error as before, but it's entirely possible I'm doing something else wrong - I'm not super clear on what is necessary for working with externs. If I needed to use the functions from one of those extern files (say
bingmaps.ext.js), then I need to have bingmaps.js accessible from somewhere, right? Should it be in the CLJSJS JAR file as well, or would I just include it in my HTML file?
Ok, so the jar file includes the extern files, but if my code uses any of those functions then I will need to have included the original .js file in my html beforehand, right?
as openlayers is Closure lib, you only need to require the module where the function is defined
I think I've got most of how to use the Closure lib part at least mostly understood, my main confusion right now is that openlayers is a Closure lib with externs as well - so if we look at the extern for jQuery as an example, if I want to call one of the jQuery methods that's listed in the extern, where does the code to run the actual jQuery functions come from? Is it all included as part of the extern, or does it have to be included as part of the code with the closure modules, or on your page? Some of the other CLSJS jars I've got also have the original JS files included so I'm a little confused as to what is necessary in this case.
Nearly all Cljsjs packages include the real sourcecode, and that is automatically included as part of your application
In dev it is dynamically loaded similar to how compiled Cljs and Closure output files are loaded
Ok, I think I've got the basics of that for both the purely externs packages and for the pure Closure packages. Still unclear on where the sourcecode for the externs in openlayers are coming from - the externs are there but I can't find the original jQuery source in either the CLJSJS package or the the node package they use to compile (https://openlayers.org/en/latest/doc/tutorials/closure.html). Openlayers has a custom node application that they use to compile your own app and their source code together - could they be using that to include the source files that are required? Thanks for the help, even if I'm not getting anywhere yet as far as getting things to work it's definitely helping me understand things better.
Yeah, I think that's probably the case - it's included in their node_module under externs but not listed in their instructions for building it by default. It looks like most of the other externs have a matching source file somewhere though. I've managed to get to the point where I hit the same error using CLJS (with the old package missing the externs) and by including the JS files manually and building a Closure application (just by adding files that Closure complains about). My suspicion is that I'm missing a dependency that I don't know about, and I've narrowed it down to a particular line where the working JS example returns a value and my bad translations return null. I'm going to see if I can get the Closure version working first with their custom compiler (or manually and painfully) so I can track down what I'm missing. Thanks again for the help!