This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-19
Channels
- # announcements (12)
- # aws (17)
- # babashka (6)
- # beginners (40)
- # cider (14)
- # cljs-dev (14)
- # cljsrn (8)
- # clojure (110)
- # clojure-europe (46)
- # clojure-italy (1)
- # clojure-nl (4)
- # clojure-spec (14)
- # clojure-sweden (3)
- # clojure-uk (29)
- # clojurescript (52)
- # conjure (68)
- # cursive (33)
- # datomic (9)
- # figwheel-main (11)
- # fulcro (97)
- # ghostwheel (1)
- # graalvm (2)
- # helix (53)
- # hoplon (13)
- # joker (6)
- # kaocha (1)
- # leiningen (2)
- # meander (28)
- # mid-cities-meetup (1)
- # observability (1)
- # off-topic (112)
- # pathom (6)
- # pedestal (3)
- # re-frame (16)
- # reagent (16)
- # reitit (2)
- # shadow-cljs (27)
- # spacemacs (2)
- # sql (26)
- # testing (3)
- # utah-clojurians (3)
- # vim (2)
- # xtdb (32)
Hi. I'm trying to cache build dependencies for CI. Is there a way to specify another location for the local maven repo directory? Want to download and copy the entire .m2
directory into a container.
Anyone managed to get pretty printing working in the repl?
@amar for maven deps you can set :maven {:local-repo "maven"}
in either shadow-cljs.edn
or ~/.shadow-cljs/config.edn
can I mimic this JS inheritance in ClojureScript?
class AccessController extends EventEmitter {
static async create (db, options) {}
static get type () {
throw new Error('\'static get type ()\' needs to be defined in the inheriting class')
}
get type () { return this.constructor.type }
async canAppend (entry, identityProvider) {}
}
class OtherController extends AccessController {
static get type () { return 'othertype' }
async canAppend(entry, identityProvider) {
return true
}
}
Seems like in JS parlance static
is a property of the object itself and th prototype properties (methods) can be overridden by setting the -.prototype
.
What I'm not sure is what the get
is, also since AccessController extends EventEmitter
what to do with the static
properties of EventEmitter
, do I just add them to the object literal?
For the former I would do something the lines of:
(defn create-controller []
(let [type "othertype"
ac-obj #js {:create (fn [db options]
(js/Promise.resolve true))
:type type}]
(set! (.-prototype ac-obj) (.-prototype AccessController))
(set! (.. CustomAccessController -prototype -type)
(fn [] type))
(set! (.. CustomAccessController -prototype -canAppend)
(fn [entry identity-provider]
(js/Promise.resolve true)))
ac-obj))
can somebody share the link, i would like to read this. thanks!
https://stackoverflow.com/questions/61891349/implementing-static-properties-in-clojurescript
When using shadow-cljs with aws lambda, anyone got experience with correctly loading in node_modules? I’ve just been getting ImportModuleError
. I’ve specifically been trying to use the pg
npm module if that helps =)…
I need to run a bit of my front end code, which includes some native JS react components on my clojure server. The code compiles fine, like I can run it as a stand-alone node script, do I need to figure out how to get it to run on something like GraalVM?
compiling that code for the browser target and trying to run it with Nashorn didn’t work too well
perhaps there’s a shadow namespace I can import on the server, and have it load the compiled node-library
and run it?
there is not. nashorn as well as graal.js are rather limited JS engines and they don't support anything async
damn, fwiw it’s just a bit of reagent code (of which wraps a native react component [:> Thing]
) I’m I’m returning the string dom representation
I'm having a problem with cider-eval-*
. I know there's a lot of tools between running that emacs command and shadow-cljs, so maybe this isn't the right place to ask.
But I've tracked it down to the nrepl responding with :repl-type
of clj
in its response map which then gets sent to cider-set-repl-type
.
I haven't been able to track how :repl-type
gets set in the response. Does it have anything to do with shadow-cljs?
I'm running npx shadow-cljs server
, version 2.8.107 and cider-nrepl 0.25.0-alpha1. After launching npx shadow-cljs server
I'm connecting on the default port of 9000
and then running (shadow/repl :main)
. Everything else works fine. I'm just not able to evaluate stuff from a buffer. The buffer is connected. I've verified that looking at sesman. I put a debug-on-entry
on cider-set-repl-type
and I see it change from cljs-pending
type to clj
type on the first attempt at eval. And if I manually set the type back to cljs
with (cider-set-repl-type 'cljs
, then on the next eval it tries to set it back to clj
.
if you set it to cljs
and then eval something that is 100% cljs specific like (js/alert "hi")
does it still kick it back to `clj?
Well... shit... I switched to a different project and after manually changing it, it doesn't kick back to clj
. It was in a project I was in earlier. I have to run out in 5 minutes so I'll see if I can repro when I get back.
can somebody share the link, i would like to read this. thanks!