This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-05
Channels
- # arachne (7)
- # architecture (3)
- # beginners (106)
- # cider (22)
- # clara (2)
- # cljs-dev (14)
- # cljsrn (12)
- # clojure (121)
- # clojure-china (1)
- # clojure-italy (2)
- # clojure-spec (22)
- # clojure-uk (32)
- # clojurescript (38)
- # community-development (45)
- # cursive (15)
- # datascript (6)
- # datomic (12)
- # defnpodcast (2)
- # emacs (8)
- # events (1)
- # fulcro (14)
- # immutant (6)
- # jobs (3)
- # jobs-discuss (6)
- # jobs-rus (3)
- # keechma (4)
- # keyboards (4)
- # leiningen (8)
- # luminus (1)
- # off-topic (91)
- # onyx (13)
- # parinfer (36)
- # re-frame (12)
- # reagent (23)
- # remote-jobs (1)
- # ring-swagger (3)
- # shadow-cljs (57)
- # specter (11)
- # sql (9)
- # uncomplicate (4)
- # vim (2)
- # yada (15)
@richiardiandrea we could consume embedded ones and I don’t really have an issue with generating embedded ones - but it should be behind a flag
I have a small patch ready with source-map-inline
= true. I need some time to check if it works properly
the only place where we support it I believe is the REPL, where we use them when compiling expressions
@richiardiandrea ah you’re talking specifically about self-hosted here
Yep I have a q: are source maps composed of multiple files usually? If a namespace requires clojure.string
for instance, should I see it in the source maps? Because it does not seem to show up in my self-host source maps...
@richiardiandrea If a namespace requires clojure.string
, then, if :source-map
is set to true
, the source maps for clojure.string
would be appended to the end of the generated JavaScript for the clojure.string
namespace.
Oh the whole encoded file? ok that is not what I am seeing, will dig more. Thanks you both
Yeah, it is appended to the source via https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/js.cljs#L157
But to be honest, I never found that useful because it requires the JavaScript environment to do something with it. What seems to be more important, IMHO, is that source maps are included under the :source-maps
key of the compiler state.
One thing that I wanted to document is that the name
key to eval-str
is used in the source maps so in lumo
I was passing the namespace instead: https://github.com/anmonteiro/lumo/pull/349/files#diff-4da6b6777b07770bfe3ffbd39a773e33R1152
Don't know how correct this is but I have reverse engineered it by reading the piece of code you just linked :)
So folks here is what I get (`:verbose` on from the compiler, thanks for this feature!):
{"version" 3
"file" "repro/expound_tuple.js?rel=1517796376596"
"sources" ["expound_tuple.cljs?rel=1517796376596"]
"lineCount" 14
"mappings" ";AAOA,+CAAA,/CAAMA,sGACHC,MAAMC;AADT,AAGE,4BAAA,5BAACC,qCAAiBF;;AAClB,AAACG,YAAeF;;AAChBA;;AAyBF,8BAAA,9BAAMG;AAAN,AAEE,kCAAA,3BAACC"
"names" ["repro.expound-tuple/lumo-prepare-stack-trace","error","stack","cljs.core/println","js/console.dir","repro.expound-tuple/test-sm","cljs.core/ffirst"]
"sourcesContent" ["(ns repro.expound-tuple\n ..."]}
the sources
field is only one and not relative, which to me sounded strange and when I tried with source-map-explorer
it was complaining that it is only one file (shouldn't be many?): https://www.npmjs.com/package/source-map-explorer#generating-source-maps
I (but I am not an expert by any means) expected cljs.core
and clojure.string
to be in sources
.