scittle

chromalchemy 2025-09-18T16:32:54.075999Z

I just updated Scittle includes on my project and it working with Cljs-devtools and Dataspex! clojure-spin🔥 Awesome. This is a major ergonomics upgrade. Than @borkdude for scittle growth. Thx @timothypratley for the includes generator.

🥳 2
🎉 1
chromalchemy 2025-09-18T16:36:19.924609Z

Here is a little snippet to automatically substitute regular console.log for pprint if it’s not included.

;; Load pprint if available, otherwise use native logging
(try
  (do
    (require 'cljs.pprint)
    (def pprint cljs.pprint/pprint)
    (js/console.log "Cljs pprint Loaded"))
  (catch js/Error e
    (let [error-message (.-message e)]
      #_(if (string/includes? error-message "Could not find namespace"))
      (def pprint js/console.log) ;; use regular logging fn instead of pprint
      (js/console.log "Cljs pprint not found, substitued native logging"))))
  
I don’t have pprint in production, but was always worried that I might leave a usage of it in the code going to production and that would crash the production deployment.

👀 1
chromalchemy 2025-09-18T16:43:24.470369Z

Is there anything special I need to do to enable source maps? Maybe I’m not sure how it’s supposed to work. I’m running all the dev builds. On my browser devtools console, various log statements link to source in the scittle.js file, not my user code.

borkdude 2025-09-19T18:41:07.448409Z

so the mystery is solved. shadow does produce .map files by default in prod, but it does this for the build report (when it's enabled). but it's not linking them. for this, you still need to enable the compilation option. PR or issue welcome

2025-09-19T19:00:23.728879Z

Makes sense. That's probably what I experienced before and why I made the issue https://github.com/babashka/scittle/issues/114 I have it working locally so can add a PR beginning of next week

🎉 2
2025-09-18T17:00:11.229089Z

Do you see the .map files in the output dir?

2025-09-18T17:00:31.017099Z

And do you see something like //# sourceMappingURL=scittle.core.js.map at the end of the js files?

2025-09-18T17:01:26.491809Z

Oh you are talking about the actual user code / the scittle code?

2025-09-18T17:04:05.615429Z

If you don't have the .map files etc, maybe you are missing :compiler-options {:source-map true} in the shadow-cljs config

2025-09-18T17:05:29.649109Z

Hmm i thought this was already in the Sci, but I don't see it in the shadow-cljs config. But the issue is closed https://github.com/babashka/scittle/issues/114

2025-09-18T17:05:49.825779Z

Ok have to go now. But I'm betting it is the missing compiler option

borkdude 2025-09-18T17:11:16.159329Z

The map files are the default in shadow. They are included in the npm package

borkdude 2025-09-18T17:13:17.952929Z

also for non-dev: https://cdn.jsdelivr.net/npm/scittle@0.7.28/dist/scittle.js.map

chromalchemy 2025-09-18T18:12:38.797029Z

Shadow-cljs config? I’m using the pre-compiled plugins that are hosted on jsdeliver. I dont see any .js.map references in scittle.js I’m currently using the scittle-kitchen links. I tried swapping out for the regular scittle.js link. But then the plugins are not found. Apparently the 2 versions of jsdeliver links are not mix-and-match. I am not understanding what I am supposed to do, or what is supposed to happen. js source maps setting is enabled in my devtools. Am i supposed to include somewhere? Since there is no bundle.js, Is source maps intended to link console messages to my user cljs code?

chromalchemy 2025-09-18T18:20:40.305879Z

There are .map files in the scittle kitchen npm repo: https://www.jsdelivr.com/package/npm/scittle-kitchen?tab=files&path=dist%2Fdev

borkdude 2025-09-18T18:21:10.016609Z

No don’t mix different distributions

chromalchemy 2025-09-18T18:27:39.086879Z

If a link takes me to sources like this. Does that mean it’s not working?

chromalchemy 2025-09-18T18:37:22.964419Z

I dont see any mention of sourceMappingURL in the scittle.js code

borkdude 2025-09-18T18:38:54.616399Z

let me try normal scittle to see if source maps work

borkdude 2025-09-18T18:41:40.256369Z

exceptions are caught by scittle itself normally. how do you get an error to point to scittle itself?

borkdude 2025-09-18T18:41:44.650979Z

repro plz

borkdude 2025-09-18T18:43:12.252149Z

ah yes in a timeout:

(js/setTimeout #(assoc :foo :bar :baz) 1)

borkdude 2025-09-18T18:45:37.078719Z

hm yeah no mention of a source map. I'll ask in shadow

chromalchemy 2025-09-18T19:03:40.457779Z

That screen was from the sources tab of devtools, which opens when i click the source link in one of the console log messages. Are source maps supposed to apply there?

borkdude 2025-09-18T19:05:28.009639Z

I guess so

borkdude 2025-10-08T13:18:18.785529Z

Thanks!

chromalchemy 2025-09-18T21:09:30.674139Z

Can Snitch work in Scittle? https://github.com/AbhinavOmprakash/snitch?tab=readme-ov-file#clojurescript-support

chromalchemy 2025-09-19T23:56:57.843539Z

Wow, I thought since it was macro based it might be more of a stretch. Thats encouraging. Will look into it.

borkdude 2025-09-20T05:14:15.902619Z

Scuttle supports macros much like JVM Clojure

borkdude 2025-09-18T21:15:58.891329Z

I think it should almost work, except the dependency on cljs.analyzer, but if you ignore that, I don't see any code in there which isn't SCI compatible at first glance.

borkdude 2025-09-18T21:16:33.766479Z

just replace the ana/macroexpand-1 stuff with regular the regular JVM branch but for scittle using :scittle reader conditional

borkdude 2025-09-20T07:26:32.502959Z

Scuttle? Scittle damn phone