This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-14
Channels
- # aleph (3)
- # announcements (1)
- # babashka (36)
- # babashka-sci-dev (4)
- # beginners (62)
- # biff (2)
- # calva (13)
- # cider (4)
- # clj-kondo (6)
- # cljdoc (17)
- # clojure (142)
- # clojure-dev (6)
- # clojure-europe (62)
- # clojurescript (20)
- # core-async (26)
- # cursive (18)
- # data-oriented-programming (9)
- # data-science (1)
- # datahike (18)
- # events (4)
- # fulcro (4)
- # graalvm (2)
- # hyperfiddle (15)
- # interop (1)
- # jobs-discuss (8)
- # leiningen (2)
- # lsp (91)
- # malli (1)
- # missionary (11)
- # nbb (65)
- # off-topic (50)
- # practicalli (2)
- # programming-beginners (4)
- # re-frame (18)
- # remote-jobs (1)
- # shadow-cljs (53)
- # spacemacs (1)
- # specter (2)
- # sql (17)
- # tools-build (63)
- # web-security (1)
- # xtdb (15)
Q: I upgraded to latest shadow and I’m getting a new release build error: Invalid Regular Expression. Anyone seen/fixed this? more in thread….
it’s because of this line/lib https://github.com/mesqueeb/case-anything/blob/production/src/utils.ts#L7
ES6 does support unicode regexes so I’m trying to figure out the correct shadow config to support this for advanced compile
this seems to suggest that only /u style regexes are supported in ES6 https://stackoverflow.com/questions/280712/how-can-i-use-unicode-aware-regular-expressions-in-javascript
I’m not actually using that lib (it’s a transitive npm dep) so I could trying excluding it as a fix
hmm, case-anything is a dep of remirror which is the lib I need. I could also try excluding it there
@U0509NKGK something to watch out for if you are using remirror
thanks Steve! we've ended up going full tiptap 🙂
the closure compiler is sometimes a little overeager when it comes to validating code
there don't seem to be any open issues currently https://github.com/google/closure-compiler/issues?q=is%3Aissue+is%3Aopen+Invalid+Regular+Expression
Uncaught SyntaxError: Invalid regular expression: /^[a-zà -öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà -öø-ÿ]+|[a-zà -öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà -öø-ÿ])/: Range out of order in character class (at main.js:3287:266)
when I look at that line in the generated js, it seems to be from the case-anything transitive npm dep
much appreciated. I’m glad I only spent 3 hours before I decided to wait to ask you 🙂
When working with JS files within a CLJS project, I find that changing those JS files results in shadow-cljs reloading them, along with the CLJS files that use them. However: • Still the old code is used - so I have to refresh the page to make it take the changes into account • Other JS files that use the changed JS files don't seem to be reloaded (according to what I've seen in the shadow-cljs' WebSocket packets), so I assume even if the previous item is fixed, it still won't work correctly in some cases Is it possible to fix the above?
@p-himik define JS file. reloading should only sort of work for ESM code. commonjs code can't really be reloaded
not a whole lot of people use many JS files directly (me included), so there might be bugs or problems
and as always its directly exposed to and relying on the closure compiler. they frequently change how they rewrite stuff and I might miss those changes if they need adjustment on the shadow-cljs side
> define JS file
I'm still a bit hazy on this I'm afraid. Ones that use const {x} = require('/something');
- you recommended this approach to me some time ago.
thats commonjs. its treated like node_modules
files so less reliant on closure compiler rewriting
Only superficially, and the most recent piece of knowledge that I have is that people from the React ecosystem have apparently figured out how to reload Reacts apps properly, without even losing any state. But that's probably not relevant here at all.
well, yes its possible. but it is much more complicated than just "eval this new code over the old one"
@p-himik fwiw, I also started playing with react fast-refresh. I :require
some JS here and there and sometimes it reloads sometimes it doesn't haven't really dug into that too deep. It's cool to re-eval a react component from the repl and have only the relevant components reload.
To get used to fast-refresh I even turned off file-save and only used eval from my ide to change components, it's quite instant, whereas file save reload can start adding up when the files get bigger. Although forgetting to save a file when you inevitably refresh your browser/state sucks, so I'd say having both is nice 🙂
Extended the hx defnc macro as explained here: https://github.com/lilactown/helix/blob/master/docs/experiments.md#fast-refresh.
I’m trying to use a js lib that uses wasm: https://github.com/lekoala/barcode-detector-zbar and getting:
Failed to inspect file
/Users/mk/dev/ductile/node_modules/zbar.wasm/dist/zbar.wasm.bin
it was required from
/Users/mk/dev/ductile/node_modules/zbar.wasm/dist/load-browser.js
Errors encountered while trying to parse file
/Users/mk/dev/ductile/node_modules/zbar.wasm/dist/zbar.wasm.bin
{:line 1, :column 0, :message "Character '' (U+0000) is not a valid identifier start char"}
I’ve read https://github.com/thheller/wasm-pack-cljs but failing to understand how to adjust it for this use case. Any pointers would be appreciated. 🙏https://unpkg.com/browse/[email protected]/dist/load-browser.js even specifically mentions webpack in the comment