This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-10
Channels
- # announcements (6)
- # babashka (38)
- # beginners (85)
- # biff (3)
- # calva (2)
- # cider (11)
- # clerk (14)
- # clj-kondo (6)
- # clj-on-windows (27)
- # clj-together (2)
- # cljsrn (18)
- # clojure (106)
- # clojure-austin (1)
- # clojure-belgium (1)
- # clojure-europe (19)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-uk (2)
- # clr (2)
- # cryogen (1)
- # cursive (10)
- # datahike (3)
- # datavis (2)
- # datomic (15)
- # emacs (7)
- # graalvm (10)
- # graphql (20)
- # gratitude (1)
- # hyperfiddle (1)
- # improve-getting-started (23)
- # joyride (24)
- # london-clojurians (1)
- # lsp (22)
- # malli (4)
- # matcher-combinators (3)
- # membrane (13)
- # off-topic (1)
- # pathom (24)
- # polylith (9)
- # react (31)
- # reagent (9)
- # releases (1)
- # remote-jobs (1)
- # reveal (3)
- # shadow-cljs (50)
- # spacemacs (3)
- # specter (5)
- # xtdb (5)
I am trying to require a JS component in the path ./componnts/Foo.js
of my project and no matter what I try js/require
always gets nil. @joshmiller I sqw your template uses requires stuff from js
path but I cant figure our how that even works hahaha. I am not using your template I wanted to start a fresh project with newer libs and thought I could reverse engineer some of shat you do in your template I am stumped.
@U06UBQ4TH Are you using Krell?
The paths for that are a little bit non-intuitive and it took me a while to figure it out. What happens is Krell generates a file called target/krell_npm_deps.js
where it requires everything it found in your cljs
files. It looks like this:
module.exports = {
krellNpmDeps: {
"../js/src/Icons.js": require('../js/src/Icons.js'),
"../js/src/SafeBackground.js": require('../js/src/SafeBackground.js'),
"../js/src/AddPlace.js": require('../js/src/AddPlace.js'),
So the path when you do (js/require)
needs to be relative to there. I keep my JS files in a top-level js/
directory, so they all look like (js/require "../js/src/Icons.js")
regardless of where in the directory tree they live.
Hm, in that case it might not be the path, but that Krell isn’t finding it on its compiler pass… What does the js/require
form look like? I have noticed it needs to be a .js
file for example, Krell isn’t looking for .jsx
So it happens at first pass of compiler? Do I need to restart the repl every time I add a new one?
Yeah, I don’t believe it’ll hot reload.
It’s part of the setup Krell does to get the whole environment together. You can see when it happens by just seeing when that krell_npm_deps.js
file is touched.
Ok that gives some stuff to check! Thanks @joshmiller we should have a meet up again :D
Yes definitely! I need to check with Puppet to see if they’ll still host. And yeah, recognized the avatar heh.