57 questions
1
vote
1
answer
75
views
How to us math.js with clojurescript correctly?
Using math.js with clojurescript unsuccessfully. Please comment how to access the function of math.js with clojurescript correctly.
Error lines
1. product (math/dot v1 v2)]
2. Ainv (math/inv A)]
...
1
vote
2
answers
95
views
How to use js-pytorch with clojurescript on MacOS?
Using js-pytorch with clojurescript unsuccessfully. Please comment how to fix the installation issue of js-pytorch with clojurescript
execute in calva-repl:
(ns server.ros2
(:require ["js-...
2
votes
3
answers
144
views
Are there any way to treat Javascript methods like ClojureScript functions?
I like ClojureScript, but to interop between CLJS and Javascript is difficult. I would like to create a function that can perform date culculations in arbitrary units, such as the following. But this ...
0
votes
2
answers
133
views
Shadow-cljs requiring react-select Creatable component
Currently I'm requiring using ["react-select" :default Select] in order to create a component:
(def dropdown-standard (ra/adapt-react-class Select)) (this works perfectly)
I want to access ...
1
vote
1
answer
156
views
Implementing a graph in clojurescript
I have been trying to implement a graph in clojurescript , I am using c3.js library for the implementation and it’s failing to render the graph ,
I earlier got errors wrt c3.generate(), but even after ...
-1
votes
2
answers
117
views
Kafka consumers in Clojurescript lang
Is there a way to create kafka consumers in a clojurescript app that I am trying to create. My kafka cluster is at AWS MSK which is configured to use SASL_SSL/IAM auths. And my client-side application ...
0
votes
1
answer
563
views
How to import a shadow-cljs project into another shadow-cljs project with a different configuration
I currently have 2 shadow-cljs projects with 2 different ways to manage their dependencies to npm libraries.
One uses the default shadow-cljs.edn configuration :js-options {:js-provider :shadow}, we ...
1
vote
1
answer
901
views
How to install and run shadow-cljs in an existing project folder while on macOS?
I am trying to install shadow-cljs in a MacOS Monterey 12.5. I am new to the Apple ecosystem, to npm, and Clojure/ClojureScript stack. This a new world for me.
This is the project folder, as you can ...
1
vote
2
answers
2k
views
Why is shadow-cljs returning this error message on "Stale Output"? How to guarantee the watch for this building is running?
I am new to Clojure and not a pro in Javascript. I am watching the free part of the course on Reagent.
Following the instructions on the course's repo, after doing the git clone and the npm install, ...
0
votes
1
answer
1k
views
How to handle stale state and get the latest value of it inside a function in react?
how can I get the latest value of config in doSomething function? Do I need to put all the state values to a ref and then access it everywhere with the latest value? Is there a better/alternative way ...
0
votes
1
answer
144
views
Unclear error from react-leaflet with shadow-cljs
I'm getting this error message when I compile code for production and deploy to server but not getting it locally. I'm stumped as to why I can't re-produce locally
Uncaught TypeError: Cannot read ...
2
votes
1
answer
337
views
Using ReactNative External library in ClojureScript Project - Syntax
I am trying to use react-native-swipe-list-view inside clojurescript. But I am having some trouble in converting documented js code in cljs code.
Documentations:
import { SwipeRow } from 'react-native-...
1
vote
1
answer
1k
views
CLJS: Setting a JS property to the result of calling a method on it
I'm looking to modify some existing text in a web app, which I'm accessing with expressions like this:
(.-innerHTML (.getElementById js/document "myElementId"))
What I specifically want to ...
1
vote
1
answer
351
views
Cannot detect Metamask login using ClojureScript
I’m a ClojureScript beginner and I am trying to connect my app to Metamask wallet.
In the past I successfully did it on a pure JS project with the following code:
import Web3 from "web3";
...
0
votes
3
answers
736
views
Pedestal Doesn't serve static resource
I am trying to build on the Pedestal tutorial app available here.
I am trying to add cljs functionality and trying to setup a unified clojurescript and clojure environment.
My deps.edn file looks as ...
1
vote
1
answer
160
views
Execution error (ExceptionInfo) at cljs.closure/build (closure.clj:319 3). :bundle-cmd :none failed -- clojurescript with webpack
I'm trying to run the official example https://clojurescript.org/guides/webpack on windows and I get the following error when I execute it:
Execution error (ExceptionInfo) at cljs.closure/run-bundle-...
4
votes
1
answer
249
views
ClojureScript cljs.core.async/go doesn't work inside jsdom
I am trying to migrate ClojureScript tests from "Chrome Headless" to jsdom using Karma and shadow-cljs as test runners.
The regular tests which require access to DOM or browser API work fine....
0
votes
1
answer
147
views
How do you append to a file in ClojureScript (on Node)?
How can you append to a local file using ClojureScript (running on Node)?
0
votes
1
answer
145
views
How can you get the path to a user's home directory in Clojurescript running on Node?
You can't use ~ in paths for NodeJS functions because that's a bash-specific thing. So how do you get the path to a user's home directory in Clojurescript (on Node)?
0
votes
1
answer
104
views
Clojurescript core.matrix aljabr implementation must be explicitly set
Using core.matrix in a ClojureScript project. For javascript interop I need aljabr as explained in https://github.com/mikera/core.matrix/wiki/Matrix-implementations
After I try to specify the ...
2
votes
1
answer
308
views
The required JS dependency "@silvia-odwyer/photon" is not available -- ClojureScript -- Node.js -- npm -- yarn
I am doing the example project https://github.com/minimal-xyz/minimal-shadow-cljs-importing-npm to later add Photon dependency https://silvia-odwyer.github.io/photon/guide/using-photon-web/ and after ...
1
vote
1
answer
420
views
ClojureScript turn a Javascript Map Iterator into a seq
I'm calling a Javascript library and getting a Map Iterator back (which in Javascript you use with for ... in)
How do I turn this into a ClojureScript sequence so I can call for on it?
0
votes
1
answer
112
views
Issue in Clojurescript application when changing class strings
I'm having a strange problem with a bit of Clojurescript in my application. I pulled all the relevant pieces out into a small Leiningen Reagent application. Here's the relevant Hiccup:
(defn current-...
1
vote
0
answers
216
views
Clojurescript interop with ProseMirror
I would like to add a modified ProseMirror editor to a figwheel-main-based Clojurescript project. After setting up a small experimental project, I'm just trying to reproduce this nonfunctional editor ...
1
vote
1
answer
304
views
Implementing static properties in ClojureScript
How can I mimic this JavaScript inheritance in ClojureScript?
class AccessController extends EventEmitter {
static async create (db, options) { }
static get type () {
throw new Error('\'...
1
vote
1
answer
1k
views
How to create an async function in Clojurescript?
Is there a way in Clojurescript create an async function or a macro wrap a function into a Promise to simulate it?
My current use-case is to replace the following function that takes a callback by its ...
0
votes
1
answer
492
views
In Clojurescript, how do I use AWS javascript SDK to list S3 buckets?
I am just getting started with Clojurescript. I wrote some clojurescript code to use the shared aws credentials file to initialize S3 client and list buckets . However my code does not work.
(defn -...
1
vote
1
answer
296
views
MapBox in cljs: Removing markers from map (after storing them in an atom)
Background:
In mapbox-gl-js, while you can remove layers and features from a map (because the references are stored), you cannot do the same with markers. Instead one has to store the reference to ...
3
votes
2
answers
2k
views
Clojurscript: extend a Javascript class
I'm trying to use a particular JavaScript framework which requires extending a base class to use it for application.
Basically I want to do the following as idiomatic ClojureScript.
class Foo ...
0
votes
1
answer
188
views
Use sourcemap on browser onerror in ClojureScript on Crome
I have a error listener (set! (.-onerror js/window)(fn [message source lineno colno error]... like this on browser and it works well, but stacktrace and other fields are in JS. I would like it to be ...
0
votes
1
answer
171
views
How to get CKEditor react component usable in ClojureScript
I cannot get CKEditor react component to work in ClojureScript project.
When I try to use the component
(ns simple.core
(:require [reagent.core :as reagent]
[re-frame.core :as rf]
...
3
votes
0
answers
209
views
Dynamically generate global vars in a namespace from a list
I'm working on a thin wrapper around a js library and I want to dynamically generate variables from a list for use in other namespaces.
e.g. Given a list of (:foo :bar :baz), I want to dynamically ...
0
votes
1
answer
270
views
Real time audio processing in ClojureScript
I want to do real time audio processing in ClojureScript.
The MDN documentation points me to the AudioWorkletProcessor Class, but from what I googled, there is no obvious way to inherit from a ...
1
vote
1
answer
552
views
Clojurescript date timepicker with cljsjs/react-day-picker
I am new to clojure and clojurescript. I just to know how I can implement this library in clojurescript.
This is the link to the library: https://react-day-picker.js.org/examples/basic
I have ...
2
votes
2
answers
1k
views
How do I open a new window using ClojureScript?
I need to open a new tab using ClojureScript.
(js/window.open "http://localhost/go/somewhere")
I get the following error: Uncaught TypeError: window.open is not a function
It doesn't help setting ...
4
votes
3
answers
2k
views
How to I get the body text of a Response object returned by the fetch API in ClojureScript?
I'm trying to use the Github Gist API to get a list of all of my Gists like so:
(ns epi.core)
(.then (.fetch js/window "https://api.github.com/users/seisvelas/gists")
(fn [data] (.log js/...
0
votes
2
answers
373
views
Clojurescript: How to destructure a js-object in an idiomatic way
Trying to use antd from clojurescript I'm looking for an idiomatic way to destructure js-objects. So assume we want to do e.g.
import { Layout } from 'antd';
const { Header, Footer, Sider, Content ...
4
votes
1
answer
2k
views
Import react-table into ClojureScript with Shadow-CLJS
Web development newbie here. I'm trying to use the NPM react-table package with a ClojureScript/Reagent project. I'm failing to import the package properly. What I've done:
1/installed react-table ...
2
votes
0
answers
323
views
How can I stop the ClojureScript compiler from resolving certain `require`s?
In my ClojureScript code I am requiring a JavaScript module called seedrandom which is in the node_modules folder, like this:
(ns something.core
(:require ["seedrandom" :as rnd]))
(js/console.log (....
1
vote
1
answer
115
views
Adding class paths in clojurescript at runtime?
Is it possible to add classpaths in a Clojurescript program running on Nodejs at runtime?
0
votes
1
answer
250
views
Clojurescript with webpack and infer-externs requires undefined object with advanced compilation
I followed this guide on using webpack + clojurescript, https://clojurescript.org/guides/webpack. It works perfectly when compiled with :none or :whitespace, but when I compile with :advanced one of ...
3
votes
2
answers
1k
views
ClojureScript change display none to visible
I want to modify the visibility of a table when a button is clicked, utilizing clojurescript/javascript interop.
I've tried
{:on-click #(-> js/document ...
1
vote
2
answers
699
views
How to hide/show a table in ClojureScript
I would like to show/hide a table when a font-awesome chevron button is clicked.
The following code comes from http://jsfiddle.net/z0y0hp8o/6/. I would like to do the same thing, but in clojurescript ...
0
votes
2
answers
939
views
How can I prevent the closure compiler from minifying certain methods in clojurescript?
I'm integrating quilljs with my clojurescript application. I'm including it in my project.cljs file like so: [cljsjs/quill "1.3.5-0"].
The compiler is minifying some methods and is causing an ...
0
votes
1
answer
108
views
Using the resulting object from require call in ClojureScript?
In JavaScript there is the idiom:
const ScrollTrigger = require('ScrollTrigger-classes');
var trigger = new ScrollTrigger({
once: true
});
How do I do the same thing in ClojureScript ...
1
vote
0
answers
295
views
Undefined nameToPath when using ClojureScript's :npm-deps
I'm trying to install the Ant Design library via :npm-deps, so in my project.clj I have:
:cljsbuild {:builds {:app
{:source-paths ["src" "env/dev/cljs"]
...
1
vote
1
answer
463
views
How to place Clojurescript npm-deps in production setup?
this is a simple question, but I have been puzzling over it for a while now and it doesn't have much documentation to look at:
I've got a development setup with ClojureScript, figwheel, npm deps ...
0
votes
1
answer
288
views
Clojure Spec : map? failing because spec thinks my data-structure is a vector?
I'm trying to validate a large clojure data-structure in Spec.
I'm getting a failure on this part :
{:pageName "HelloWorld" :pageType ::workPage :cells ["Hello World" "How are you?"]}
using this :
(...
2
votes
1
answer
718
views
How to keep keywords in arrays when converting to json using js->clj?
My actual behavior is
(js->clj (clj->js [:a :b :c]) :keywordize-keys true)
=> ["a" "b" "c"]
Desired behavior
[:a :b :c]
3
votes
1
answer
469
views
Animate antizer table with rc-animate in re-frame app
I am trying to recreate the example in http://react-component.github.io/table/examples/animation.html to add animation to a table in a re-frame app. The table is rendered using antizer which is a ...