This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-04
Channels
- # announcements (6)
- # beginners (207)
- # calva (39)
- # cestmeetup (35)
- # chlorine-clover (36)
- # clj-kondo (15)
- # clj-together (1)
- # cljsrn (2)
- # clojure (110)
- # clojure-europe (8)
- # clojure-italy (9)
- # clojure-nl (2)
- # clojure-uk (5)
- # clojurescript (61)
- # conjure (4)
- # cursive (1)
- # datalog (3)
- # datomic (22)
- # emacs (8)
- # events (2)
- # figwheel-main (11)
- # fulcro (23)
- # graalvm (16)
- # graphql (1)
- # helix (4)
- # jobs (5)
- # jobs-discuss (4)
- # malli (3)
- # mid-cities-meetup (13)
- # off-topic (58)
- # pathom (12)
- # re-frame (30)
- # reagent (45)
- # reitit (1)
- # reveal (7)
- # sci (2)
- # shadow-cljs (173)
- # spacemacs (1)
- # sql (1)
- # test-check (5)
- # xtdb (13)
curious @thheller -- if somehow a module ended up having exactly the same code in it between two builds, will the resultant js cache between builds as well? or does shadow/cljs/gclosure do something to prevent it from being the same bytes/etag/whatever
@robert-stuttaford it is somewhat unlikely for modules to be compatible between builds. it can happen but I wouldn't rely on it.
thought as much; just thought i'd confirm it with you
well done on modules, by the way. it's fantastic
given hot macros work with (gensym)
and foo#
they may be using different names in each build, which then may get different names in :advanced
and so on
sup! is there any guidance around using node 12 vs 14?
shadow docs just say "(v6.0.0+, most recent version preferred)"
well.... hahah yeah there are issues on my system, but who knows may be completely unrelated. I installed nodejs with scoop on windows then copy the shadow-cljs.edn file from the front page of shadow site, then npm install sahdow, etc... I just get a single error "? ? is not ISeqable", so kind of those impenetrable messages that don't really tell you much. So I began wondering if the node version mattered. Anyway, I removed the scoop node and I'm trying the official installer see if it makes any difference
I suspect is more of a problem of how my system is configured more than any shadow issue, but yeah I was wondering if 12 v 14 made any difference
this is what I saw:
also found it suspicious that shadow had those "..." instead of actual help
the command line help typo is not the actual problem I think
here's a better example:
thats odd indeed. I'd guess that there are maybe some invalid "hidden" chars in the config?
hmmm yeah, let me try delete the file and try copy-paste again from the front page
noooo just deleted it, yeah that was the problem, I think the file had the wrong encoding. So nothing to do with the nodejs scoop installed
maybe I can replicate that file... let me try
TF I think my emacs is loosing it
ok cool, there's something wrong with my emacs. I could replicate the file.
please send to <mailto:[email protected]|[email protected]>
sent!
$ cat shadow-cljs.edn
��{:source-paths ["src"]
:dependencies [[reagent "0.8.1"]]
:builds {:app {:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:main {:init-fn app.main/main!}}}}}
thx! was really jarring, although it was my mistake, I'm sure it can help other ppl too
how you run re-frisk on react native? :thinking_face:
I know nothing on the subject but it seems like the readme has some info: https://github.com/flexsurfer/re-frisk#react-native-electron-or-web-applications
I'm experiencing some weird issues with classpath override.. We basically have overridden a library with our own patches in src
that shadow-cljs has previously used instead of the sources from the library. Now I'm getting:
[2020-08-04 14:47:11.441 - INFO] duplicate resource graphql_builder/generators/shared.cljc on classpath, using file:/Users/harri/.gitlibs/libs/floatingpointio/graphql-builder/7e8311225d5595e4456b8fd6338b127a80b7aab6/src/graphql_builder/generators/shared.cljc over file:/Users/harri/Development/hesburger/core-client/src/graphql_builder/generators/shared.cljc
for each of the overridden files, and they are not patched. This is only affecting 1 machine out of 4 working ones.We are not getting this INFO notice in our other dev machines.
clj -Spath
returns a proper classpath, but it is in a different order
my machine for instance, has src:test:....
and in the failing machine, they are somewhere in the middle
Nope. 1.3.2 in all machines...
I removed .cpcache and other suspects as well, but still it produces them in a different order.
I am so baffled by this. What can it be 😄
Oh... clojure got an update when I upgraded it from homebrew...
depends in openjdk14 and all that... maybe this is the root cause?
Nope. Still works on my machine 😞
Now the classpath is "messed up" similarly on my machine as well but it does not produce that error on conflict
no clue. if you use deps.edn
then that is solely responsible for constructing the classpath and nothing shadow-cljs does affects that
This is just one of those days...
I just removed the updates we had made, and put them to a new branch in our fork and refer to that new SHA in deps.edn. Now it works, but if we want to use that feature again this will have to be revisited...
is there a way to dissoc
build options via the :`config-merge` option? use case: for the release build, we have set up ns-aliases. but for a specific release build, I want to remove one of those ns-aliases
fwiw: I’m now using a build hook for the :configure
stage to bend the configuration of the release build to my will. the hooks really provide a lot of flexibility @thheller, very nice!
I just upgraded shadow-cljs from nashorn-js to graal-js and now I am getting problems in the compiled bundles. Compilation works, but vega npm dependencies cannot load when used in in transient project. this is the package that was making problems with polyfills (buffer / process) before. Is there any change in regards to this with the graal versions?
shadow-cljs - failed to load 131 main.js:10793:82 shadow-cljs - failed to load 133 main.js:10793:82
ypeError: $jscomp.arrayFromIterable is not a functionhttp://localhost:9000/r/main.js shadow$provide[131]/< http://localhost:9000/r/main.js:5067 shadow$provide[131]/< http://localhost:9000/r/main.js:4742 131 http://localhost:9000/r/main.js:4742 jsRequire http://localhost:9000/r/main.js:10793 shadow$provide[133]/< http://localhost:9000/r/main.js:5313 133 http://localhost:9000/r/main.js:5313 jsRequire http://localhost:9000/r/main.js:10793 require http://localhost:9000/r/main.js:10793 <anonymous> http://localhost:9000/r/main.js:18601 <anonymous> http://localhost:9000/r/main.js:19942
I juess the issue is elated to either transient dependencies that use vega, OR jetty vs shadow dev server
you can fix this easily by bumping :compiler-options {:output-feature-set :es6}
or whatever language level is appropriate
shadow-cljs - watching build :webly [:webly] Configuring build. [:webly] Compiling ... [:webly] Build failure: The required JS dependency "buffer" is not available, it was required by "node_modules/vega-loader/build/vega-loader.js". Dependency Trace: demo/app.cljs pinkgorilla/ui/default_renderer.cljs pinkgorilla/ui/data/vega.cljs node_modules/vega-embed/build/vega-embed.js node_modules/vega/build/vega-node.js node_modules/vega-dataflow/build/vega-dataflow.js node_modules/vega-loader/build/vega-loader.js Searched for npm packages in: /home/andreas/Documents/gorilla/gorilla-ui/node_modules See: https://shadow-cljs.github.io/docs/UsersGuide.html#npm-install
{:lein {:profile "+demo"}, :dev-http {9000 {:handler http://demo.app/handler}}, :http {:port 9001, :host "localhost"}, :nrepl {:port 9002}, :builds {:webly {:target :browser, :output-dir "target/webly/public", :asset-path "/r", :modules {:main {:entries [http://demo.app]}}, :compiler-options {:optimizations :simple :output-feature-set :es8 }}, :ci {:target :karma, :output-to "target/ci.js", :ns-regexp "-test$"}}}
installing shadow-cljs in the project ensures that all node polyfills are available so it should always be done
it is VERY easy to forget that I have to update shadow-cljs not only in project.clj but also in package.json.
its also not super critical to keep the versions in sync. the package.json
version can stay older usually, just need to have it at all.
I'm not joking here. I will add a check that deps.cljs
does not contain shadow-cljs
if I find that becoming a thing.
https://github.com/pink-gorilla/gorilla-ui/commit/54f63feed681d1c0ab295eed6edbe825f45dfccc
Trying to test my project and I’m getting the following, any suggestions where to look?
❯ shadow-cljs compile test
shadow-cljs - config: /Users/benny/projects/client/shadow-cljs.edn
shadow-cljs - connected to server
[:test] Compiling ...
========= Running Tests =======================
SHADOW import error /Users/benny/projects/client/.shadow-cljs/builds/test/dev/out/cljs-runtime/shadow.js.shim.module$$react_navigation$native.js
/Users/benny/projects/client/node_modules/react-native/index.js:13
import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1047:16)
at Module._compile (internal/modules/cjs/loader.js:1097:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/Users/benny/projects/client/node_modules/@react-navigation/native/lib/commonjs/useBackButton.tsx:2:1)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
===============================================
[:test] Build completed. (164 files, 163 compiled, 0 warnings, 7.45s)
I don't know any. I'm sure there are but I don't use react-native so I have no clue how testing works there
is there a way to break out the tested code so to ignore the rn-specific code during test execution?
one way would be to use a different source root for tests, but afaik you can only set the source root at the project root which breaks that theory
if i just want to test re-frame code for example, is there a way i could make my test target compile and test just that code?
this isn’t legal:
:test
{:target :node-test
:source-paths ["src/client/re-frame" "test"]
:output-to "out/node-tests.js"
:autorun true}
https://code.thheller.com/blog/shadow-cljs/2018/02/08/problem-solved-source-paths.html
then when i run shadow-cljs compile test
why does it try to compile the react native specific code if i’m not referencing it in my test sources?
so if any of those (or those they require) require react-native stuff it will end up including it
that’s pretty great, something somewhere is pulling in native code, but i will figure out what, it’s great to know it’ll only get pulled in if it’s referenced!
fwiw: I’m now using a build hook for the :configure
stage to bend the configuration of the release build to my will. the hooks really provide a lot of flexibility @thheller, very nice!