This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-21
Channels
- # announcements (1)
- # beginners (20)
- # biff (5)
- # calva (43)
- # cider (5)
- # clj-commons (7)
- # clj-kondo (11)
- # clojure (58)
- # clojure-brasil (1)
- # clojure-denmark (1)
- # clojure-europe (27)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (2)
- # clojurescript (71)
- # data-science (32)
- # datalevin (6)
- # datomic (19)
- # emacs (1)
- # gratitude (3)
- # honeysql (8)
- # hoplon (15)
- # hyperfiddle (3)
- # introduce-yourself (1)
- # lsp (19)
- # malli (4)
- # nbb (7)
- # other-lisps (5)
- # practicalli (1)
- # re-frame (14)
- # releases (1)
- # ring-swagger (1)
- # squint (118)
- # xtdb (9)
- # yada (2)
I’m running into an issue calling nbb
from another JS program.
I use eleventy and eleventy lets you specify your own templating engine. My goal is to have the hiccup in the .cljs
files be processed by nbb
. You can see my https://github.com/athomasoriginal/eleventy-test-cljs. The idea is, whenever a local .cljs
file changes, we:
• https://github.com/athomasoriginal/eleventy-test-cljs/blob/main/.eleventy.js#L21
• nbb runs https://github.com/athomasoriginal/eleventy-test-cljs/blob/main/run_clj.cljs and run_clj.cljs
loads the sample template file (https://github.com/athomasoriginal/eleventy-test-cljs/blob/main/src/test.cljs) which depends on .https://github.com/athomasoriginal/eleventy-test-cljs/blob/main/src/extra/components.cljs
when I run eleventy, I can modify test.cljs
and it live updates. However, if I modify a components.cljs
, the nbb script re-runs, but doesn’t seem to fetch the latest in components.cljs
Is there something in the way resolving local ns’s works that might cause this?
The reason I think the issue may be with nbb is because if I slurp
the components.cljs
I get the latest code. e.g.
(comment
(p/let [components-res (nbb/slurp "./src/extra/components.cljs")]
(-> (nbb/load-string components-res)
(.then (fn [result]
(js/console.log "SLURP TEST 1: " (rds/render-to-static-markup [(last-form result)]))
(js/console.log "SLURP TEST 2: " (rds/rende-to-static-markup [(last-form result)])))))))
The above will pickup the latest code changes when eleventy re-runs the nbb script.I got it to work, when I https://github.com/athomasoriginal/eleventy-test-cljs/blob/main/run_clj.cljs#L15C24-L15C24`p/let`https://github.com/athomasoriginal/eleventy-test-cljs/blob/main/run_clj.cljs#L15C24-L15C24. This was only meant to be a way to debug, but seems to resolve the issue.
Is it an async issue when requiring a local dep? :thinking_face: