This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-21
Channels
- # announcements (1)
- # babashka (13)
- # beginners (85)
- # calva (1)
- # chlorine-clover (16)
- # cider (30)
- # clj-kondo (2)
- # clj-on-windows (5)
- # cljdoc (3)
- # cljs-dev (12)
- # cljsrn (19)
- # clojure (88)
- # clojure-europe (39)
- # clojure-nl (7)
- # clojure-sweden (3)
- # clojure-uk (8)
- # clojurescript (35)
- # core-async (3)
- # data-science (2)
- # datomic (17)
- # defnpodcast (3)
- # deps-new (1)
- # editors (18)
- # emacs (4)
- # events (1)
- # expound (1)
- # figwheel-main (8)
- # fulcro (9)
- # graalvm (2)
- # graalvm-mobile (11)
- # helix (44)
- # jobs (7)
- # lsp (95)
- # luminus (9)
- # malli (6)
- # meander (4)
- # membrane (2)
- # missionary (13)
- # off-topic (98)
- # pathom (2)
- # polylith (4)
- # portal (3)
- # re-frame (6)
- # reagent (27)
- # reitit (3)
- # releases (3)
- # remote-jobs (6)
- # rewrite-clj (1)
- # rum (2)
- # sci (3)
- # shadow-cljs (7)
- # sql (66)
- # tools-deps (80)
- # vim (5)
- # xtdb (3)
once you are done with the development... how does one actually release the figwheel build for production? What is the process?
So the process to build for production is to just use cljs.main
. This is how I do it:
clojure -M --main cljs.main --compile-opts common.cljs.edn --compile-opts min.cljs.edn --compile-opts prod-server-config.edn --compile
Thanks I'll give it a try
Is there an example for the contents of all the edn files you are using? Many thanks again
Ok Figwheel build with dev settings works. When built with advanced setting... however the script doesn't work atall!! Why is this? I merely included the dev-main.js in the html and opened the html in browser... I am sure I am being an idiot... any help will be greatly appreciated.
Javascript interop doesn’t always work very well with advanced compilation. To make it easier to track down, you can add :pseudo-names true
to your config. Generally what has happened is that the CLJS compiler has renamed some interop call, not understanding that it was an interop call.
One way to deal with these situations is to typehint the JS object with ^js
; however, I have personally run into some kind of small, reproducible bug where this was not entirely reliable.
The most reliable method I know of is https://clojurescript.org/reference/dependencies on the cljs website:
(let [yay ((goog.object.get js/window "yayQuery"))]
((goog.object.get yay "sayHello") ((goog.object.get yay "getMessage"))))
However, I recommend tweaking this for full generalizability — you https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind bind
the fn back to the object you pulled it off of for it to work.
Have fun!