clojurescript

Sigve 2025-11-25T07:44:55.239059Z

When fetching the new clojurescript version for a library using cljs.reader, warnings are issued from compiling the cljs.tools.reader.edn namespace

Sigve 2025-11-25T07:45:26.646779Z

❯ cat src/main/core.cljs

(ns main.core
  (:require [cljs.reader :refer [read-string]]))

(println "Hello, World!")

❯ clj -M --main cljs.main --compile main.core

Downloading: org/clojure/clojurescript/1.12.116/clojurescript-1.12.116.pom from central
Downloading: org/clojure/clojurescript/1.12.116/clojurescript-1.12.116.jar from central

WARNING: cljs.core/bit-or, all arguments must be numbers, got [string number] instead at line 300 /home/sigvesn/.cljs/.aot_cache/1.12.116/2D3BA81/cljs/tools/reader.cljs
WARNING: cljs.core/bit-or, all arguments must be numbers, got [string number] instead at line 300 out/cljs/tools/reader.cljs
WARNING: cljs.core/bit-or, all arguments must be numbers, got [string number] instead at line 152 /home/sigvesn/.cljs/.aot_cache/1.12.116/73AA0D5/cljs/tools/reader/edn.cljs
WARNING: cljs.core/bit-or, all arguments must be numbers, got [string number] instead at line 233 /home/sigvesn/.cljs/.aot_cache/1.12.116/73AA0D5/cljs/tools/reader/edn.cljs
WARNING: cljs.core/bit-or, all arguments must be numbers, got [string number] instead at line 152 out/cljs/tools/reader/edn.cljs
WARNING: cljs.core/bit-or, all arguments must be numbers, got [string number] instead at line 233 out/cljs/tools/reader/edn.cljs

dnolen 2025-11-25T10:33:43.315949Z

thanks - thinking about it, the warning is actually right

dnolen 2025-11-25T10:34:08.008759Z

ClojureScript inference got better and caught it

dnolen 2025-11-25T11:05:18.058819Z

will be fixed shortly

dnolen 2025-11-25T11:06:16.840329Z

(the problem is that we should be less specific about int coercion)

dnolen 2025-11-25T11:10:42.918119Z

fixed, thanks for the report

πŸŽ‰ 1
Sigve 2025-11-26T07:26:01.520799Z

Great, that was quick πŸ™‚

scarytom 2025-11-25T11:27:17.312039Z

Just upgraded to ClojureScript 1.12.116 and I'm now getting the following error:

% npx shadow-cljs release app
shadow-cljs - config: /home/tom/projects/portal/shadow-cljs.edn
shadow-cljs - starting via "clojure"
[:app] Compiling ...
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::arrayBaseOffset has been called by com.google.javascript.jscomp.jarjar.com.google.protobuf.UnsafeUtil$MemoryAccessor (file:/home/tom/.m2/repository/com/google/javascript/closure-compiler/v20250820/closure-compiler-v20250820.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.javascript.jscomp.jarjar.com.google.protobuf.UnsafeUtil$MemoryAccessor
WARNING: sun.misc.Unsafe::arrayBaseOffset will be removed in a future release
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.
------ WARNING #1 -  -----------------------------------------------------------
 File: ~/.m2/repository/org/clojure/clojurescript/1.12.116/clojurescript-1.12.116.jar!/cljs/core.cljs:56
--------------------------------------------------------------------------------
  53 |   , and \"global\" supported. "}
  54 |   *global* "default")
  55 | 
  56 | (goog-define
--------------------------------------------------------------------------------
 Parse error. conflicting @define tag
--------------------------------------------------------------------------------
  57 |   ^{:doc "Boolean flag for LITE_MODE"
  58 |     :jsdoc ["@type {boolean}"]}
  59 |   LITE_MODE false)
  60 | 
--------------------------------------------------------------------------------
nil
Closure compilation failed with 1 errors
--- cljs/core.cljs:56
Missing @define annotation

p-himik 2025-11-25T11:31:11.533389Z

Just to make sure - did you get the new CLJS version by upgrading shadow-cljs or by having both shadow-cljs and CLJS in your deps and upgrading only the latter? In general, I try to avoid having an explicit dependency on CLJS because of a great potential of all sorts of errors.

πŸ‘ 1
dnolen 2025-11-25T11:32:01.266199Z

@t.denley I'm not sure what shadow-cljs has to do to align w/ this release, maybe check in #shadow-cljs first - I don't think you can just change CLJS and expect it to work

πŸ‘ 1
scarytom 2025-11-25T11:35:36.166959Z

yes @p-himik, we have both shadow-cljs and CLJS in our deps.edn. We are running the latest release for both of them, but I guess shadow-cljs needs to catch up and make another release. Are you saying it is best practice to rely on a version of clojurescript that is provided transitively via the shadow-cljs dep?

scarytom 2025-11-25T11:36:08.976599Z

@dnolen thanks for the advice. I see now that this is a shadow-cljs issue, not a ClojureScript one. I'll raise this over in #shadow-cljs

thheller 2025-11-25T11:53:06.666559Z

will fix later. Haven't had a chance to check out the new cljs release yet.

πŸ‘ 1
thheller 2025-11-25T11:54:17.598089Z

I already infer the define typehint, so the extra jsdoc just adds it twice. https://github.com/thheller/shadow-cljs/blob/a819bbaad20b021d177f7b0b3564a5972b2da900/src/main/shadow/build/cljs_hacks.cljc#L707

p-himik 2025-11-25T12:02:01.413039Z

> Are you saying it is best practice to rely on a version of clojurescript that is provided transitively via the shadow-cljs dep? Kinda. The docs describe it as something like "make sure the versions you end up with are the same that shadow-cljs uses", but only because something else in your deps might be bringing in a different CLJS version. How to solve that on your end is up to you - you could explicitly depend on the same CLJS version (and some other libraries) that shadow-cljs uses, or you could depend on it transitively and check every other dependency that it doesn't bring in a newer CLJS version. And if something does, you can use exclusions. I use the latter approach because in practice it ends up being easier, especially given that I approach dependency updates as a task that must be executed carefully, where I check out all the changelogs, definitely changed dependencies of my dependencies, and often the changed code itself as well.

πŸ‘ 1
thheller 2025-11-26T10:11:22.805879Z

shadow-cljs 3.3.0 now comes with the cljs 1.12.116 version, just required a few minor tweaks to get :lite-mode stuff working

πŸŽ‰ 5
Casey 2026-02-12T10:52:00.647329Z

@t.denley Did you manage to resolve this? I am getting this same sun.misc.Unsafe::arrayBaseOffset related error, but I'm using the latest shadow-cljs and don't have any direct cljs references in my deps.edn

thheller 2026-02-12T11:02:38.921259Z

that is not an error. it is warning. you can just ignore it. if you get something else after those lines starting with WARNING: ... then they are likely completely unrelated. so post those if you have questions about that.

πŸ™ 1
Casey 2026-02-12T11:14:42.762419Z

No it was just the warning, I was conflating it. Will ignore it for now then. Thanks

Harold 2025-11-25T23:57:42.371549Z

brotli wins:

p-himik 2025-11-26T00:11:13.645669Z

One could wonder by how much it could be better if its static dictionary wasn't so overfitted to who knows what, with terms like "Holy Roman Emperor" or "coolfeet.php". :D

πŸ˜‚ 1
Harold 2025-11-26T00:15:22.210259Z

ha! Indeed. I'm seeing it beat gzip by similar ratios on several .js files. I'm honestly impressed. I also discovered today that github pages doesn't support it in any way, though they do transparently gzip uncompressed js that you upload and serve that if the browser can handle it. Maybe someday they'll do similar with brotli.

Chris McCormick 2025-11-26T00:48:45.405549Z

> though they do transparently gzip uncompressed js This is fairly standard practice on webservers these days, often just a single flag.

πŸ‘ 1
Brian Hicks 2025-11-26T01:04:19.720709Z

this is a combination of a nerd snipe and a wistful sigh about cool future stuff, but I wonder how much better it’s possible to get with custom dictionaries. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Compression_dictionary_transport