This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-07
Channels
- # adventofcode (114)
- # announcements (3)
- # aws (5)
- # babashka (62)
- # beginners (111)
- # calva (4)
- # cider (20)
- # clara (5)
- # clj-kondo (1)
- # cljs-dev (9)
- # clojure (255)
- # clojure-europe (75)
- # clojure-italy (10)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-uk (6)
- # clojuredesign-podcast (5)
- # clojurescript (34)
- # community-development (28)
- # conjure (1)
- # cursive (3)
- # data-science (1)
- # datavis (1)
- # datomic (4)
- # figwheel-main (1)
- # fulcro (14)
- # graalvm (1)
- # graphql (8)
- # integrant (4)
- # introduce-yourself (2)
- # jobs (2)
- # juxt (4)
- # kaocha (2)
- # malli (6)
- # membrane-term (53)
- # mount (2)
- # nextjournal (2)
- # off-topic (27)
- # pathom (11)
- # polylith (3)
- # portal (11)
- # reagent (4)
- # reitit (4)
- # remote-jobs (1)
- # reveal (14)
- # shadow-cljs (22)
- # tools-deps (24)
- # vim (6)
- # xtdb (19)
Are there any tutorials on how to integrate Firebase (real time database) with Clojurescript on frontend? I'm using firebase js sdk 9.6.0, installed via npm, need to do auth and signInAnonymously - but I'm just really struggling with it all. I don't know if it has to do with version 9, obviously a few things might have changed, and all the tutorials I've found so far use versions below 9.
Hey! Yeah, Firebase is an atypical NPM package. Are you using Figwheel-Main or Shadow?
Hi, I am using Shadow. I should say that I was able to get it going using version 7 (firebase js sdk) but version 9 I just couldn't get to work. I'm relatively new to clojurescript so it could be that I simply don't know what I am doing 🙂
I’m also using firebase sdk v9 right now, and did struggle with cljs interop. I am not sure if my experience can be of any help, but please share any errors you’ve come across (and if possible, related code)
@nedim version 9 is tricky even if you are experienced with Firebase. Let me dig up some pointers.
@nedim have you seen this? https://clojurians.slack.com/archives/C6N245JGG/p1635137311018500?thread_ts=1634815794.002200&cid=C6N245JGG -> I use figwheel, so I cannot confirm this works.
If you want the figwheel way, I can also provide that, but I doubt you want to swap out tooling
@U6GNVEWQG I had not seen that, thank you so much! I'll give it a try and Shadow is just fine, like you said, prefer not to swap out tooling.
Totally. I wouldn’t suggest moving tooling. Just wanted to give you confidence that what you’re looking to do is achievable 🙂 Good luck!
What would be a good way to fire an even when the user is "done typing"? IIRC closure library has stuff like rate limiting and delays but... not sure about this particular variant.
yesss thanks
Good day! I'm after an opinion on which date/time library to use in a new cljs (node) project. I see there are a few out there. Just after doing basic is-after?/is-before? type stuff starting with js/Dates. Any thoughts?
I have used date-fns
and like the simplicity of it - when there is need to do something textual like “three days ago” 😄
I guess you already have seen this brand new thing: https://clojurians.slack.com/archives/C06MAR553/p1638727932251500
Yeah - I think it makes sense to keep it simple for now. I can always add a library for fancier stuff later. I like the look of juxy/tick FWIW so far from my research.
Oh, I guess I posted the wrong thing (wrong thread, Date, not Math) - trying to multi task posting + having lunch 😆
luxon is the best js library I've used for dates, better than moment or date-fns or builtin
@nedim latest Firebase doesn't currently work w/ plain ClojureScript, as Firebase structure changed (package.json "exports"
) and we need to address it - shadow-cljs I think probably works in this case
Hi, thank you for your response, I am using Shadow CLJS but still I couldn't get it to work. I am new to clojurescript so I wasn't sure if it's simply me not knowing what I'm doing, or if it's an issue with version 9 and compatibility with cljs. I ended up going back to version 7 (because I use that in production with regular javascript) and got it working.
Hi, I am trying to PUT a file to Google Cloud Storage via cljs-http but I am getting Access to XMLHttpRequest at ... from origin '
I have got no problem when using CURL or Clojure HTTP Client.
This is the cljs code:
(defn send-file [data presigned-url]
(let [req {:request-method "PUT"
:headers {"content-type" "application/octet-stream"}
:body data
:with-credentials? true}
req-with-url (merge req (http/parse-url presigned-url))
xhr (js/XMLHttpRequest.)]
(http-core/xhr req-with-url)))
cors error appears only when you make request from browser (not server), as it is browser who blocks the request in case server doesn't allow it via headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
I know I just wanted to make sure that the same request is fine outside of the browser. But does it mean that Google does not allow me to upload the file from the browser?
> But does it mean that Google does not allow me to upload the file from the browser? yes.
This does not seems to be CLJS problem - I must configure a bucket according to this. https://cloud.google.com/storage/docs/cross-origin