This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-12
Channels
- # announcements (1)
- # aws (1)
- # babashka (63)
- # beginners (108)
- # calva (12)
- # cider (6)
- # cljdoc (2)
- # cljsrn (33)
- # clojure (150)
- # clojure-europe (28)
- # clojure-nl (13)
- # clojure-spain (1)
- # clojure-spec (8)
- # clojure-uk (25)
- # clojurescript (16)
- # conjure (7)
- # cursive (7)
- # datomic (15)
- # duct (2)
- # eastwood (2)
- # figwheel (1)
- # figwheel-main (1)
- # fulcro (6)
- # graalvm (1)
- # graalvm-mobile (1)
- # helix (6)
- # honeysql (23)
- # integrant (6)
- # introduce-yourself (4)
- # jobs (10)
- # lsp (132)
- # malli (4)
- # meander (1)
- # membrane (1)
- # off-topic (223)
- # pathom (23)
- # pedestal (3)
- # re-frame (18)
- # reagent (13)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (68)
- # tools-deps (217)
- # vim (19)
- # xtdb (79)
I am reposting from my figwheel threads... Hi, I have a deps.edn build configuration as follows:
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.2.11"}}
:extra-paths ["target" "test"]}
:build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
:test {:main-opts ["-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "smiley-cljs.test-runner"]}}}
The run through `clj -M:fig:build` is successful. But when I try to run `clj -M:fig:min` I get the following error:
[Figwheel] Failed to compile build dev in 9.241 seconds.
[Figwheel:WARNING] Compile Exception: Illegal char <:> at index 2: /H:/Work/Clojure/smiley/target/public/cljs-out/dev/cljs/core.js
[Figwheel:SEVERE] Illegal char <:> at index 2: /H:/Work/Clojure/smiley/target/public/cljs-out/dev/cljs/core.js
How can the build version compile but the minification doesn't work?
Also what is the correct way to deploy a figwheel clojurescript project such that the clojurescript script is not visible in production environment? (edited)Please avoid reposting, unless a noticeable amount of time has passed (many hours, given that we're all in different time zones) and you haven't gotten any reaction.
I did this because there appears to be no activity in figwheel threads
but point taken
Hmm that bites that the minification ain’t working. I have been using shadow-cljs for a bit now, might recommend looking into that.
You can try cleaning targets before you minify, that might help if it’s trying to use non-mini code to generate the end-product JS
In general what is the process for creating a production ready js such that the CLJS script is not published?
If you’re using shadow-cljs there is a release
build you can start by changing watch
to release
in the invokation. shadow-cljs release app
If you’re using figwheel I think it’s lein cljsbuild once min
or at least that’s what I was doing if memory serves.
has anyone combined shadow-cljs with figwheel?
In case anybody is still interested... I fixed it!! In case anybody wants to know... this core.js file is autogenerated... however if it already exists... it'll have this 1st line "// compiled".... To build with the min configuration, all that is needed is to delete this line... the build process puts the line back... but the build doesn't fail!! Riddle me that!! 😄 I am happy I can build!!
I’m running the following test
(ns humboi.core-test
(:require [cljs.test :refer-macros [is are deftest testing use-fixtures]]
[pjstadig.humane-test-output]
[reagent.core :as r :refer [atom]]
#_[humboi.core :as rc]
["jsdom-global/register" :as jsdom]
["@testing-library/react" :refer [render fireEvent waitFor screen]]))
(deftest test-home
(render (r/as-element [:div [:p "Something"]]))
(.click fireEvent (.getByText screen "Something!"))
(is (= "Something" (.getByText screen "Something")))
)
And upon running the tests it gives:
ERROR in (test-home) (TestingLibraryElementError:NaN:NaN)
Uncaught exception, not in assertion.
expected: nil
actual: #object[Error TestingLibraryElementError: Unable to find an element with the text: Something!. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, <script />, <style />
<body>
<div>
<div>
<p>
Something
</p>
</div>
</div>
</body>]
Ran 1 tests containing 1 assertions.
0 failures, 1 errors.