This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-19
Channels
- # announcements (52)
- # asami (83)
- # atom-editor (1)
- # babashka (143)
- # beginners (123)
- # calva (18)
- # chlorine-clover (21)
- # cider (7)
- # clj-kondo (57)
- # cljs-dev (4)
- # clojure (209)
- # clojure-boston (1)
- # clojure-europe (27)
- # clojure-germany (12)
- # clojure-italy (17)
- # clojure-nl (3)
- # clojure-serbia (6)
- # clojure-spec (1)
- # clojure-uk (59)
- # clojurescript (82)
- # conjure (9)
- # core-async (6)
- # cursive (20)
- # data-science (1)
- # datahike (1)
- # datascript (1)
- # datomic (86)
- # duct (5)
- # emacs (6)
- # events (6)
- # figwheel-main (4)
- # fulcro (27)
- # graalvm (19)
- # leiningen (14)
- # lsp (30)
- # malli (48)
- # meander (3)
- # off-topic (6)
- # pedestal (2)
- # practicalli (1)
- # rewrite-clj (21)
- # shadow-cljs (18)
- # sql (15)
- # tools-deps (9)
- # vim (3)
- # wasm (3)
- # xtdb (18)
If I want to rewrite cljs sources during compilation is there a way to use build hooks to get the result of reading the forms and manipulate the forms prior to macro expansion ? The only way I have figured out so far is hooking into compile-prepare and replacing every cljs file in build state with one at a different tmp path that has been modified. Thoughts ?
Hi there o/ Is there any way that I could create standalone js files for each of the entries (or modules)? Or should I create a new build for each (could I watch them all at the same time, I guess it's doable from my part if this is the only way o/)? In the example below, it outputs a shared.js file, it's fine, but standalone would be good for now (I'm trying to use Cypress).
{:builds :....
{:target :browser
:output-dir "out/testtt"
:compiler-options {:infer-externs :auto}
:modules {:shared {:entries [cypress.core]}
:cypress.blablabla.edit-test
{:entries [cypress.blablabla.edit-test]
:depends-on #{:shared}}
:cypress.blablabla.add-test
{:entries [cypress.blablabla.add-test]
:depends-on #{:shared}}}}}
And thanks for this very awesome piece of software, Thomas o/@pfeodrippe IFAIK, when you compile the release version, each module will be a single JS file
I don't understand the question? the whole point of modules is creating multiple files? if you only want one file only use one module?
Oh sorry, I want to create a standalone file for each cypress.blablabla...
namespace, right now it creates a thin js file for each, it gives me SHADOW_ENV is not defined
error. The only way to do this is through a build (maybe any other dynamic way)?
I'm missing some basic information I guess. you are supposed to load the shared.js
first before loading the other module
but to answer your question: no, there is no way to make modules standalone using shadow-cljs
Oh, thanks. Yes, to load shared.js
before appears to be the best approach, I just wanted to check if there was another way.
Thanks, @thheller and @mauricio.szabo o/
well technically the :target
abstraction in shadow-cljs would allow for a :target :cypress
and then just take the minimum amount of config to emit the output that fits best for cypress
but that is going to be a bit of work since none of the underlying code is documented 😉
Oh very nice! Well, I can check how karma (or some simpler one) works, thanks again o/