This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-21
Channels
- # announcements (3)
- # architecture (5)
- # babashka (19)
- # beginners (145)
- # calva (1)
- # chlorine-clover (18)
- # cider (10)
- # clj-kondo (5)
- # cljsrn (3)
- # clojure (56)
- # clojure-berlin (19)
- # clojure-czech (2)
- # clojure-europe (32)
- # clojure-finland (2)
- # clojure-nl (3)
- # clojure-portugal (2)
- # clojure-spec (8)
- # clojure-uk (48)
- # clojurescript (48)
- # conjure (50)
- # cryogen (1)
- # cursive (28)
- # datomic (54)
- # depstar (12)
- # emacs (1)
- # events (8)
- # figwheel-main (6)
- # fulcro (4)
- # helix (4)
- # java (2)
- # jobs (2)
- # leiningen (1)
- # off-topic (29)
- # parinfer (4)
- # pathom (6)
- # portkey (3)
- # reagent (1)
- # remote-jobs (3)
- # reveal (16)
- # shadow-cljs (42)
- # sql (20)
- # tools-deps (11)
- # vim (4)
- # vrac (2)
Does shadow-cljs have trouble with index.js
files?
NPM package A (`querystring`) emulates a node module, its entry point is index.js
. It is required by NPM package B in my dependencies (`require("querystring")` ). Compilation fails because the compiler cannot find dependency querystring
.
I, on the other hand, can require it by mentioning (:require ["querystring/index"])
. Indeed, I can fix this by altering altering package B to specify require("querystring/index")
but it is a brittle solution at best. What would be a better fix?
@adam678 the correct fix is npm install shadow-cljs
in your project. which you should be getting a warning on startup about.
querystring
is one of those node polyfill packages which will be installed if you npm install shadow-cljs
@thheller Thanks, indeed it works. However, I don't think there was any warning besides a suggestion to run npm install querystring
which didn't do the trick anyway
@thheller I was digging into the first error with reframe.db/app-db
and now I have to use (require 're-frame.db)
to make it work. What did make this change?
@pavel.klavik I don't understand what you mean. I don't have enough context about what you are doing
makes things a million times easier if you just paste a shadow-cljs cljs-repl app
session or so
too many other things may be going when when using nREPL so I need waaaaaaaaaaay more information to provide any kind of help
I just checked and no idea how to reproduce it, everything works just fine now
recently I am getting more errors of the type posted above, not sure what is causing it, but it is somehow related to code reloading
if I get more insight into what could be causing the errors, I will let you know
what’s the best way to set up a multi-project repo like so:
project
|-- api
| |-- src\clj
|
|-- client 1
| |-- src\cljs
|
|-- client 2
|-- src\cljs
I don't see much value in different directories for clj, cljs and cljc files.
I personally have a single src directory with multiple subdirectories which copy my project structure: src/project/client (cljs files) src/project/server (mostly clj files) src/project/common (cljc files) src/project/css (clj files for Garden) and a few others
but i ultimately have 3 deployable units, does it still make sense to do it this way though
sure, you have three deployable units, but they might share some code (at least we share a lot of code in between)
so I would recommend having everything in a single repo (at least till it is possible), and separating everything in build time (you specify the root namespaces and only their dependencies will be included in your build)
I currently have one shadow project already (react native) and i’ll have another one (react web) so my biggest problem is the vast difference in dependencies they have and how to manage that
As with everything, I would choose the simplest way unless you have a good reason not to. I think we currently have single list of Shadow-cljs dependencies and the right dependencies get picked up during compilation, but maybe some other way is prefered here.
ah, true, i recall @thheller explaining that — how only what your used references are compiled
i’ll give er a go, thanks @pavel.klavik that gives me the confidence to trudge forward
i’m using cursive so loading up the project via lein is ideal and afaik i can’t specify different lein targets with different shadow builds
this is ultimately what i’m trying to figure out — what the ideal is all things considered, especially since i’m using lein + shadow
but to @pavel.klavik’s point, separating the deps won’t matter much since they’re just pulled in based on usage
exactly. the builds only include what they actually used/required. you can have thousands of extra depenendencies and that won't matter at all
so ultimately that’s where i guess we landed — i’ll just use the superset of deps in lein and different builds in shadow
hello, is there a way to increase the timeout of waiting for a REPL command response?