This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-18
Channels
- # announcements (6)
- # aws (1)
- # babashka (47)
- # beginners (50)
- # calva (65)
- # cider (4)
- # clj-commons (17)
- # clj-kondo (44)
- # clojure (150)
- # clojure-europe (41)
- # clojure-nl (4)
- # clojure-spec (1)
- # clojure-sweden (4)
- # clojure-uk (6)
- # clojurescript (15)
- # clr (1)
- # conjure (1)
- # core-async (7)
- # cursive (5)
- # datomic (12)
- # events (2)
- # fulcro (17)
- # graphql (12)
- # introduce-yourself (1)
- # jackdaw (5)
- # jobs (2)
- # lsp (52)
- # malli (5)
- # meander (3)
- # minecraft (2)
- # missionary (2)
- # off-topic (10)
- # other-languages (9)
- # reitit (9)
- # remote-jobs (1)
- # ring (8)
- # rum (7)
- # shadow-cljs (9)
- # sql (2)
- # tools-deps (20)
- # xtdb (12)
Is there a way to ignore unsupported escape characters in strings?
You can replace the unsupported characters using clojure.string/replace
then process your string
Hi, whats the best library for http requests?
https://github.com/lambdaisland/fetch wraps js fetch, but maybe you ment to not use fetch?
good to know, im glad i asked. is there a preferred library among clojurist? or is this the one?
No preferred lib. I actually prefer to just use js/fetch.
to replace fetch/axios in javascript?
I’m trying to run eval-str with this code snippet
(ns datacards.expression
(:require [cljs.js :refer [empty-state eval-str js-eval]]))
(eval-str
(empty-state)
"(+ 1 2)"
nil
{:eval js-eval}
#(print %))
But I get the following error:
{:error #error {:message ERROR, :data {:tag :cljs/analysis-error}, :cause #object[TypeError TypeError: Cannot read properties of undefined (reading ‘PLUS‘)]}}
I cannot figure out what the issue is.In a shadow-cljs project, when my cljs dependency has npm depencies (macchiato has a :npm key in project.clj and a package.json) how do I get shadow to install those npm modules? Do I have to manually install them in my projects package json?
I think that it should work automatically if the dependencies have correct declarations: https://shadow-cljs.github.io/docs/UsersGuide.html#publish-deps-cljs But people at #shadow-cljs would be able to answer for sure.
Thanks for the quick response. I'll ask in that channel. I think the link you provided is for publishing with shadow-cljs. The project that I'm requiring does not publish with shadow.
Once you add your npm dependency in package.json, restart the shadow cljs. npx shadow-cljs watch frontend-app-name
Doing the mentioned steps works for me
@U01BDUH28V7 Not what I was asking. I did receive an answer in the shadow-cljs channel. Unfortunately, unless a project includes npm key in their deps.edn, shadow doesn't pick them up. I had to manually copy their npm deps into my package json
ok, cool. Can you please share the thread link here as well. Few months back, I did read about shadow having npm package support however was not clear on usage. So i ended up adding package.json file (did npm install) and ran npx shadowcljs.
Sure thing. It seems their stance is you should go through npm for most things, which I like. Unfortunately, the project I am using (macchiato) doesn't used deps.end so shadow couldn't find the required npm packages it needed. https://clojurians.slack.com/archives/C6N245JGG/p1642547355150300