This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-18
Channels
- # architecture (14)
- # beginners (89)
- # cider (336)
- # cljsrn (2)
- # clojure (181)
- # clojure-berlin (1)
- # clojure-dusseldorf (3)
- # clojure-finland (4)
- # clojure-germany (5)
- # clojure-italy (18)
- # clojure-norway (10)
- # clojure-spec (9)
- # clojure-uk (94)
- # clojurescript (84)
- # cursive (3)
- # data-science (4)
- # datomic (82)
- # emacs (2)
- # events (4)
- # figwheel (1)
- # fulcro (6)
- # graphql (2)
- # hoplon (46)
- # instaparse (24)
- # jobs (9)
- # lein-figwheel (2)
- # luminus (18)
- # lumo (3)
- # mount (1)
- # off-topic (14)
- # onyx (17)
- # parinfer (22)
- # planck (1)
- # protorepl (1)
- # re-frame (50)
- # reagent (7)
- # ring-swagger (6)
- # rum (4)
- # shadow-cljs (94)
- # spacemacs (9)
- # specter (7)
- # tools-deps (2)
- # uncomplicate (4)
- # vim (33)
@thheller when start shadow-cljs in clj-repl
mode, shadow/watch
and shadow/repl
can be used in shadow.user
namespace. how to have these setup in server
mode, or have a headless repl in clj-repl
mode?
@thheller I would say congrats on http://shadow-cljs.org/ ... but it seemed to have existed before today... I don't think I've ever seen it before today though 😅
@doglooksgood not sure I understand the question? (require '[shadow.cljs.devtools.api :as shadow])
works anywhere?
howdy folks, I’m having a small issue where I can’t figure out the correct require
dance for using the twitter npm package
the package has the following export: module.exports = Twitter
, where Twitter
is a function
I keep getting variations of: TypeError: shadow.js.shim.module$twitter.Twitter is not a function
@kennethkalmer (:require ["twitter" :as Twitter])
thanks, will try that again
rule of thumb is when JS libs assign module.exports = ...
directly that is :as
. if they do exports.foo = ...
that is :refer (foo)
@thheller I’ve fully moved over to shadow from cljsbuild and loving it. Have you applied for a Clojurists Together grant? This kind of tooling is what they want to fund
I was thinking of knocking up a d3 treemap on top of the release-snapshot data. has anyone else started on this already?
not sure if anyone started yet. maybe discuss it here: https://github.com/thheller/shadow-cljs/issues/247
transition was a couple of days work, I made it easier by building a separate project with all my cljsjs deps ported to shadow first and then migrated my real code over
I’d recommend that to anyone making the transition. I was much more confident when I started on my own code
I discovered how to use react-faux-dom with d3 while doing this work, what a revelation. idiomatic d3 in react
did you create a bunch of cljsjs.
namespaces or rewrite your code to use npm directly?
the only hiccup was grokking devcards and how it integrates. it seems like :devcards true isn’t quite enough since I’ve had to use preloads and call start-devcard-ui! myself to make that work
re: cljsjs, I switched over to npm deps for all cljsjs deps on the advice of someone in slack. worked great and had the side benefit of allowing me to use any version of npm deps I wanted
with cljsjs I was always struggling to get the magic combination of deps + react + cljs versions all to play nicely. with npm deps, it was much easier to combine all the transitive deps and have them all play nice together
@jiyinyiyong I fail at getting the
server running for development. I get a 404 on localhost:7000
. Everything seems to build nicely.
I don’t quite understand how to update the page. The editor only gives me the first line to edit. (Haven’t read up on the editor yet.)
my code was generated with https://github.com/Cirru/calcit-editor
it's an editor I created for generating Clojure code. with it you don't code in parentheses.
if you just want to contribute the markdown part, try submit an issue and I will copy/paste.
the harder way is to npm install -g calcit-editor
on an Unix/Linux OS and launch my editor. Contact me when you need help about the editor. It's a mind blowing piece.
I did install the editor. 😃 Launched it and it looked pretty awesome. But I couldn’t (or couldn’t figure out how to) edit the actual contents of the page. It only gave me the first line of Markdown.
Hi, @thheller . I updated to shadow-cljs 2.2.26 and shadow-cljs watch xxx
takes 10-30 seconds when recompiling for a small project. It takes few seconds before that.
@cmal the first compile or all compiles? the first compile will invalidate all caches so thats going to be slower yes.
I use shadow-cljs watch
and every time I changed a cljs source file, it takes 10-30 seconds to recompile.
Build completed. (1030 files, 2 compiled, 0 warnings, 15.31s)
Does that mean all files are recompiled?
^Cshutting down ...
JS runtime disconnected.
Worker shutdown.
shutting down ...
shutdown complete.
shutdown complete.
when I try to stop watch
@cmal was 1.67s
just the initial compile when watch started or is that your recompile time when you change a file?
1.67s is the recompile time, the first compile time is 10.33s. Before restart shadow-cljs watch
the recompile time used to be 10-30s .
[:usercreatedata] Compiling ...
-> Analyzing Module: :app
<- Analyzing Module: :app (28 ms)
-> build target: :browser stage: :compile-prepare
<- build target: :browser stage: :compile-prepare (0 ms)
-> Compile CLJS: usercreatedata/views.cljs
<- Compile CLJS: usercreatedata/views.cljs (180 ms)
Cache write: usercreatedata/views.cljs
-> Compile CLJS: usercreatedata/core.cljs
<- Compile CLJS: usercreatedata/core.cljs (19 ms)
Cache write: usercreatedata/core.cljs
-> build target: :browser stage: :compile-finish
<- build target: :browser stage: :compile-finish (0 ms)
-> build target: :browser stage: :flush
-> Flushing 1030 sources
<- Flushing 1030 sources (81 ms)
-> Flushing unoptimized modules
<- Flushing unoptimized modules (64 ms)
<- build target: :browser stage: :flush (152 ms)
[:usercreatedata] Build completed. (1030 files, 2 compiled, 0 warnings, 2.79s)
yes I understand. but that seems to fixed by the restart. I'm interested in why your code compiles are so slow
It seems there are two shutting down
two shutdown complete
when I tried to stop the problematic shadow-cljs watch
session , does that mean something is wrong?
^Cshutting down ...
JS runtime disconnected.
Worker shutdown.
shutting down ...
shutdown complete.
shutdown complete.
"shadow-cljs": "^2.2.21"
when adding
as a dependency,
and compiling with shadow-cljs watch mybuild
it can't seem to find io's dependencies and starts asking me to install each one of them...
anyone came across this?
@fj.abanses any chance you are trying to use
on the client?
ummm, you may be right , i remember that from vanilla js...i am bored migrating a project and the cljsjs package for io never asked for that....
I’m trying to understand the cljsjs
compatibility layer. Is the following correct? (1) shadow-cljs ignores the :foreign-libs
compiler directive, (2) instead it looks at package.json
to extract information would would otherwise have been provided via :foreign-libs
, (3) when a project imports a cljsjs
dependency or provides a :foreign-lib
wrapped package, what we must do in shadow-cljs
is provide an empty namespace (of whatever name is expected) that does a :require
using shadow-cljs
syntax and does a goog.exportSymbol
.
1) correct. 2) no, it just looks at node_modules
directly. never looks at the project package.json. 3) yes. cljsjs packages typically provide some global variable, eg. cljsjs.react provides js/React
. if you use (:require ["react" ...])
that would not provide the global so we need to export it separately for those still expecting to find a js/React
@thheller the reason I went down this rabbit hole is this comment https://github.com/thheller/shadow-cljs/issues/136#issuecomment-345230354
in theory, could promesa do some kind of :npm-deps
declaration that would download bluebird instead of packaging it?