This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-01
Channels
- # aleph (2)
- # aws (23)
- # bangalore-clj (1)
- # beginners (99)
- # bristol-clojurians (1)
- # cider (3)
- # circleci (1)
- # clj-kondo (8)
- # cljdoc (4)
- # clojars (1)
- # clojure (47)
- # clojure-india (1)
- # clojure-nl (2)
- # clojure-serbia (3)
- # clojure-spec (2)
- # clojure-uk (17)
- # clojuredesign-podcast (1)
- # clojurescript (20)
- # datascript (1)
- # datomic (1)
- # emacs (1)
- # fulcro (4)
- # pathom (18)
- # ring-swagger (2)
- # shadow-cljs (31)
- # spacemacs (3)
- # tools-deps (10)
- # vscode (1)
hello, I am trying to deploy my shadow-cljs/reagent app to github pages, but i can't make it work. When I use shadow-cljs watch app
everything works just fine, but when i run shadow-cljs release app
and try to open index.html or push the code to my github page, I get this js error : Error: No matching clause:
. At first I thought that the app.js generated by the release command was faulty, but it seems to work just fine when i run it with a http server (lite-server). In all case the code is loaded just fine. It's just really confusing. What am I missing?
this is the repo if it helps: https://github.com/MarinPostma/pws
Hello! Are there some examples or articles of testing react-native project with shadow-cljs?
@postma.marin my guess would be that your routing fails but its hard to say. you can run shadow-cljs release app --pseudo-names
or shadow-cljs release app --debug
(to get source maps). should be easier to tell where it fails then
can :target :browser
live in :build-defaults
?
seems not
I made progress. I got the CLJS part built with shadow, and then built the uberjar. When I run the app and view the start page, it’s missing JS. The console says:
The resource from "
@jmckitrick that is your server. looks like it tries to serve some other content under that url that isn't the JS. just open it in your browser normally and see what it is
I went back to the dev build, and am starting over. I’ll worry about the uberjar when I’m ready for deployment.
I think I had too many moving parts at once.
So loading that file in the browser gives me a 404 page
So the uberjar isn’t finding the payload generated by shadow, I assume.
Probably a simple setting in my project file… just gotta find it.
hey @thheller, when running a prepl-server and a socket-server, if I connect to the prepl-server I can't seem to start a repl in the socket-server
after connecting to the socket-server I get this:
shadow.user=> (shadow/repl :app)
null=> Execution error (AssertionError) at shadow.cljs.repl/read-one (repl.clj:536).
Assert failed: (symbol? read-ns)
neither prepl nor socket-repl are used frequently so yeah there are most certainly issues
sorry for being unclear, what I was doing is starting a prepl-server by putting {:prepl {:app 5555}}
in shadow-cljs. I can connect to the prepl-server and it works fine. however, if I have a prepl-server running, and then connect to the socket-server, then I get the error I posted (`null=> Execution error (AssertionError) at shadow.cljs.repl/read-one (repl.clj:536).`)
I'm mostly lacking context for what you are doing .. there are too many things that you could be doing so I can't tell
I have an interesting problem here, I require react as an npm module. I have a macro which emits react/createElement
. I cannot do that in my macro because compiler complains (I guess due to that “react” is not normal namespace, it is coming from npm, with normal namespaces this normally works). When I create some alias (def my-create-element react/createElement)
and emit my-ns/my-create-element
instead. All works, but release build suffers from generating dynamic arity dispatch. Even if I specify explicit fixed arity (defn my-create-element [x] (react/createElement x))
it does not get inlined in advanced mode (verified with --pseudo-names).
Any ideas, how could I reference react/createElement in my macro directly? js/React.createElement
does not work. “React” is not avail at runtime due to way how shadow isolates npm modules (?)
this is closest how I could get to what I want: https://github.com/binaryage/cljs-react-three-fiber/commit/1d23a5050c540a19804182dfcb1545eb09356f92
that dirty set! emits: window.reactCreateElement=$APP.vl.createElement
I need a way how to reference that $APP.vl (react npm import in my macro)
ok, after some tinkering with various ideas, I found a proper workaround: https://github.com/binaryage/cljs-react-three-fiber/commit/3838dd6f3871660e67aabf9280dc7a6e1d484bfc