Fork me on GitHub
Brandon Olivier02:01:09

Is there a way to ignore unsupported escape characters in strings?

Job s Gateri05:01:56

You can replace the unsupported characters using clojure.string/replace then process your string

jason poage03:01:24

Hi, whats the best library for http requests?

kardan06:01:14 wraps js fetch, but maybe you ment to not use fetch?

jason poage09:01:14

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.

jason poage03:01:45

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]]))

  "(+ 1 2)"
  {: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: 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.

Pradeep B14:01:32

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

Pradeep B04:01:38

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.

👀 1
thumbsup_all 1