This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-15
Channels
- # announcements (2)
- # aws (1)
- # beginners (200)
- # calva (136)
- # cider (32)
- # clj-kondo (1)
- # cljs-dev (14)
- # cljsrn (19)
- # clojure (147)
- # clojure-argentina (1)
- # clojure-dev (144)
- # clojure-nl (2)
- # clojure-spec (14)
- # clojure-turkiye (1)
- # clojure-uk (1)
- # clojurescript (7)
- # data-science (1)
- # datomic (5)
- # duct (6)
- # figwheel (2)
- # fulcro (4)
- # graalvm (10)
- # graphql (1)
- # immutant (1)
- # joker (4)
- # off-topic (30)
- # om (1)
- # re-frame (11)
- # reagent (2)
- # reitit (4)
- # shadow-cljs (63)
- # testing (1)
- # tools-deps (7)
I don’t remember the details about :npm-module
problems, just that I, with your assistance, couldn’t make it to work. It was something with the entry point.
Webpack is what the vscode packager suggests that I pack my extension with for releases. And when I do that it shrinks it down from thousands of files and 20 MB. To one file of 1.6 MB.
@pez I can't remember the :npm-module
problems either but it should be working fine. just may need to create one additional file manually or so. thats the part that :node-library
basically does for you.
or do you use many JS deps that need to be bundled as well? not sure how exactly vscode exts are packaged
So, in Calva, the cljs-lib is a small library, giving the TypeScript code (which is most of the code) access to some clojure facilities, like the cljs.reader and clj-fmt
. The vsce
packager greates a zip file with file extension .vsix
, in which cljs-lib.js
, created by shadow-cljs release
is just one of the files. If I include Webpack in the build chain, it bundles all the js files into one, and vsce
stops complaining about that I should use webpack. And the extension installs much faster and works excellently.
As for :npm-module
problems. You and I really gave that a shot, back then. But we reached a point where you said, “use :node-library
instead”. Which is where I am now. I can of course try with :npm-libarary
again, but I don’t like the idea of spending days to again find out it won’t work. 😃
well :node-library
is never gonna work with webpack during development and what you describe is easily possible with :npm-module
I think I can give it a quick try and we'll see if it works or at least what the problem is.
You're right. Which points me in the direction of trying to not use webpack for dev and only for release. Which brings me back to the question about if you think I can rely on that the release build are currently working swell.
Yeah, so when I let webpack bundle things it works, but only in realease. In dev there are references to things in the .shadow-cljs dir that don't resolve. But, as you say, I might lose the repl and hot reload anyway with webpack, so not worth trying to solve that resolve problem.
basically all targets make certain assumptions about the runtime they are gonna be using
:node-library
as the name implies assumes it will be running in node
which is not true if you package it with webpack first
it also assumes it can use the node
runtime facilities to load code dynamically which is also not possible when using webpack
so the only thing you'd gain with :npm-module
+webpack during development is that it becomes loadable
I’ll avoid webpack for dev. And things the release build with webpack works, I can safely use that?
hm, I am running into an obscure issue with shadow.loader
in a production build. Module loading isn’t working, and I’ve determined that shadow.loader.initCalled
is undefined. The problem goes away when I enable --debug
mode, which makes me think maybe it has something to do with an advanced-mode name collision of some kind. I haven’t been able to reproduce locally, only when it is built on our CI server. (Just posting here in case some possible avenue to look at comes to mind, i’ll keep debugging)
it repeatedly tries to load the same modules, and fails, only returning 1
as the error (which i believe just means ’consecutive errors`
oh… maybe this is a caching issue. When I load modules normally I append a hash as a query param, eg. dropify.js?v=<hash>
Hey there, how do I specify what the init function is used when using :modules {:entries something.core}
?