This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-06
Channels
- # announcements (4)
- # aws (1)
- # babashka (18)
- # beginners (28)
- # calva (5)
- # cider (3)
- # clerk (10)
- # clojure (49)
- # clojure-czech (3)
- # clojure-europe (19)
- # clojure-norway (6)
- # clojurescript (10)
- # cursive (44)
- # datalevin (18)
- # datomic (29)
- # dev-tooling (29)
- # emacs (1)
- # hyperfiddle (53)
- # juxt (1)
- # kaocha (2)
- # malli (5)
- # nyc (1)
- # polylith (84)
- # re-frame (1)
- # releases (2)
- # shadow-cljs (33)
- # specter (2)
I want to disable reframe debug mode in dev and have this code
(def debug? ^boolean goog.DEBUG)
(when debug?
(set! interop/debug-enabled? false))
works fine in dev but when doing a production build it fails with this error
Closure compilation failed with 1 errors
--- app/globals.cljs:8
@define re_frame.interop.debug_enabled_QMARK_ has already been set at re_frame/interop.cljs:13:17.
Any ideas how to get around this without having to remove that line whenever I want to do a build?and its a closure-define, so you set it via https://shadow-cljs.github.io/docs/UsersGuide.html#closure-defines
same deal though. you just set :dev {:closure-defines {re-frame.interop/debug-enabled? false}}
That doesn't seem to work, setting it as a closure-define does not disable the debug mode in dev.
And I'm still confused why the build fails with what I did above. debug?
should be false when doing a release, and changing when debug?
to when false
lets the build succeed without issue
This is how its set in the re-frame code https://github.com/day8/re-frame/blob/15a3e0e2f33141e2f930f85bd479494a3e75a6e9/src/re_frame/interop.cljs#L24
well I guess i worked around it by making another closure-define called IS-DEV and doing
Actually scratch that the prod build still fails with (when IS-DEV (set! ...
Still curious to know why I couldn't just use goog.DEBUG(when IS-DEV
even though IS-DEV
is definitely false for prod builds
Hey, I'm trying to use two packages from the Azure JS SDK: @azure/storage-queue
and @azure/identity
. I followed the steps for double bundling and I can use the former package (at least so far) without any errors. When I install @azure/identity
and then compile and bundle, Webpack throws an error about there not being a child_process
module, which I gather is a node thing. What confuses me is that both of these packages have what look to be similar package.json
s: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/package.json and https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-queue/package.json. I tried adding these options to my shadow-cljs.edn
:js-options {:js-provider :external
:entry-keys ["module" "browser" "main"]
:external-index "target/index.js"
#_:external-index-format #_:esm}
with :external-index-format
enabled and also commented out. @azure/storage-queue
works both ways, and @azure/identity
in neither case.can't really help you with webback issues. no clue about those packages either, maybe they are node only?
:entry-keys
has no effect when using :js-provider :external
, but thats not really relevant to your issue
child_process
is a node built-in package, thats why I'm guessing you are including some node-only code?
Yeah I'll have to dig into the docs more. The storage lib explicitly identifies classes that are node only and includes instructions on bundling. But I haven't seen anything like that for identity yet. On the other hand, there's a class called InteractiveBrowserCredential
?:man-shrugging:
I ditched Webpack for now. If I understand this section of the https://shadow-cljs.github.io/docs/UsersGuide.html#js-entry-keys right, it should look for "browser" in package.json
first. But I get this output when I try to build
[:app] Build failure:
The required JS dependency "fs/promises" is not available, it was required by "node_modules/@azure/identity/dist/index.js".
Dependency Trace:
bhlie/az_rather/app.cljs
node_modules/@azure/identity/dist/index.js
If I'm reading that right, it's looking in the /dist/index.js
of the @azure/identity
package for the code it needs. But that is the dir specified in the "main" key of that package.json
. I actually just got this to build successfully by specifiying
:js-options {:entry-keys ["browser" "module"]}}
but with this warning
Resource: node_modules/@azure/msal-browser/dist/interaction_client/PopupClient.js:519:5
Parse error. extra @hidden tag
so I'm guessing this doesn't bode well.So I am having an issue with shadow-cljs recognizing my npm package, I converted my cljs deps.edn project to javascript using shadow-cljs module target. The NPM package is published, and in our main project we are including it in our package.json. Then I build shadow-cljs and it completes the build, but when in the browser it says it can't find the modules from my npm package in the .node_modules. Any ideas?
you are publishing a compiled cljs project to npm and then consume it in another cljs build?
We were previously using sha's but we want to steer away from it. we considered using NPM or Maven to store our library and we do not want to use clojars. What's the best approach?
https://www.npmjs.com/package/black-hammer-lib above is our npm project https://www.npmjs.com/package/npm-playground-ng the bottom is my attempt to convert it to js run it as a npm package
I am helping Andrew Bowden with this. I created the Black-hammer-lib. thinking we can use npm to call all the files and use it like how re-com and react do it