This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-01
Channels
- # adventofcode (77)
- # announcements (1)
- # architecture (6)
- # babashka (16)
- # beginners (28)
- # calva (2)
- # cider (5)
- # clj-kondo (28)
- # clojure (63)
- # clojure-europe (39)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (3)
- # clojurebridge (2)
- # clojurescript (23)
- # cursive (1)
- # datalevin (1)
- # dev-tooling (2)
- # emacs (16)
- # events (3)
- # fulcro (8)
- # guix (3)
- # honeysql (16)
- # introduce-yourself (1)
- # jobs (1)
- # joyride (91)
- # lambdaisland (1)
- # lsp (18)
- # membrane (1)
- # nbb (1)
- # off-topic (62)
- # pathom (4)
- # portal (11)
- # rdf (4)
- # re-frame (4)
- # releases (3)
- # shadow-cljs (55)
- # tools-deps (10)
- # xtdb (3)
- # yada (5)
I have a shadow-cljs project and I’d like to write a large portion of it using Typescript/React. What is a good way to setup my project?
probably best to use https://shadow-cljs.github.io/docs/UsersGuide.html#target-esm with https://shadow-cljs.github.io/docs/UsersGuide.html#_third_party_tool_integration
and then use whatever else for typescript, as shadow-cljs doesn't support that at all
hello @thheller I found a strange case that is happening in a while on our project. We have the following release config:
:compiler-options
{:output-feature-set :es2020
:output-wrapper false
:warnings {:fn-deprecated false}}
:release
{:closure-defines {goog.DEBUG false
goog.debug.LOGGING_ENABLED true}
:compiler-options
{:fn-invoke-direct true
:optimizations #shadow/env ["PENPOT_BUILD_OPTIMIZATIONS" :as :keyword :default :advanced]
:source-map true
:elide-asserts true
:anon-fn-naming-policy :off
:source-map-detail-level :all}}}
but the *assert*
is still true
(we have released some "in development" code (new features) to production build because of this hehehe)it already defaults to eliding asserts in release builds, dunno why you are setting it?
I expect *assert*
value to be false
on production builds, and I think it worked in this manner for some time
we have our own assets macro helpers, and also we used this for exclude code from production builds, and it worked when we started to using it, but now is no longer working (and I don't know really when it happened)
again I ask: WHEN should it be false? in what context? when and where are you looking at it?
it is bound to false, via binding
. so it really really depends on when and where you are looking at it
this is one use case, it worked in the past, right now, is obviously does not work, because the *assert*
has value true
on release builds
yep, ok, I understand it, I just asked for a hint, because in the past is also worked outside macros because the value of this var was set to false
on release builds, thats it
that might be true for regular cljs maybe? I have never modified how this worked in shadow-cljs
in any case, thanks for your time, I expect this value to be true right now independentry of :elide-asserts
on cljs code
yep, is what I going to do, We clearly used incorrectly the *assert*
, It just worried me a bit because when we writted this code and other similar one, because it worked on first time, but I don't know why. In any case it is not shadow fault
I am using shadow-cljs and once I included cljs-http
I am getting this message about dependency conflict. Is there any way to resolve them? I used to handle this type of conflict in lein on backend but I am still a newbie on frontend (shadow).
[:frontend] Build completed. (232 files, 133 compiled, 2 warnings, 0.84s)
------ WARNING #1 - :redef -----------------------------------------------------
Resource: no/en/core.cljc:131:1
parse-long already refers to: cljs.core/parse-long being replaced by: no.en.core/parse-long
--------------------------------------------------------------------------------
------ WARNING #2 - :redef -----------------------------------------------------
Resource: no/en/core.cljc:136:1
parse-double already refers to: cljs.core/parse-double being replaced by: no.en.core/parse-double
--------------------------------------------------------------------------------
It seems the same topic was already discussed. https://clojurians.slack.com/archives/C6N245JGG/p1657707256386529 But it also looks like there is no way to resolve or oppress the warning.
My case is worse because when I see this message my cljs repl on cider doesn't work properly. I may have to avoid using cljs-http and use cljs-ajax instead.
the solution is to have the dep that defines parse-long
and parse-double
to exclude those with (:refer-clojure :exclude [parse-long parse-double])
I honestly don't know. Once I included this lib in shadow-cljs, I get this error.
No available JS runtime.
See
if you can get a minimal repro that would be handy. Do you perhaps have a setting to fail builds on warnigns?
is it possible to use goog-define
to conditionally require or not require some npm dep?
I would like to strip this:
["@cortex-js/compute-engine" :refer [ComputeEngine]]
from require… and then ALSO strip the code in the namespace that uses ComputeEngine
… should I remove it from the namespace block and do a manual require
?If I do
(when COMPUTE_ENGINE
(require '["@cortex-js/compute-engine" :refer [ComputeEngine]]))
Then this later fails:
(when COMPUTE_ENGINE
(def engine
(ComputeEngine.)))
[:clerk] Build failure:
------ ERROR -------------------------------------------------------------------
File: /Users/sritchie/code/clj/mathlive.cljs/src/mathlive/core.cljs:95:5
--------------------------------------------------------------------------------
92 |
93 | (when COMPUTE_ENGINE
94 | (def engine
95 | (ComputeEngine.)))
-----------^--------------------------------------------------------------------
null
AssertionError: Assert failed: (symbol? module)
I guess predictably, I am just not sure how to use this feature to strip out this stuff