Fork me on GitHub
#clojurescript
<
2022-01-31
>
winsome06:01:11

Does anybody run the clojurescript compiler from a tools.deps build.clj file? I'd like to be able to play with my cljs build in the repl, but all the docs talk about running the compiler from the command line. I'm sure I'd be able to figure it out by digging through the source code, but I thought I'd check if anybody knows of a writeup anywhere.

Apple11:01:24

Here's how I use it

Apple11:01:47

(ns build (:require [clojure.tools.build.api :as b] [shadow.cljs.devtools.api :as shadow])) (defn uber [_] (clean nil) (shadow/release :app) ...)

winsome14:01:06

I'm not using shadow-cljs yet, but this is a useful pattern to follow. And I'm sure that the release function does exactly what I want to do, so that will be a good reference. Thanks!

borkdude10:01:41

Is there a version of map that builds a JS array instead of a CLJS data structure?

borkdude10:01:07

This works:

(-> (into-array [1 2 3]) (.map inc))
#js [2 3 4]
but there might be a more performant way without creating an array first. Could make it myself of course

p-himik10:01:18

FWIW, I'm 90% certain there's no such function.

p-himik10:01:59

Oh, but there's a function in JS that works on CLJS collections:

=> (js/Array.from [1 2 3] inc)
#js [2 3 4]

👍 1
borkdude10:01:10

w000t!±

😄 2
Asko Nōmm11:01:16

If you’re using Storybook with CLJS, how have you fixed the issue of JS heap running out memory when trying to compile things like specter, when compiling with webpack?

Asko Nōmm11:01:48

Since all of CLJS core files are also being ran through it, webpack dies.

p-himik11:01:04

I don't use Storybook but FWIW I have stopped using Specter on frontend after noticing by how much it increases the bundle size.

👍 1
1
dvingo15:01:47

I believe it's babel that needs to not try to process the files, you can try using ignore in the .storybook/main.js config. I haven't tried in a while, but something like this:

babel: async (options) => {
      console.log("babel options: ", options)
      return {
        ...options,
        ignore: [
          /.*cljs.*js/,
          /.*goog.*\.js/
        ]
      }
  }

leif18:01:02

I posted this a few weeks back, but since we're still looking for more responses, I'll post it here one more time for those who missed it: The Programing Research Laboratory at Northeastern University is conducting a study on the usability of visual and interactive syntax for ClojureScript. Participation involves filling out a questionnaire and is expected to take about 30 minutes. The questionnaire consists of multiple choice and free form responses. All questions are optional and responses are anonymous. If you are interested in participating, please visit: https://study.visr.pl (Chrome Recommended) To learn more about visual and interactive syntax for ClojureScript, please visit: https://prl.ccs.neu.edu/blog/2022/01/06/introducing-visual-and-interactive-syntax-realized-visr-for-clojurescript-and-javascript If you have any questions, please contact: <mailto:[email protected]|[email protected]>