This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-10
Channels
- # 100-days-of-code (2)
- # announcements (2)
- # aws (11)
- # beginners (114)
- # boot (6)
- # calva (11)
- # cider (11)
- # cljdoc (2)
- # cljs-dev (7)
- # clojure (126)
- # clojure-berlin (1)
- # clojure-conj (4)
- # clojure-dev (1)
- # clojure-germany (12)
- # clojure-italy (22)
- # clojure-spec (96)
- # clojure-uk (111)
- # clojurescript (27)
- # core-async (8)
- # cursive (17)
- # datomic (26)
- # devops (5)
- # editors (15)
- # emacs (13)
- # events (1)
- # figwheel-main (27)
- # fulcro (64)
- # hyperfiddle (29)
- # jobs (8)
- # jobs-discuss (7)
- # liberator (4)
- # off-topic (46)
- # om (9)
- # onyx (1)
- # overtone (1)
- # perun (8)
- # re-frame (28)
- # reagent (35)
- # reitit (5)
- # shadow-cljs (96)
- # spacemacs (1)
- # testing (10)
- # timbre (8)
- # tools-deps (63)
- # unrepl (1)
- # yada (10)
If somebody created shadow-cljs with xterm, what is the experience, what is the best approach?
some of the shadow-cljs UI uses xterm.js but I'm not actually sure about the best approach yet. it doesn't fit well into the react model
Is there a better dev workflow for working on an :npm-module
than to have a separate stand-alone :browser
target build for development?
I currently have my project successfully imported as a module into our website, but hot-reloading doesn't seem to work out of the box that way (unless I've messed something up).
@mel.collins hot reloading with npm-module
is tricky since shadow-cljs is not in charge of the final bundle. so it is not super reliable
and then require("shadow-cljs/shadow.cljs.devtools.client.browser")
somewhere in your JS
Hmm, well that require() did the trick when I embedded it in the code of the website itself, but I'd prefer to keep the cljs stuff limited to my cljs module so I guess I need to keep poking at this tomorrow.
@mel.collins unfortunately due to the way :npm-module
works there is no easy way to do this outside of doing it via the JS
but typically you can just wrap it in if (process.env.NODE_ENV == "development") { ... }
and you are set
aha! I got it working a with a (defonce _hack (js/require "..."))
in my main cljs file.
@mel.collins yeah thats a bit dirty ๐
you can wrap it in (when ^boolean js/goog.DEBUG ...)
that should remove it from production
I think our codebase is already somewhat dirty, so I should be able to get away with it!
when I connect to shadow-cljs via nREPL, I get a message "version-to-list: Version must be a string" and I'm not able to send forms to it from a file / get any sort of autocomplete
@lilactown that message is not from shadow-cljs so no idea whats happening
heh, I guess I accidentally removed cider-nrepl from my deps :face_with_rolling_eyes:
quick question, I'm trying to make sure I'm doing the best I can to help shadow optimize the size of the build. This is in a reagent project, that's using semantic ui react. I'd previously created a helper namespace that aliased the semantic ui react namespace, and had def's of all the components with adapt-react-class
applied. I figured that since that was a 'use' of the react class, I was effectively pulling everything in. I've since setup another experiment, where I'm just pulling in a few classes for a small page. However, when I run the build report, I'm still seeing roughly the same 'optimized' size
@eoliphant make sure what you are not somehow including the main semantic-ui-react
package directly as that it itself will pull everything in (regardless of use)
there is no :advanced
compilation for node_modules
so it doesn't do full dead code removal
do you actually include only what you need though? the webpack instructions do not apply here
yeah in my test code, i :refer'ed
just the components I wanted, but to your point I did it from the top level package
so now i'm thinking, a nice 'wrapper' would be maybe a macro or something that hides all the pathing
yeah I have no solution right now since I do not think that using :refer
to eliminate code is a useful thing to do in the first place
and the way the JS world structures code is just messy and every projects does its own thing
Yeah I don't mind it too much, but it also goes back to your point about everyone doing their own thing
this works ["semantic-ui-react/dist/es/collections/Menu" :refer (Menu MenuItem Image MenuMenu) ]
just fine and now there's 73 vs 400+ kb of stuff
but at this point I'm very doubtful the JS world is every gonna adopt a clean namespacing scheme ๐
I could add some special magic that could maybe shorten this somehow to at least get rid of the dist/es
but thats just not gonna be reliable again
though I had a moment of extreme gratification yesterday. finally got the go ahead to do the "2.0" of a pretty large project in clojure(script)/datomic cloud etc
been focusing on the backend, but just had one of the ui devs come up and say 'this is all you have to do???'
we should just write our own cljs-react-ui so we can get rid of the messy JS packages ๐
ironically i didn't realize just how insane it is. I focus more on architecture, and far more hands-on on server side stuff, so when ever I did UI stuff, i'd just do a create-react-app etc
well yeah a while back I think i bugged you about trying to get this Material UI framework working
and that's what prompted me to learn more about all the frigging magic that's going on
may have come up before, but i get an issue with the stream
dependency when trying to (require '["sjcl" :as sjcl])
. may be an easy fix, still havent gotten to the point where i can grok these types of issues quickly
because they were using plugins to inmport images, css, etc etc. That 'look like' imports. ugh..
just get โโฆprobably need to run npm install streamโ even after npm installing stream.
using https://www.npmjs.com/package/stream-browserify not https://www.npmjs.com/package/stream
the first one is installed automatically when you install shadow-cljs in the project
so shadow-cljs should always be in your package.json
devDependencies
(or dependencies
)
totally agree with @eoliphant, shadow takes so much friction out of working with js deps. really appreciate everything!