This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-26
Channels
- # 100-days-of-code (3)
- # announcements (2)
- # beginners (237)
- # bitcoin (2)
- # boot (5)
- # cider (15)
- # cljs-dev (9)
- # cljsrn (6)
- # clojure (75)
- # clojure-estonia (1)
- # clojure-italy (8)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-spec (68)
- # clojure-uk (80)
- # clojurescript (89)
- # cursive (31)
- # datomic (22)
- # emacs (2)
- # events (3)
- # figwheel-main (184)
- # fulcro (28)
- # graphql (1)
- # hyperfiddle (2)
- # jobs (1)
- # jobs-discuss (64)
- # luminus (5)
- # off-topic (16)
- # om (2)
- # onyx (1)
- # pedestal (12)
- # portkey (1)
- # re-frame (13)
- # reagent (56)
- # reitit (13)
- # ring-swagger (13)
- # shadow-cljs (145)
- # slack-help (2)
- # specter (6)
potentially relevant: https://github.com/graphql/graphql-language-service/issues/111
@mattly that is just a warning that the dynamic require won't be resolved. do you get an actual related error?
also looks like the language-service thing is meant to run in node? are you sure that its supposed to work in the browser?
which cljsjs package is that? or which npm package for that matter? codemirror-graphql?
@thheller the cljsjs package I'm using on the lein version of the project is [cljsjs/graphiql "0.9.3-0"]
anyway IDK what's going on with it necessarily, but when I pull in the "graphiql" npm module via (:require ["graphiql" :default GraphiQL])
I get some other compilation errors. Which I assumed to be related to the warning.
it compiles and loads fine for me. do I have so call something to trigger the error?
now I'm getting Uncaught ReferenceError: process is not defined
for React's prop-types
module
which, I have a very similar app working otherwise and I'm not seeing any material differences in their shaddow-cljs.edn
files
since I can import graphiql, react, react-dom just fine it must be something in your setup
emacs is crapping for me right now and I can't quit it yet because of work in-flight on another project
can you maybe trim some requires? try adding them one-by-one until it breaks? react-dom,react,graphql,graphiql all work fine for me
check the public/js/cljs-runtime/module$node_modules$object_assign$index.js
file please
...and after changing things like GraphiQL.Toolbar
to GraphiQL/Toolbar
it works as expected
GraphiQL's docs tell you to import GraphiQL from 'graphiql';
and so I took this line form the ES6 to require table: import defaultExport from "module-name";
(:require ["module-name" :default defaultExport])
yeah thats icky because it depends on how the package is actually bundled on their end
Hey all, quick question for a relative beginner. How do you usually connect to shadow-cljs' repl (either the socket or nREPL). I'm trying to use unravel localhost port
but it seems to be detecting my clj namespaces, not my cljs ones. Also, there's no js
namespace. Is there a way to tell it I'm on js? Or, even preferably, is there a way to use rebel-readline with shadow-cljs?
@jstaab you’ve connected to a clj namespace. from there, type (shadow/nrepl-select :my-app)
and I think that’ll bump you into the cljs repl
You can access any javascript from cljs.
Ok, if I do (shadow.cljs.devtools.api/nrepl-select :client)
I get
IllegalStateException Can't change/establish root binding of: *nrepl-cljs* with set clojure.lang.Var.set (Var.java)
clojure.lang.Var.set (Var.java)
shadow.cljs.devtools.api$nrepl_select.invokeStatic (api.clj)
shadow.cljs.devtools.api$nrepl_select.invoke (api.clj)
shadow.cljs.devtools.api$nrepl_select.invokeStatic (api.clj)
shadow.cljs.devtools.api$nrepl_select.invoke (api.clj)
user$eval14469.invokeStatic (unrepl-session)
user$eval14469.invoke (unrepl-session)
clojure.lang.Compiler.eval (Compiler.java)
clojure.lang.Compiler.eval (Compiler.java)
clojure.core$eval.invokeStatic (core.clj)
What is the client
build id?
My shadow-cljs.edn has :builds {:client {...}}
, so client
? Or the build id something else?
No, that seems right.
What's the target of that build id?
{:source-paths ["src"]
:dependencies [[reagent "0.8.1"]]
:builds {:client
{:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:main {:entries [portal.client.core]}}
:devtools
{:http-root "public"
:http-port 8700}}}}
And you have a browser connected?
What if you run (shadow/repl :client)
? Is it possible you're trying to bind from a non-nrepl?
do :repl/quit
to exit the current repl and try again?
It's a shadow-cljs command.
In rebel, here's what I get:
user=> (shadow.cljs.devtools.api/nrepl-select :client)
ClassNotFoundException shadow.cljs.devtools.api java.net.URLClassLoader.findClass (URLClassLoader.java:381)
How did you connect rebel to shadow-cljs?
clj -m rebel-readline.main
for rebel, (haven't figured out how to connect to nrepl/socket repl yet); unravel localhost 57282
for unravel, that's the socket repl port
What command did you use to start shadow?
I usually start it with shadow-cljs clj-repl
and then I bounce into the different repls.
Huh, ok I'll give that a try. Does that command give you a repl directly or do you still have to connect? I thought I had tried that
Ok, maybe a bit closer, now I get:
[1:0]~shadow.user=> (shadow/nrepl-select :client)
[:no-worker :client]
You have to connect a browser, which does require a build (shadow/once :client)
Or (shadow/watch :client)
When you connect your browser, it will allow you to connect to the cljs repl.
Okay, closer:
rlwrap shadow-cljs clj-repl
shadow-cljs - config: /Users/jstaab/Desktop/cc/portal/shadow-cljs.edn cli version: 2.6.10 node: v8.4.0
shadow-cljs - starting ...
Sep 26, 2018 3:29:46 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Sep 26, 2018 3:29:46 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
shadow-cljs - HTTP server for :client available at
shadow-cljs - server version: 2.6.10
shadow-cljs - server running at
shadow-cljs - socket REPL running on port 59883
shadow-cljs - nREPL server started on port 59885
shadow-cljs - REPL - see (help)
To quit, type: :repl/quit
[1:0]~shadow.user=> (shadow/watch :client)
[:client] Configuring build.
[:client] Compiling ...
:watching
[1:0]~shadow.user=> [:client] Build completed. (162 files, 1 compiled, 0 warnings, 8.57s)
[1:0]~shadow.user=> (shadow/nrepl-select :client)
IllegalStateException Can't change/establish root binding of: *nrepl-cljs* with set clojure.lang.Var.set (Var.java:223)
Does (shadow/repl :client)
work?
Maybe you need to do (shadow/nrepl-select :client)
from within nrepl? Have you connected nREPL?
Got it, I did what the docs said here https://shadow-cljs.github.io/docs/UsersGuide.html#cljs-repl and it worked this time
Not in nrepl
or in nrepl
?
Not sure what you mean. I wasn't able to connect to the nrepl from a differnt client (I still get the root binding error on unravel)
Ha I just found your issue: https://github.com/bhauman/rebel-readline/issues/172
No, I'm just a user. Would love to plug them together, though!
rlwrap and built-in
:thumbsup: