This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-26
Channels
- # babashka (16)
- # beginners (38)
- # calva (11)
- # cider (35)
- # clj-kondo (3)
- # clj-otel (3)
- # clojure (28)
- # clojure-europe (11)
- # clojure-gamedev (14)
- # clojure-norway (42)
- # clojure-spec (4)
- # datalevin (10)
- # datomic (2)
- # emacs (8)
- # events (2)
- # fulcro (3)
- # gratitude (5)
- # hyperfiddle (3)
- # kaocha (1)
- # nbb (14)
- # nrepl (12)
- # portal (1)
- # re-frame (5)
- # releases (1)
- # shadow-cljs (36)
- # squint (167)
I just released version 2.25.0 which includes a fairly significant change in how ESM from npm is processed. hopefully nobody will notice a thing and everything will continue to work, but history has taught me that there is so much weird code on npm that I probably didn't account for all of it.
please give it a try if you are using a lot of npm packages, especially if they contain ESM code.
if something breaks you can set :js-options {:use-babel true}
to revert back to the old behavior, but report first if you do so as I plan to remove that option sometime in the future.
Upgrading to this version today in our dev environment. 👍
hello, I'm getting the following error when going from 2.24.0 to 2.25.0:
Closure compilation failed with 2 errors
--- node_modules/primereact/primereact.all.esm.js:9270
Dynamic import expressions cannot be transpiled.
--- node_modules/primereact/primereact.all.esm.js:17407
Dynamic import expressions cannot be transpiled.
use-babel
works
├── [email protected]
https://registry.npmjs.org/primereact/-/primereact-9.5.0.tgzok that one is sort of expected. it never really worked, it just failed silently and blows up at runtime
import('quill').then(function (module) {
if (module && DomHandler.isExist(contentRef.current)) {
if (module["default"]) {
// webpack
quill.current = new module["default"](contentRef.current, configuration);
} else {
// parceljs
quill.current = new module(contentRef.current, configuration);
}
initQuill();
}
I'll see about making it fail silently again I guess? let me think about it. thanks for the report.
potentially. if you use (:require ["primereact" :as p])
and then p/Accordion
or :refer (Accordion)
consider using (:require ["primereact/accordion" :as Accordion])
instead
(:require ["primereact" :as p])
will include every single component and make the build rather large
each dir there appears to be one component and at least the editor is the one trying the dynamic require from above
thanks, yes we were requiring the .all.esm module to convert the components, we'll change that
@thheller hi, a question about the Shadow Remote API - I'm not sure how much it's supposed to be used "externally" or if it's only supposed to be used by internal stuff, but basically I found a situation where it breaks something:
Basically, when a result is :op :eval-compile-error
, and I have something that's not transit-serializable, I don't get a response on the websocket - as an example, if I send an :op :cljs-eval
with the code (do; #"regex" #'some-invalid-var)
I never get a response on the websocket (that is, I never get the :op :eval-compile-error
on the API) and I get an error on the console that Shadow is running with: RuntimeException java.lang.Exception: Not supported: class java.util.regex.Pattern
.
I believe this is because when the remote API sends back a result with the error (basically, that it's unable to resolve var: some-invalid-var) it also sends back the offending form that was evaluated, and that contains the regexp which is not serializable by transit
I get
{:op :eval-compile-error, :ex-client-id 1, :ex-oid "8ec63e28-c811-4b33-a335-d0b49b631128", :report "[line 1, col 34] Unexpected EOF while reading item 1 of list, starting at line 1 and column 1.\n", :from 36}
?After
{:op :cljs-eval :to 36 :input {:code "(do; #\"regex\" #'some-invalid-var)" :ns 'cljs.user}}
note sure how you'd get to the regexp error since this is an EOF error? the form is incomplete?
in general shadow.remote will never send any object over the wire as transit? not sure how you are getting it to that point?
ah I suspect you just sent {:op :cljs-eval :to 36 :input {:code (do; #"regex" #'some-invalid-var) :ns 'cljs.user}}
or some form of it over the websocket? ie. :code
as not a string but the actual "form"?
I'd suspect that would blow up in various forms since it already fails at the websocket read, so well before even getting to shadow.remote?
Oh, sorry!
I sent the invalid form, that ;
is a test I was doing
The right OP should be: {:op :cljs-eval :to 36 :input {:code "(do #\"regex\" #'some-invalid-var)" :ns 'cljs.user}}
(yeah, I know, it's kinda an obscure thing I found 😄)