shadow-cljs

Schmoho 2025-03-26T10:33:09.116889Z

What is the reason / reasoning behind shadow (I have not actually checked whether the CLJ compiler does the same thing) producing a compilation error on unknown keywords in comment blocks and behind the #_ reader-tag?

(comment #_::i-dont-exist/stuff)

(comment #_::i-dont-exist/stuff)
--------------------------------------^-----------------------------------------
[...] Invalid keyword: ::i-dont-exist/stuff.

thheller 2025-03-26T10:41:26.427289Z

thats a reader problem. stuff still needs to be readable, i.e. have resolvable aliases

thheller 2025-03-26T10:41:35.024489Z

CLJ has the same problem

👍 1
Eva O 2025-03-26T17:56:04.574969Z

Is it possible to get exception stacktraces to point to the clojure files instead of the javascript files? Maybe some sort of source map configuration?

thheller 2025-03-26T17:56:38.030509Z

source maps should indeed take care of that and they are enabled by default

thheller 2025-03-26T17:57:23.834559Z

it is possible that you have a wrong configuration that prevents them from loading properly, check the browser console if there are some errors/warnings reported for them

Eva O 2025-03-26T17:57:44.819069Z

The browser says that source maps are loaded

thheller 2025-03-26T17:57:49.287149Z

basically the only relevant option is :asset-path, which must be correct

thheller 2025-03-26T17:58:06.790179Z

and you are talking about stacktraces in the browser console?

Eva O 2025-03-26T17:58:18.658969Z

Yes in the browser console

Eva O 2025-03-26T17:59:19.157279Z

My config has :output-dir "resources/public/js/app" :asset-path "/js/app" and serves assets out of the resources/public directory

thheller 2025-03-26T17:59:29.264719Z

ok that looks correct

thheller 2025-03-26T17:59:32.873049Z

then it should just work

thheller 2025-03-26T17:59:51.796289Z

are you asking about watch or release builds?

Eva O 2025-03-26T17:59:52.561939Z

I'm getting stacktraces like this:

nexttick.js:195 2025-03-26T17:48:24.872Z ERROR [com.fulcrologic.statecharts.algorithms.v20150901-impl:85] - Expression failure
Error: Test
    at new cljs$core$ExceptionInfo ()
    at cljs$core$ex_info.eval [as cljs$core$IFn$_invoke$arity$3] ()
    at cljs$core$ex_info.eval [as cljs$core$IFn$_invoke$arity$2] ()
    at eval ()
    at eval ()
    at eval ()
    at Object.eval [as com$fulcrologic$statecharts$protocols$ExecutionModel$run_expression_BANG_$arity$3] ()
    at $fulcrologic$statecharts$protocols$run_expression_BANG_ [as run_expression_BANG_] ()
    at $fulcrologic$statecharts$algorithms$v20150901_impl$run_expression_BANG_ [as run_expression_BANG_] ()
    at eval ()

thheller 2025-03-26T18:00:17.231229Z

that looks like some logging impl, not a regular js/console.log

Eva O 2025-03-26T18:00:43.999799Z

I tested it with (throw (ex-info "Test" {:foo "bar"}))

thheller 2025-03-26T18:00:53.944649Z

ex-info sucks for this. browsers don't source map custom error types

Eva O 2025-03-26T18:02:49.327449Z

Is there a way I can verify that it works? A different error type?

thheller 2025-03-26T18:03:09.331279Z

(throw (js/Error. "Test"))

thheller 2025-03-26T18:04:05.353969Z

or just (throw "test") should also be mapped properly

Eva O 2025-03-26T18:05:50.890679Z

I'm still getting javascript files in the stacktrace

thheller 2025-03-26T18:07:34.177869Z

as I said this is not a regular js/console.log, so I do not know what is causing the logging here

thheller 2025-03-26T18:08:05.236399Z

only actual (js/console.log the-original-exception) will cause things to be source map, nothing else is

thheller 2025-03-26T18:08:27.569129Z

so if whatever this logging impl is just logs (.-stack ex) then it will not be source mapped and there is nothing to get that

Eva O 2025-03-26T18:09:19.798869Z

Oh it's just console.log that gets source mapped. Ok that makes sense

danieroux 2025-03-26T20:14:22.909489Z

@eoogbe I think you might be looking for com.fulcrologic.fulcro.algorithms.timbre-support

Eva O 2025-03-26T20:37:01.851229Z

I'm using telemere not timbre

valerauko 2025-03-28T13:29:40.772869Z

wasn't telemere timbre-compatible? (or at least have some glue ns to help migrate?)