This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-08
Channels
- # adventofcode (9)
- # announcements (5)
- # babashka (3)
- # beginners (46)
- # calva (21)
- # cider (15)
- # clj-kondo (20)
- # cljs-dev (57)
- # cljsrn (10)
- # clojure (147)
- # clojure-dev (6)
- # clojure-europe (3)
- # clojure-france (2)
- # clojure-italy (8)
- # clojure-nl (18)
- # clojure-norway (5)
- # clojure-spec (16)
- # clojure-uk (63)
- # clojuredesign-podcast (7)
- # clojurescript (65)
- # clojurex (42)
- # cursive (12)
- # datomic (10)
- # fulcro (47)
- # graalvm (102)
- # graphql (2)
- # jobs (5)
- # joker (12)
- # off-topic (33)
- # pedestal (6)
- # re-frame (6)
- # reagent (8)
- # reitit (6)
- # remote-jobs (4)
- # rewrite-clj (10)
- # shadow-cljs (86)
- # sql (45)
- # testing (4)
- # tools-deps (43)
- # vim (8)
- # xtdb (3)
I seem to have lost my hotreload when hacking on calva-lib
. I have tried some older versions of VS Code, but it is the same. Also some older versions of shadow-cljs, but same… I need some tips on how I can track this down. Totally horrible to be back in compile->restart land.
https://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html
oh and you are using :node-library
so the hot-reload doesn't work for exported vars?
Yes, that was it! My exported vars are usually very thin dispatchers so not really tried if hot reload works for them. It works for non-exported stuff.
Then I am good, Just need to thin this one down. 😃 Curious about why it doesn’t work for those vars though.
actually I can make that work. just never updated the initial "naive" implementation 😛
Cool. I can write my stuff explicitly with exported dispatch-only api, but would of course be nicer not to have to do it for that reason.
the reason it doesn't work right now is that basically in JS it is doing var something = require(".../calva-lib.js")
I’m good with just knowing what was going on, but if that is not tons of work for you, it is on my wishlist. 😃
Have you written about the differences between npm-library and node-library are somewhere? I mean conceptually, but yeah, faturewise too.
ClojureScript is my first real contact with node land, so obvious things are not so obvious to me.
:node-library
should be preferred in almost all cases (output is more efficient/compact)
yeah if you basically just want to use the CLJS namespaces directly in JS then :npm-module
is the way but it has other issues that makes it more complicated to work with
I love my :node-library
. Will stay with it. Hopefully grow it a bit faster so that you start liking Calva more. 😃
It is actually pretty sweet how when in cljs I can reach both the node and the clojure ecosystems.
Actually it is not so much that I want it. It has been pragmatic, but also will become problematic. So will start a “background thread” bringing stuff over piece by piece.
I have to admit I kinda like TypeScript a bit too. Mainly for its improvement over JS, but also it is quite nice with the IDE support you are rewarded with when you write types for things.
But Calva just got signature help rivaling that of TypeScript’s. So there is that approach as well. 😃
is it easy to get a workflow where I can get a clj and cljs repl simultaneously running for a project using emacs/cider?
is it possible to configure shadow-cljs.edn
to match this call: (shadow.cljs.devtools.api/watch :app {:autobuild false})
when running shadow-cljs watch app
?
have tried setting :autobuild false
in various places in shadow-cljs.edn
but haven't been able to figure it out
Why do people like Typescript by the way?
I’ve got a super minimal example where my cljs ‘requires’ an adjacent .js file which requires an npm module, lodash. After compiling, and when I try to run it, I get Module not provided: shadow.js.shim.module$lodash
. That file, shadow.js.shim.module$lodash.js
is in my cljs-runtime
dir.
I'm assuming you have (:require ["./some.js" :as x])
and in that JS const x = require("lodash");
?
JS deps requiring NPM deps is in kind of a rough spot right now because the closure compiler changed something
Ok. Another bane of my existence that I want to pick your brain about. We’ve got a javascript code base. We’d like to write new functionality in cljs. Our unit tests are using jest. Jest and the closure compiler don’t seem to like each other. goog is not defined
. Do you know anything about this? I imagine getting to the bottom would require in-depth knowledge in either jest or closure or both.
if the :node-library
code isn't loaded properly then it may do some kind of processing that breaks the already brittle output 😛
From what I’ve been able to figure out, jest messes with node’s require
function. The other testing framework I tried, mocha, doesn’t have the same problem. But, its also interesting that jest seems to work fine with every other node library. I wonder if its related to closure’s heavy use of globals.