This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-25
Channels
- # aleph (2)
- # announcements (7)
- # babashka (6)
- # beginners (53)
- # calva (17)
- # cider (5)
- # clj-kondo (137)
- # cljs-dev (19)
- # cljsrn (14)
- # clojure (74)
- # clojure-conj (9)
- # clojure-europe (13)
- # clojure-houston (1)
- # clojure-italy (16)
- # clojure-nl (21)
- # clojure-spec (3)
- # clojure-uk (9)
- # clojuredesign-podcast (24)
- # clojurescript (85)
- # cursive (11)
- # datomic (28)
- # duct (3)
- # emacs (6)
- # figwheel-main (1)
- # fulcro (68)
- # graalvm (19)
- # graphql (3)
- # joker (32)
- # kaocha (10)
- # lambdaisland (1)
- # malli (50)
- # off-topic (13)
- # other-languages (7)
- # pathom (2)
- # pedestal (14)
- # re-frame (53)
- # reitit (8)
- # shadow-cljs (57)
- # specter (2)
What might the shadow-cljsjs shim look like for a library that only calls (.getSelection js/rangy)
and (.init js/rangy)
?
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
INTERNAL COMPILER ERROR.
Please report this problem.
null
Node(NAME LexicalGrammar): repl_interactor/webview/clojure_lexer.js:2:19
let toplevel = new LexicalGrammar();
Parent(NEW): repl_interactor/webview/clojure_lexer.js:2:15
let toplevel = new LexicalGrammar();
Node(SCRIPT): repl_interactor/webview/clojure_lexer.js:1:0
import { LexicalGrammar } from "/repl_interactor/webview/lexer.js";
Parent(ROOT): [source unknown]
don't ever cut errors off please ... always include the full stacktrace. even if it looks like garbage. INTERNAL COMPILER ERROR
is from the closure compiler ...
I moved all the JS code into a separate folder and used npm link
instead of putting it on the classpath, which seems to work
that has its own scoping rules so it is not accesible from other files when using the debug loader
Just thought I'd report back on my experience of running a shadow-cljs REPL with Cursive. After being pointed in the right direction (thanks!) I'm running this script:
(require
'[orchestra.spec.test :as stest]
'[shadow.cljs.devtools.api :as api]
'[shadow.cljs.devtools.server :as server])
(server/start!)
(api/watch :app)
(api/repl :app)
(stest/instrument)
This starts and restarts the compilation in my REPL with a single click. There's a lot of output at startup, but just the compilation result under normal operation. The backend (clojure) half of the application runs in a regular REPL and is used to serve the compiled files, so I'm not using the built-in webserver. My non-Cursive colleagues can easily start a REPL with npx shadow-cljs watch app
, although we haven't yet tried cider jack-in. I'm very happy with this setup, compilation is extremely fast (this is often a problem with WSL, figwheel is much worse) and the dev workflow has to be one of the best available in any language.How do I access this environment variable?
{...
:builds
{:app
{:target :browser
:output-dir "public/js"
:closure-defines {app.core/URL #shadow/env "APP_URL"}
...}}}
(js/console.log "This is the URL: " shadow.env/URL)
This is where my current thoughts are but I can't seem to figure out how I am supposed to access it.
@grounded_sage you'd have (goog-define URL "some-default")
in app.core
and access that like any other (def URL ...)
in that ns
Oh ok. Maybe I asked that the wrong way. I'm trying to access .env
variables during a CI build. Or do the --config-merge thing. But I'm sure how I then access that in the app. I was just defining inline to test accessing it.
I think I get it now though
Yea I've been reading through discussions on Github issues and old slack messages. It's not super clear to me even from that haha
Has anyone any problems with react hooks and shadow? I can’t for the life of me figure out what is wrong with react giving me this error https://reactjs.org/warnings/invalid-hook-call-warning.html
also I’ve found this issue that maybe is related (again not sure) https://github.com/thheller/shadow-cljs/issues/516
@g7s the issue is that you are calling (Test)
. that is invalid you must create a react element for that instead. so (r/createElement Test #js{})
or so
Is there anyway to configure which routes hit the dev-server reverse proxy and which fallback to index.html?
@dpassen1 no. for more complex cases I'd advise using an actual proxy that is made for that stuff 😛
We ended up overriding the :handler
of the dev-server to conditionally proxy requests based on URI: https://gist.github.com/ian-moore/ddf9019f713e10dc5b62e065d0fcc8fc
Tried updating from shadow 2.8.67 -> 2.8.74 and I get this console warning logged:
js.js:74 shadow-cljs - failed to load module$node_modules$react_calendar$dist$entry
This prevents a required npm dep from loading causing the app to crash. Is there some new configuration required to get the latest shadow-cljs to work?
I have tried rm -rf .shadow-cljs
as well, which does not fit it.js.js:74 shadow-cljs - failed to load module$node_modules$react_calendar$dist$entry
shadow.js.jsRequire @ js.js:74
shadow.js.require @ js.js:100
eval @ /js/cljs-runtime/com…nents.calender.js:4
goog.globalEval @ main.js:836
env.evalLoad @ main.js:2216
(anonymous) @ main.js:3060
There's a separate line that has this:
failed to load compute.ui.components.calender.js Module not provided: ./Calendar.css
env.evalLoad @ main.js:2218
(anonymous) @ main.js:3060
2.8.76
in case you get some errors related to goog.define
can't explain why that broke in the last release but AOT was behaving strangely before
anyone around using shadow-cljs in a somewhat large app? especially those with lots of namespaced keywords? I added a few new compiler tweaks and would like to collect some before/after numbers regarding code size
We ended up overriding the :handler
of the dev-server to conditionally proxy requests based on URI: https://gist.github.com/ian-moore/ddf9019f713e10dc5b62e065d0fcc8fc