Fork me on GitHub

@hammerha As an aside, you can write Math/PI instead of (.-PI js/Math) as well as (Math/sin (/ Math/PI 2)) instead of (.sin js/Math (/ (.-PI js/Math) 2)) . The former expressions are also portable to Clojure. These work in ClojureScript because there is a Math pseudo-namespace.

Sanghyun Lee09:05:09

@miikka awesome, thanks for the information!

🙇 1

Hi guys, I had to create/use a non standard range function like this:

(range-math 0 1 5)
;; => (0 0.25 0.5 0.75 1)

(range-math 0 1 5 :log)
;; => (0 0.5118833609788743 0.7403626894942438 0.8893017025063101 1)
And I was wondering, do you know a clojurescript lib that gives this functionality?


I don't know of a clojurescript lib that does that off the top of my head


seems pretty niche


@lilactown It's maybe a small amount of use cases in ClojureScript world, but this is one of the main reason why people likes Numpy lib in the Python world ^^'


that makes sense


you could see if there's a JS library that does what you want, that you could wrap


I was thinking about that, I should dig deeper in this direction maybe


what's the best way to package a Closure JS project for CLJS consumption?


I'm tempted to use leiningen + deps.cljs 😅 but I'm sure there's a proper way to generate a POM or something. I'm guessing I would still deploy to a maven repo


I don't know how to convince ClojureScript or Closure tooling that the npm package is Closure JS, not some random crap


in other news, I've discovered a project called "tsickle" - converts TypeScript to Closure JS I might play with a mixed TS + CLJS project 🤪 but I would prefer to package my TS as a separate lib


I have a project where I wrap a JS lib: I'm interest in hand-drawing things. To do so, I used leiningen + shadow-cljs. What I like with shadow-cljs is its facility to use npm lib. With shadow-cljs, you're still obliged to use another build tool to generate the jar package.


Hello all I’m in the middle of a long quest where the goal is actually to try out using React libs with @lilactown’s hx. I’ve gotten hx working with a figwheel-main project, so that’s great, but using a React lib (more specifically, react-dnd-cjs with figwheel-main is proving difficult. I’ve started with a minimal project using deps.edn and not much more, that actually manages to pull in React as bundled webpack dependency, as described in . That’s one part of the puzzle. The next big part is integrating figwheel-main. I tried expanding on this minimal project as minimally as I could, using the tutorial at . But, when I get to the final step, running the clj, like this: clojure -m figwheel.main -b dev -r , it hangs forever. The output looks like this:

Rees-MacBook-Pro:hello-bundler ree$ clj -m figwheel.main -b dev -r
2020-05-09 20:56:47.318:INFO::main: Logging initialized @4637ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel] Compiling build dev to "target/public/cljs-out/dev-main.js"
Anyone know what I could be doing wrong?


I don't see anything weird there. What are you expecting to happen, and what is actually happening?


I thought figwheel main was not yet compatible with the new bundle target


Ah right, I didn't notice you were using the webpack guide


No idea how that works with figwheel


i think it explicitly doesn't for now


Cheers, @U11BV7MTK, that’s crucial to know!


i would use shadow-cljs for now


@lilactown I was expecting it to finish compiling and give me a repl


@U11BV7MTK I’m really getting a tour of build tools at the moment 😅 What’s a minimal example of what I want?


Cheers! I’ll have a look @U11BV7MTK


Are there notable differences in the development experience when using shadowcljs rather than figwheel, @U11BV7MTK?


don't think so. except npm just works


otherwise they are running and hotloading your code in. both support nrepl so should work with most tooling


Big :thumbsup: I’ll follow your guide and see how that goes 🙂