This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-12
Channels
- # aleph (6)
- # announcements (11)
- # babashka (24)
- # beginners (127)
- # calva (33)
- # chlorine-clover (5)
- # cider (7)
- # clara (9)
- # cljs-dev (54)
- # cljsrn (5)
- # clojure (61)
- # clojure-australia (8)
- # clojure-bay-area (11)
- # clojure-europe (36)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-spec (6)
- # clojure-taiwan (1)
- # clojure-uk (8)
- # clojurescript (94)
- # code-reviews (2)
- # community-development (6)
- # conjure (26)
- # core-typed (1)
- # cursive (3)
- # datahike (4)
- # datomic (14)
- # events (1)
- # graphql (1)
- # honeysql (49)
- # introduce-yourself (5)
- # jobs-discuss (15)
- # kaocha (6)
- # lsp (8)
- # malli (1)
- # meander (5)
- # nrepl (1)
- # off-topic (21)
- # other-languages (1)
- # pathom (13)
- # podcasts-discuss (1)
- # polylith (1)
- # reitit (16)
- # shadow-cljs (50)
- # spacemacs (11)
- # sql (11)
- # tools-deps (21)
- # unrepl (1)
- # vim (9)
Does anyone know where is the github repo for the re-com site - https://re-com.day8.com.au/#/layout? I saw some unbalanced brackets in the doc
Also, if you click on any specific component, the top of the page will have two links - one for the component source code, and the other for the page source code.
I don't know if it is equivalent, but I'm always using https://cljs.github.io/api/
Yes, this one I know of. The main strength of ClojureDocs (to me) is the community provided recipes. I find them super useful. So I was just wondering if there is a similar site for CLJS.
Nice. Did not know about the ClojureDocs integration in CIDER. Just tried it out. Strangely, it does not have documentation for loop
. Is it using an older snapshot?
Hola. I'm using shadow-cljs and the generated source-map appears to map all output line columns to 1, so the mapping doesn't work. For instance, the output of decode-source-map:
{:version 3,
:sources ["zprint/finish.cljc"],
:mappings {:537 ["1 => zprint/finish.cljc 336:1 p__41998"
"1 => zprint/finish.cljc 336:1 cljs.core.nth"
"1 => zprint/finish.cljc 336:1 vec__42000"
"1 => zprint/finish.cljc 336:1 vec__42000"
"1 => zprint/finish.cljc 336:1 vec__42000"
"1 => zprint/finish.cljc 340:19 focus-begin"],
:238 [""],
:419 ["1 => zprint/finish.cljc 285:1 s"
"1 => zprint/finish.cljc 290:3 s"
"1 => zprint/finish.cljc 290:9 nl-split"
"1 => zprint/finish.cljc 290:18 nl-split"
"1 => zprint/finish.cljc 290:18 nl-split"
"1 => zprint/finish.cljc 290:19 clojure.string.split"
"1 => zprint/finish.cljc 290:40 clojure.string.split"
"1 => zprint/finish.cljc 290:40 clojure.string.split"
"1 => zprint/finish.cljc 290:45 s"],
...
Anyone got an idea what the problem might be? In the browser I can't jump to the right line, and I suspect it is due to this. I've compared the source-map with one generated by boot
, there it is fine. The compiler option :source-map true
is the same for both.
There are clearly several entries that aren't column 1? so "all output" doesn't seem accurate?
are you looking at the wrong "column"? the one that references the sources index? that'll always be 1 since there is only one file?
Those are the line numbers of the output file, if I understand it correctly. And then inside those value lists you see all of them start with "1 => ...", those should be the columns.
I'll generate a working one. And I think I just found a shadow-cljs version where it worked. Perhaps I can manually bisect my way to where it changed.
feel free to set up a reproducible repo. As far as I can tell source maps work perfectly fine
Yeah, I can't reproduce what I think I just saw. Same behaviour now with the older shadow-cljs version. I'll dig a bit deeper and post again in the other channel.
Any thoughts on why this:
λ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "RELEASE"}}}' -M -m cljs.main --repl
Downloading: org/clojure/clojurescript/maven-metadata.xml from central
ClojureScript 1.10.844
cljs.user=> (ns foo.bar)
Either hangs indefinitely or throws this:
Execution error (InternalError) at (<cljs repl>:1).
too much recursion
I can also reproduce it on a different machine that's running a different OS, Java version, and even CPU architecture. Really weird.
OK, this is browser-related, maybe a browser extension messing with something. I can reproduce the issue with Firefox, but not with Safari.
When it hangs, you should be able to pause JS execution and see the current stack trace.
Oh, yes, good tip, will try that. :thumbsup::skin-tone-2: ...except my browser crashed when I tried doing that. :P
FWIW, I managed to come up with a minimal repro including a stack trace (reproducible with multiple browsers): https://github.com/eerohele/cljs-repl-blow-stack
I can reproduce it now as well, but only when the initial page was left there an the REPL session has been recreated.
It seems that the problem is due to clojure.browser.repl/bootstrap
being called multiple times. And goog.require
ends up calling itself.
Great to hear someone else was able to reproduce it as well. Thanks for trying it out! I also filed an http://ask.clojure.org question about this issue, in case you feel like weighing in there: https://ask.clojure.org/index.php/10602/evaluating-an-ns-form-clojurescript-repl-throws-rangeerror
Hi
I’m on 1.10.844
and I have an issue with
Looks like it is complied from
https://github.com/google/closure-library/blob/ff84fa63944b428da36006ec940b3b349a8d66d3/closure/goog/net/cookies.js#L167
to
hba.set = function(n, t, h) {
var e = !1;
if ("object" == typeof h) {
var l = h.Lh;
e = h.Mh || !1;
var r = h.domain || void 0
, b = h.path || void 0
, u = h.Lg
}
if (/[;=\s]/.test(n))
throw Error('Invalid cookie name "' + n + '"');
if (/[;\r\n]/.test(t))
throw Error('Invalid cookie value "' + t + '"');
void 0 === u && (u = -1),
this.Oc.cookie = n + "=" + t + (r ? ";domain=" + r : "") + (b ? ";path=" + b : "") + (0 > u ? "" : 0 == u ? ";expires=" + new Date(1970,1,1).toUTCString() : ";expires=" + new Date(Date.now() + 1e3 * u).toUTCString()) + (e ? ";secure" : "") + (null != l ? ";samesite=" + l : "")
}
As you can see some params are renamed (see argument h
) like h.Lh
Is it expected?oh i'm following you now. It's not the arguments to the function but the properties on an options object that are being renamed
from cljs, a pass it as #js {:maxAge 999 :path "/"}
I’ve also tried to construct
but it didn’t help
I think you can hot-fix it in your own code with
(defn ^:export f [^js x]
(.-maxAge x))
You don't have to use it - it should simply create an extern for maxAge
thus preventing it from being renamed. But I haven't tested this approach.
Thanks!
Maybe it is better to write externs manually then?
For
Not a fan of this idea though
I wouldn't do that myself. I would simply use that workaround above and create an issue on Closure's GitHub that you linked.
How to properly construct it? I’ve tried this, but it feels wrong:
(let [cookie-options (SetOptions.)
_ (gobj/set cookie-options "maxAge" (* 60 60))
_ (gobj/set cookie-options "path" "/")]
(.set goog.net.cookies
"checkout-data"
"xxx"
cookie-options))
And I think you can't use gobj/set
here because it has to be munged. Just (set! ...)
.
or write some Closure JS and import that etc. this is relatively well supported - how transit-js -> transit-cljs works
But
is a type, no?
Why wouldn't using
(doto (SetOptions.)
(set! -maxAge 3600)
(set! -path "/"))
work?But this works just fine on my end, in :advanced
:
(ns app.core
(:require [goog.net.Cookies :refer [SetOptions]])
(:import ( cookies)))
(.set cookies "checkout-data" "xxx"
(doto (SetOptions.)
(set! -maxAge 31536000)
(set! -path "/")))
Cookies.SetOptions
is defined as an interface here - so you can supply anything that matches
But here https://google.github.io/closure-library/api/goog.net.Cookies.SetOptions.html it says record
and not interface
.
Not sure if Closure treats the terms as interchangeable or there's a discrepancy in documentation.
In this case - seems like it. And I can find neither documentation nor usage examples on how @record
and @interface
are different for GCC.
pretty interesting news - https://workspaceupdates.googleblog.com/2021/05/Google-Docs-Canvas-Based-Rendering-Update.html
I wonder if that just means they're going to use flutter. I think flutter was already canvas based.
FWIW, I managed to come up with a minimal repro including a stack trace (reproducible with multiple browsers): https://github.com/eerohele/cljs-repl-blow-stack