Fork me on GitHub

Hi @dnolen I am just checking Clojurescript open issues. There are close to 2000 issues. I hope a lot of aging tickets are corner cases/low priority items. Was it assessed how many of them are critical and production breaking ? Can I bet my next billion dollar super duper awesome app or website on Clojurescript? Does Cognitect provide commercial support?

Alex Miller (Clojure team)14:02:14

Any large open source project has a lot of open old bugs, that's just software. There are several billion dollar companies built on Clojure and ClojureScript so I think the answer is yes there. Cognitect does not currently provide commercial support contracts. We used to, and we sold a few, but no one ever found anything that they needed us to fix.

👌 1
😁 1

True for any large open source project, except elixir which currently has Always amazed how they manage to keep it that low.

Alex Miller (Clojure team)14:02:45

By the nature of Clojure and ClojureScript, being Lisps, the scope of things you can fix yourself if absolutely needed is large

Alex Miller (Clojure team)14:02:04

My guess is that if you had an urgent bug, you'd probably find far better free support here on this Slack than you'd get from most commercial support contracts

metal 1
💯 1

Our company is currently deploying two largish, mission-critical apps that depend on Clojure and ClojureScript, and I'd say it's not merely reliable, it's a huge advantage to us.

👍 2

Hi Alex, that was a very quick response. Thank you very much.


@manas.marthi I think the user base is large enough (and it used for serious work) so truly critical bugs are usually communicated and addressed in a reasonable amount of time.


also probably just need to do some gardening of some old stuff 😛

Lone Ranger16:02:10

I've got a figwheel cljs project that's big enough that hot reloading is failing because the bootstrapping/initialization sequence is still running before all the dependent files reload. Yes, yes, I know that it should just be engineered better, but does anyone have a band-aid?


Slowing reloads down Depending on your environment Figwheel may reload files too quickly. If it does reload too soon it may be reloading the old file before it has changed. This is not an ideal experience. For example you may be working with a Jekyll site where Jekyll copies all the assets of the site to a _site directory and serves the site from there. Jekyll currently doesn’t copy the files fast enough to beat Figwheel’s reload time. You can slow down this reload time with the :wait-time-ms option. It defaults to 50 milliseconds. You can make each reload wait a second after each compile by setting :wait-time-ms to 1000.


Found this on the documentation

Lone Ranger16:02:59

For now I've disabled hot reload but that's such a bummer


Play online with CLJS and Reagent in CodePen via #scittle :) Thanks @admin055


@goomba I think Figwheel has a hook so you can wait for reload, you can probably conditionalize it

Lone Ranger17:02:02

Yeah, I was using the ^:after-load hook but it doesn't seem to actually wait until ALL dependent files are reloaded. Not sure how to conventionalize on all dependencies reloaded, although I suppose (a/<! (a/timeout 2500)) or something would be a hack worth trying


Can someone tell me how "format" works on clojurescript? I would like to format numbers and dates.


I found goog clojure libraries to format numbers, and tick.core library to format dates.


What I did not find is an interface where I can register tick.core to format dates and goog clojure to format numbers.


I guess this must be commonly needed feature.


When you say you want to “register” one of those libraries to format dates and numbers, where exactly are you needing formatted values to go? Are you formatting them for display on a webpage? to the console? the REPL? storing them in a database? is this for “over the wire” data as part of JSON or transit?

Alex Miller (Clojure team)17:02:58

it's Friday and if you're looking to slack off for a few minutes, why not answer the 2022 Clojure survey? takes 5-10 min.


Wondering if anyone has seen this error before in the browser from their compiled CLJS: Uncaught SyntaxError: Invalid left-hand side in assignment. It’s happening at this line in my output file, bundle.js:

38472       "development" = goog.define("process.env.NODE_ENV", "development");
… which, of course, is invalid. It seems to be happening while I run my :bundle-cmd. Here’s my full compilation call:
   {:output-dir    "public/cljs",
    :output-to     "public/cljs/prebundle.js",
    :asset-path    "cljs",
    :main          "cljs.user",
    :install-deps  true,
    :optimizations :whitespace,
    :target        :bundle
    :bundle-cmd    {:default ["esbuild" "public/cljs/prebundle.js"
                              "--bundle" "--outfile=public/cljs/bundle.js"]}
    :npm-deps      {"react"             "17.0.2",
                    "react-dom"         "17.0.2",
                    "@react-spring/web" "9.4.2"}})
As you can see, I’m running esbuild on prebundle.js to produce bundle.js. The weird thing is that if I look at the same line in prebundle.js, then I see this:
Seems like my :bundle-cmd is replacing process.env.NODE_ENV with the literal string "development", and then trying to assign to it. I realize this could be esbuild messing up… but I wanted to ask if anyone’s run into this before.


Upon further experimentation, I’m realizing this only happens with :optimizations :whitespace. The other optimization levels work properly. Does anyone have any insight into why this happens?


Resulted in a new error, though. This time from the Clojure process that’s doing the compilation.

Feb 25, 2022 12:01:42 PM println
WARNING: public/cljs/inferred_externs.js:15:0: WARNING - [JSC_UNDEFINED_EXTERN_VAR_ERROR] name goog is not defined in the externs.
  15| goog.dependencies_;


this is standard practice in JS to replace NODE_ENV. you are never expected to assign it in your program.


also don't use :whitespace ever. at the very least you need :simple better even :advanced


Hello firends, I am trying to integrate clojurescript in my frontend, my backend being python and using node/socketio for websockets. What library would you recommend to talk over websockets with socketio from my clojurescript? Sente seems to expect my backend to also run Sente, or does it? Thank you 🙂


> Sente seems to expect my backend to also run Sente That's correct. There are probably JS clients for socketio that you can use from CLJS via interop. And if not, you can always just use a raw WebSocket connection, without any libraries.


okay, thank you, I will try


Wow, perfect, I will check that also, as soon as I have my other problem fixed 😉 Thank you @U0JUR9FPH. Maybe you guts can help me also with the other thing I posted in the mainchannel :))


I am really struggeling to get Calva to connect to my app.... I am serving my javascript code from another webserver.... I have this in my shadow-cljs.edn

{:app {:target :browser
        :output-dir "../public/js"
        :asset-path "/js"
        :modules {:main {:entries []}}}}
The shadow-cljs watch app is working and when I navigate to the file where I server the main.js everything seems to work fine. When I save my source.cljs file, the code gets "hot-reloaded". But when I Calva jack in to my :app and select browser repl, it wants me to connect to localhost:9630 for the js execution environment. When I do, it also works, but when I insert
(js/alert "hello world")
the alert will then appear in that localhost:9630 tab and not, where my app is running. Any Ideas?


That sounds like a question for #calva

🙌 1

ok, thank you, I will repost it there 🙂

👍 1
eccentric J23:02:56

Can you paste your whole config please?