This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-11
Channels
- # announcements (5)
- # babashka (43)
- # beginners (78)
- # calva (1)
- # cider (35)
- # clj-kondo (15)
- # clj-otel (3)
- # cljs-dev (2)
- # clojure (24)
- # clojure-denmark (1)
- # clojure-dev (9)
- # clojure-europe (43)
- # clojure-israel (1)
- # clojure-italy (1)
- # clojure-losangeles (3)
- # clojure-nl (1)
- # clojure-norway (54)
- # clojure-romania (1)
- # clojure-uk (2)
- # clojurescript (1)
- # core-async (25)
- # cursive (7)
- # datascript (6)
- # datomic (7)
- # docker (2)
- # emacs (2)
- # events (8)
- # exercism (2)
- # fulcro (2)
- # hyperfiddle (16)
- # lsp (46)
- # malli (10)
- # membrane (2)
- # music (6)
- # nbb (30)
- # off-topic (49)
- # polylith (4)
- # reagent (3)
- # releases (4)
- # shadow-cljs (5)
- # slack-help (1)
- # sql (2)
- # testing (2)
- # timbre (6)
- # tools-deps (29)
- # xtdb (36)
Just submitted a fastify example PR, please take a look https://github.com/babashka/nbb/pull/339
Will continue to work on this example further, hopefully to a production ready web service that can be deployed to cloud like http://fly.io. Already benchmarked the http performance of a) nbb-fastify b) node-fastify for a simple text responding endpoint. Would like to create a close-to-real-world service (body parsing, cookie setting, JWT verification etc.) to see how both will play.
Need your help. How can I import, require a map (config) from a sibling file to parent module? Both reside in the same directory.
;; src/a/core.cljs - parent
(ns a.core
(:require [--- THE PROBLEM ---]))
;; src/a/config.cljs - required/ child
(def config { answer: 42 })
you should name your files according to the directory structure, so
src/a/core.cljs
becomes (ns a.core)
If I (:require [a.config])
does it become just config
object? or should i qualify the import with :as
?
Being on and off lisp, common lisp, always trying to like clojure/ script. nbb is a good entry (someone already mentioned on X), that does feel familiar.

nbb bundle
outputs a file with loadString
or loadFile
methods. Is there a way to tap in to transpiler stages to output the interim JS code for debugging?
@URCRY0U87 no, there's not really a way to tap into this. you can edit the code of course, not sure what you are trying to debug?
user=> (require '[applied-science.js-interop :as j])
nil
user=> (j/defn foo [^:js {:keys [a]}] a)
#'user/foo
user=> (macroexpand '(j/defn foo [^:js {:keys [a]}] a))
(def foo (cljs.core/fn ([p__28] (applied-science.js-interop/let [{:keys [a]} p__28] a))))
user=> (require '[clojure.walk :refer [macroexpand-all]])
nil
user=> (macroexpand-all '(j/defn foo [^:js {:keys [a]}] a))
(def foo (fn* ([p__35] (let* [map__36 p__35 map__36 (if false (cljs.core/apply cljs.core/hash-map map__36) map__36) a (applied-science.js-interop/get map__36 :a)] (do a)))))