This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-17
Channels
- # announcements (2)
- # aws (44)
- # beginners (96)
- # calva (10)
- # cider (7)
- # cljdoc (5)
- # cljsrn (2)
- # clojure (38)
- # clojure-dev (19)
- # clojure-europe (6)
- # clojure-italy (16)
- # clojure-nl (10)
- # clojure-norway (44)
- # clojure-spec (7)
- # clojure-uk (74)
- # clojurescript (133)
- # cloverage (1)
- # cursive (54)
- # datomic (78)
- # duct (11)
- # graalvm (5)
- # instaparse (4)
- # joker (3)
- # kaocha (5)
- # nrepl (2)
- # off-topic (10)
- # pathom (56)
- # pedestal (1)
- # reagent (7)
- # reitit (17)
- # shadow-cljs (144)
- # slack-help (2)
- # sql (35)
- # testing (5)
- # tools-deps (22)
- # vim (22)
- # xtdb (11)
@lilactown thats a known bug in CLJS. I think the fix is in master
. can't remember the ticket number, something related to type-inference
@thheller following up on the cljs-protobuf conversation: im trying to untangle the next problem (adding grpc-web on top of google-protobufs
I see its defined here: https://github.com/grpc/grpc-web/blob/8b501a96f427603ee600d3ff0291eff932fb54a1/javascript/net/grpc/web/grpcwebclientbase.js
so, if I had to guess, something about the way the community packages the npm package loses the export in translation
just copy the contents of https://github.com/grpc/grpc-web/tree/8b501a96f427603ee600d3ff0291eff932fb54a1/javascript into the src/protobuf
dir
is this a common problem, or something inherent to how the pb/grpc community is packaging for npm?
the thing about all of this is that the "greater" JS ecosystem has no clue how to consume closure JS code
so to get this all accessible to the npm world they "wrap" everything in some boilerplate code to make it work with npm
which is no problem for use given that we use the closure library + compiler anyways
ie. you could put the grpc-web
stuff into a .jar
and publish it as a regular library
whats the release build issue? this should be working out of the box as far as I can tell (no custom config)
still investigating, but preliminary issue seems to be that the “typeUrl” field in any.js was renamed to “om”
it would only be a problem is you are accessing typeUrl
incorrectly in your own code?
to be clear: ive removed the “google-protobuf” and “grpc-web” npm packages, but I have others
i suspect if its even an issue, its an issue like you mentioned (something else, probably my code, doing the wrong thing)
then it won't rename that field. although you should find out why renaming it is a problem because it shouldn't be
@thheller so i confirmed this does indeed break for release, and I think I understand why
in essence, I am using a flow like (js->clj (.toObject pb)) so I can use clojure’s destructuring
but it does strike me that renaming fields with ABI implications is probably not ideal
using js->clj
just for the destructuring is a really bad idea. performance and code wise
there is no way to turn it off other then by specifying all the field names in the externs
yeah, you are probably right. Of course, my use is not quite as simplistic and crude as I imply above. Generally I just run js->clj on message receipt and then the map is passed around, destructured as needed.
you can always go back to the npm version and we can try to figure out why that wasn't working
it could also be fixed in the code without externs but that requires modifying the generated sources which isn't great
:advanced
optimizations is really the ultimate goal since it makes your code sooooo much smaller which is good in pretty much all environments
anyway, code cranks on trying to package up the main.jsbundle in a node process and eventually hits an OOM threshold and dies
maybe consider using https://github.com/mfikes/cljs-bean instead of js->clj
it might still blow up though since :advanced
won't be able to identify that you are actually using the property
but just to repeat. adding externs is probably the easiest and fastest way to fix it
as you suspected, things werent quite right with just the property-renaming, though i dont quite understand what actually happened
I did observe that :typeUrl was left unperturbed, but there were other :advanced related issues that cropped up
(let [username (r/atom "")]
(swap! username "admin"))
i eval this, it outputs
TypeError: f.call is not a function
at Object.eval [as cljs$core$ISwap$_swap_BANG_$arity$2] ()
at Function.eval [as cljs$core$IFn$_invoke$arity$2] ()
at Function.eval [as cljs$core$IFn$_invoke$arity$2] ()
at cljs$core$swap_BANG_ ()
at eval (eval at <anonymous> (), <anonymous>:2:29)
at eval (eval at <anonymous> (), <anonymous>:3:3)
at eval ()
at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] ()
at Object.shadow$cljs$devtools$client$react_native$repl_invoke [as repl_invoke] ()
at shadow$cljs$devtools$client$react_native$handle_message ()
is that possible run npx command via shadow.api? eg ‘npx sass --watch sass/main.scss:public/css/main.css’
there are enough tools that only focus on running things in parallel. use one of those
Hi! shadow-cljs works fine and fast. But once in a while my app stops working (fulcro) and shadow-cljs in the browser reports that semantic-ui node modules can not be found. Restarting the browser does not help, but terminating shadow-cljs and doing a new jack-in (from cider) and all is well again. How do I force a recompile from the connected repl without restarting the dev environment? when I type :cljs/quit and then (shadow.cljs.devtools.api/watch :main) it says "already watching".
you can try (shadow.cljs.devtools.api/stop-worker :main)
and then run the watch again
@magra any more info on "when" it stops working? might it be relating to running npm install
or so while the watch is running?
@thheller Last time it happened after I did a restart on the fulcro server. That does a (tools-ns/refresh). I did not issue a manual npm install before the last occurance.
shadow-cljs - config: C:\Users\Ethan\Development\vrtest\shadow-cljs.edn cli version: 2.8.64 node: v10.16.3 shadow-cljs - socket connect failed, server process dead?
shadow-cljs - server version: 2.8.64 running at
shadow-cljs - nREPL server started on port 49330
shadow-cljs - watching build :frontend
[:frontend] Configuring build.
[:frontend] Compiling ...
[:frontend] Build completed. (134 files, 1 compiled, 0 warnings, 3.18s)
{:source-paths
["src/dev"
"src/main"
"src/test"]
:dependencies
[]
:builds
{:frontend
{:target :browser
:dev-http {8080 "public"}
:modules {:main {:init-fn vr/init}}}}}