This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-18
Channels
- # announcements (22)
- # asami (7)
- # babashka (43)
- # beginners (68)
- # biff (2)
- # calva (10)
- # clj-kondo (7)
- # cljdoc (29)
- # clojure (41)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-europe (25)
- # clojure-gamedev (3)
- # clojure-nl (2)
- # clojure-norway (9)
- # clojure-uk (31)
- # clojurescript (3)
- # community-development (7)
- # cursive (3)
- # data-science (4)
- # datomic (17)
- # emacs (30)
- # honeysql (10)
- # hyperfiddle (39)
- # introduce-yourself (1)
- # jobs-discuss (5)
- # kaocha (1)
- # lsp (11)
- # malli (12)
- # pathom (18)
- # pedestal (3)
- # proletarian (2)
- # quil (11)
- # rdf (46)
- # reitit (8)
- # releases (2)
- # shadow-cljs (34)
- # sql (3)
- # squint (10)
- # tools-deps (24)
- # xtdb (10)
external creates an additional file that you run through webpack or so, but leave the CLJS output itself untouched. :external
only applies to :browser
builds
import leaves all JS requires as they are, meaning when processed with webpack it'll process everything. :import
only applies to :esm
builds.
Let me paraphrase it. The difference that:
• :target :esm
produce esm module, while :target :browser
not
• when I use :target :esm
the resulting bundle should be still subject for processing via webpack, while with :target :browser
webpack should not touch it
• In the :target :browser
webpack resolves deps from index file while with :target :esm
webpack resolves the deps based on the build artifact
Correct?
:target :esm
itself does not need processing by webpack, only in combination with :js-provider :import
Which option would you suggest in the project when TypeScript and ClojureScript sit one next to the other, and they call each other. Initially I set it up based on :target browser
with :js-provider :external
with some relative imports translation via babel.
Would it be possible to support such env (TS+CLJS) using :target :esm
?
> well, the essential question here is what you mean by "they call each other"? In one directory you could have both .ts and .cljs files, and they could import each others functions
> you can also just use :browser
and let shadow-cljs process the TS output
Yes, and this is what I used to do. But then with libraries like aws-amplify I no longer can
especially if they have different views of the world, like shadow-cljs and webpack do
I want to pull clojure.string functions in their own module and also one for cljs.core clojure.string obviously depends on cljs.core and pretty much every other module I have also depends on both. When I compile I'm getting in dev mode:
Module Entry "clojure.string" was moved out of module ":clojure.string".
It was moved to ":cljs.core" and used by #{:cljs.core :cherry.tests :clojure.string :compiler :cli}.
It works in release mode though. What's the issue?the devtools are injected into the base module by default, so that doesn't work if clojure.string or anything else they depend on are specifically pinned to a different module
hi hi 👋 asked in #tools-deps, but also not sure if it exists/supported in shadow-cljs? https://clojurians.slack.com/archives/C6QH853H8/p1692374945799339
I don't quite understand the question, but shadow-cljs itself has no :local/root
equivalent. just what is supported by deps.edn
when using that.