Fork me on GitHub
#clojurescript
<
2022-01-18
>
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

https://github.com/lambdaisland/fetch 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?

athomasoriginal13:01:55

No preferred lib. I actually prefer to just use js/fetch.

jason poage03:01:45

to replace fetch/axios in javascript?

Paul11:01:08

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.

berkeleytrue22:01:41

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?

p-himik23:01:58

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.

berkeleytrue23:01:05

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

berkeleytrue16:01:30

@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

1
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.

berkeleytrue16:01:15

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

👀 1
thumbsup_all 1