This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-18
Channels
- # adventofcode (20)
- # aleph (25)
- # announcements (4)
- # babashka (117)
- # beginners (150)
- # calva (4)
- # cider (9)
- # clj-on-windows (2)
- # clojure (9)
- # clojure-europe (4)
- # clojure-italy (3)
- # clojuredesign-podcast (18)
- # clojurescript (16)
- # conjure (1)
- # core-async (35)
- # cursive (13)
- # datalevin (6)
- # datomic (6)
- # fulcro (8)
- # hyperfiddle (5)
- # malli (8)
- # nextjournal (4)
- # off-topic (51)
- # pathom (4)
- # reagent (21)
- # sci (14)
- # shadow-cljs (22)
- # specter (3)
- # testing (22)
- # tools-deps (8)
- # xtdb (7)
@nbdam from a clojure REPL you can call (shadow.cljs.devtools.api/watch-set-autobuild! :the-build-id false)
to disable and true
to enable again
am i correct in thinking I can’t use (cljs.analyzer/analyze
in a non-bootstrapped build target? I’m “just” looking to get the AST structure for some code at runtime
depends. you can use analyzer without but you won't get very far without at least the analyzer data for cljs.core. which in turn means self-hosted
Hi!
I am trying to get a minimal thing with OpenLayers to work, referring to this:
https://stackoverflow.com/questions/10349168/clojurescript-openlayers
and this:
https://code.thheller.com/blog/shadow-cljs/2017/11/10/js-dependencies-in-practice.html
Problem is, if I use the (js/OpenLayers.Map. "map")
syntax, shadow-cljs complanis OpenLayers is not defined,
if I use (:require ["ol" :as ol])
I can define a map like (def mapp (ol/Map. "map"))
but I don't know how to use constructors like (js/OpenLayers.Layer.OSM. "Simple OSM Map")
.
Also, using this require, I cannot send the namespace expression via the nREPL connection in Clojure-Kit from IntelliJ, because the ns macro is considered invalid (shadow-cljs compiles fine however ...).
So, what is the correct way to do stuff like this in CLJS with shadow?
Is requiring a library like this something very shadow-specific?
I guess it might be possible to require the library via the html (then the js/OpenLayers.Map. thing should work, right?) but I kind of feel like this should not be the way
@d.eltzner don't use anything from that SO question
(js/OpenLayers.Layer.OSM. "Simple OSM Map")
would become (ol/Layer.OSM. "Simple OSM Map")
the other thing, any idea why I'd get an error trying to send a ns declaration using this require via Clojure-Kit? it's the usual invalid macro syntax thingie when there's invalid stuff in a namespace delcaration
Syntax error macroexpanding clojure.core/ns at (src/myproject/core.cljs:1:1). ((:require [reagent.core :as r] [reagent.dom :as d] ["ol" :as ol])) - failed: Extra input spec: :clojure.core.specs.alpha/ns-form
I don't know what Clojure-Kit is but I guess it doesn't understand the string require syntax. or you are eval'ing in a clojure repl. clojure doesn't support it