This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-14
Channels
- # ai (4)
- # babashka (4)
- # beginners (46)
- # biff (5)
- # calva (12)
- # clojure (6)
- # clojure-austin (13)
- # clojure-dev (27)
- # clojure-europe (62)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojure-spec (2)
- # clojure-uk (12)
- # clojurescript (10)
- # cursive (3)
- # datahike (26)
- # datalevin (9)
- # datomic (7)
- # gratitude (4)
- # honeysql (9)
- # hyperfiddle (12)
- # instaparse (2)
- # lsp (65)
- # membrane (7)
- # missionary (2)
- # off-topic (8)
- # polylith (33)
- # portal (7)
- # quil (1)
- # re-frame (4)
- # reagent (18)
- # releases (3)
- # ring (3)
- # spacemacs (2)
- # specter (4)
Hallooo Clojurians!
I’m looking at https://clojurescript.org/guides/javascript-modules
It says there’s a way to incorporate js source files into the build.
The demonstration code only uses the :nodejs target,
and only covers building an app,
and uses the “cljs” command-line tool.
I am hoping to include a js source file in a library (which I then lein install)
for the browser,
and I have installed the clojure cli tools but there seems not to be a cljs
command.
(I have not used the cli tools much at all; all my projects are still leiningen.
;;
The actual problem I’m trying to solve is to get a stack trace (not printed to the console
but as data I can pass in an ex-info). The js function does some munging with the arguments
object; is that available in a cljs function? Seems not, at least not as js/arguments
.
Thoughts?
it isn't entirely clear what you are asking since you ask many different things at once that aren't directly related
if you want to include a JS file the most seamless way is writing it as a goog.module
file
meaning that you create a foo/bar.js
file in your classpath, so if you have src/cljs
or src/main
or just src
as the root path you create src/cljs/foo/bar.js
(or whichever other prefix)
in that file you start with goog.module("foo.bar");
and then just regular JS after that
from CLJS you then just (:require [foo.bar :as x])
and x/foo
or :refer (foo)
to get it
this is entirely unrelated to which tool you are using to build. they all support this
@U05224H0W I believe you have solved my issue both specifically and generally so Thanks!