This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-14
Channels
- # announcements (2)
- # beginners (88)
- # calva (17)
- # cider (25)
- # cljdoc (22)
- # cljs-dev (10)
- # clojure (194)
- # clojure-italy (1)
- # clojure-nl (8)
- # clojurescript (24)
- # data-science (11)
- # datomic (1)
- # fulcro (6)
- # jobs (1)
- # leiningen (4)
- # nyc (1)
- # off-topic (70)
- # pedestal (6)
- # quil (4)
- # shadow-cljs (59)
- # vim (8)
@thheller thanks for all the tips, got it working with the plugin. One thing I noticed is that I get multiple calls to shutdown with the plugin, not sure why. Another question is can I pass arguments to the plugin from the build config? It also seems the the plugins are set globally and not per build.
@talgiat yes plugins are once per server. you can change :depends-on
to :depends-on [:config]
and :start (fn [config] ...)
plugins can in theory access all server functionality and hook into anything. just none of it is documented. 😛
trying to use latest devcards, I get an error:
The required namespace "cljsjs.marked" is not available, it was required by "devcards/util/markdown.cljs".
The namespace was provided via :foreign-libs which is not supported.
Please refer to fo more information.
I’m guessing this is devcards not specifying this correctly in deps.cljs. any work arounds?@thheller thanks! I guess it’s semi documented, because I can read the source code 😁. Few other questions: so does the plugin knows which build is currently running? is it called before any build is invoked (just trying to understand the lifecycle of the whole build system and the point where plugins are called). Also did you run into cases where a plugin shutdown is called multiple times before?
Another question: can build hooks get access to the full shadow-cljs.edn content and not just the build state? (I guess I can use shadow.cljs.devtools.config/load-cljs-edn, but thought there might be something else)
@talgiat build specific stuff should probably be in the build config which is at :shadow.build/config
in the build state (passed into the hooks)
plugin is started when the runtime is started. so in server-mode once. stop should only be called when the runtime is shutdown
in the build hook you can get access to the full runtime via (shadow.cljs.devtools.server.runtime/get-instance!)
hello, i am following this gh issue: https://github.com/thheller/shadow-cljs/issues/250
does it work if you move the config into the shadow-cljs.edn
? I changed how the global config is handled so that might not be working anymore?
I'm interested in playing with shadow-cljs for a node module I'm working on, but I'm having trouble getting started with the repl. I've set the build :target
to :npm-module
and :runtime
to :node
, but after shadow-cljs watch lib
and shadow-cljs node-repl
I still get "No application has connected to the REPL server" when I try to evaluate forms over cider from Vim
I imagine at some point there will be a bin
component to it that I can set as :main
and run, but primarily I want to architect this as a library, and hope to have the normal clojure repl experience evaluating forms and executing tests.
Am I missing something?
if you want to REPL into teh` lib` build YOU need to launch a node process that loads the compiled code
Is require('./dist/whatever.core'
not sufficient to load the compiled code?
It’s a library that might also have a CLI mode if installed globally
eventually
OR in the .js
files you do the require
in you also require("./dist/shadow.cljs.devtools.client.node")
Oooh I see. I missed the part where it said :npm-module
is intended to be part of the project
if you want a normal clojure REPL experience just forget about build configs completely for now
Aha okay, interesting
I was able to connect to node with :node-library
but I’ll also give the :node-repl
thing a shot
Gotcha
Thanks for your help!