This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-02
Channels
- # announcements (3)
- # aws (2)
- # babashka (60)
- # beginners (21)
- # cljs-dev (35)
- # cljsrn (3)
- # clojure (53)
- # clojure-android (2)
- # clojure-australia (3)
- # clojure-europe (45)
- # clojure-france (4)
- # clojure-nl (4)
- # clojure-uk (6)
- # clojurescript (33)
- # core-typed (1)
- # cursive (13)
- # datomic (6)
- # duct (1)
- # emacs (2)
- # fulcro (10)
- # introduce-yourself (3)
- # jobs (2)
- # jobs-discuss (13)
- # leiningen (1)
- # malli (19)
- # missionary (63)
- # music (1)
- # off-topic (21)
- # pathom (3)
- # polylith (18)
- # practicalli (12)
- # proletarian (1)
- # reagent (40)
- # reitit (23)
- # releases (1)
- # remote-jobs (1)
- # ring (14)
- # ring-swagger (1)
- # shadow-cljs (13)
- # sql (30)
- # testing (27)
- # tools-deps (31)
- # vim (10)
- # xtdb (4)
I have a question regarding Clojure(Script) regexes, which is that the following regex works fine in Clojure, but not in ClojureScript:
#"<(?!\/?(a|em|i|strike|u|strong|b)(?=>|\s.*>))\/?.*?>"
In ClojureScript it gives an error: SyntaxError: Unexpected token ‘?’
So are CLJ and CLJS regexes different? And if so does anyone know in what way?Not a cljs expert, but since I'm around: I believe cljs regexes are native Javascript regexes (per https://cljs.github.io/api/syntax/regex). clj regexes are native Java regexes. The two are indeed different. Don't know how off the top of my head, but searches for java vs. js regex will probably be fruitful.
Yes ClojureScript regexes are just JavaScript regexes. I find https://regex101.com/ useful for validating regexes. It lets you switch between different languages’ implementations and gives you useful errors. There’s also https://github.com/lambdaisland/regal which provides consistent semantics between Clojure and ClojureScript
Is:
(js/process.argv.slice 2)
considered valid CLJS
instead of (.slice js/process.argv 2)
?I vaguely recall js/x.y.z
syntax being called a “mishap” in some conversation. But it will never go away… as one would expect 😉
wow, I was going to ask something exactly like that. I'm using a lib that has some nested objects, toyed around with the requires and nothing worked until I tried shaka-player/net.NetworkingEngine.RequestType.LICENSE
. looks very weird having lots of dots to the right of the slash, but it's the only thing that worked
just be aware that syntax doesn't generally work with advanced compilation https://clojure.atlassian.net/browse/CLJS-3315 . not likely to be an issue on node ofc
Oh, that's interesting! @U05224H0W is that issue relevant for shadow-cljs?
it might be a problem when inside a core.async go. that loses type hints all over the place
repro containing one build using cljs.build.api and one using shadow - both show the problem: https://github.com/henryw374/data_readers.cljc-testing/tree/master/dot-test
Indeed, can reproduce it with the latest [email protected]
ah just foo.bar
yeah thats a problem. the initial question here was about js/foo.bar
which should be fine
as well as some-npm-alias/foo.bar
. just a bare foo.bar
is a problem which needs to be fixed from the compiler side
ah, quite a subtle distinction then. I've just stopped using any foo.bar
style for now.
Would you recommend reagent/reframe or Helix… for longevity. Also I’m not all that experienced with JavaScript. I know enough to know what’s going on and I have some ver pay basic experience with reframe. I’m wondering if I’d learn more by using helix and having to work through the react tutorials to really get a grip on what’s taking place?