This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-19
Channels
- # announcements (13)
- # asami (43)
- # babashka (35)
- # beginners (175)
- # calva (23)
- # cider (5)
- # clj-kondo (68)
- # cljsrn (4)
- # clojure (61)
- # clojure-australia (7)
- # clojure-europe (20)
- # clojure-gamedev (59)
- # clojure-israel (11)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-norway (21)
- # clojure-spec (12)
- # clojure-uk (43)
- # clojurescript (9)
- # cursive (56)
- # data-oriented-programming (5)
- # datascript (1)
- # events (1)
- # fulcro (16)
- # honeysql (46)
- # leiningen (1)
- # malli (4)
- # off-topic (12)
- # pathom (46)
- # re-frame (24)
- # reagent (14)
- # reitit (1)
- # reveal (8)
- # rewrite-clj (16)
- # ring (13)
- # sci (9)
- # spacemacs (14)
- # specter (2)
- # sql (2)
- # tools-deps (1)
- # vim (2)
Hi, @borkdude. I'm trying to do something quite bizarre, so let me check if there's a better way with you here đŸ™‚.
I want to use SCI on a CLJS project. The problem is that I'll need to alter the source a little bit before I interpret it. In my case, I want to convert every instance of (js/require "some-filename.js")
that appears on my code to a string (specifically, I'll replace to the contents of some-filename.js
). Does exist a simple way to do this, to make this transformation?
Originally, I was thinking on using rewrite-cljs
to make the change, just so you know what are my ideas đŸ˜„
@mauricio.szabo yes, you can do this quite easily, by using the lower level API, by first parsing the expressions using sci/parse-next, then rewrite them and then evaluating using eval-form.
@mauricio.szabo I'm doing something similar in grasp, where I parse expressions and only evaluate the namespace forms after a bit of rewriting.
Yes, and I have to bundle the JS lib too, and other strange things đŸ˜„