This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-16
Channels
- # announcements (7)
- # babashka (1)
- # beginners (125)
- # bristol-clojurians (4)
- # calva (49)
- # cider (10)
- # cljs-dev (3)
- # clojure (102)
- # clojure-berlin (3)
- # clojure-czech (4)
- # clojure-europe (84)
- # clojure-france (29)
- # clojure-italy (2)
- # clojure-nl (26)
- # clojure-norway (5)
- # clojure-spec (4)
- # clojure-sweden (4)
- # clojure-uk (50)
- # clojurescript (3)
- # community-development (2)
- # conjure (19)
- # cursive (9)
- # datascript (4)
- # datomic (33)
- # fulcro (4)
- # off-topic (26)
- # parinfer (10)
- # pedestal (4)
- # quil (8)
- # re-frame (1)
- # reagent (20)
- # remote-jobs (5)
- # reveal (53)
- # sci (10)
- # shadow-cljs (37)
- # spacemacs (6)
- # sql (25)
- # tools-deps (24)
- # vrac (2)
- # xtdb (10)
Is that possible compile shadow-cljs project into one single file "js-build" ["run" "-m" "shadow.cljs.devtools.cli" "release" "app"]
which command or flag could help me? (that code from project.clj file)
@sb the question is unclear. you are doing a release build which sounds like what you asked? what is the problem?
I would like to inject into one go project as frontend and for this would be great a single js file (because I need to compile into file, as fs attachment, different like in clojure)
if the cljs-runtime
dir confuses you that is from watch
or compile
builds and is not needed in release
builds. you can optionally just clean out the :output-dir
before running the release
you can also just use a different output-dir for release via :release {:output-dir "somewhere/else"}
see https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration
hi. We have a mixed project of cljs & ts. What needs to be considered on writing reusable react-components with ts? I guess the style-requires on ts need to be handled somehow, getting module errors on those requires with shadow-cljs.
currently using sass on both sides, but I guess plain css requires (on js/ts -side) don't work either?
you can either compile the TS to regular ES6 code and include it directly via https://shadow-cljs.github.io/docs/UsersGuide.html#classpath-js
any other method will result in either the TS code not seeing CLJS or relying on globals to wire everything together
thanks. got the ts & sass converted into js & css, but still have the css-requires in the react-components. Is there a easy way to strip those away on the js-side? e.g. the components look like this:
const Logo_1 = require("./Logo");
require("../styles/overlay.css");
const { Header, Content, Sider, Footer } = antd_1.Layout;
exports.Overlay = (props) => {
return (React.createElement(antd_1.Layout, null, ...
or is there a way for shadow-cljs not to fail on css requires? (as I can import them in my sass)
you can let shadow-cljs ignore them via :js-options {:ignore-asset-requires true}
but it is better to just avoid them to begin with
A colleague wired up devcards and shadow-cljs; however I appear to be having some problems with the dependencies…
In particlar shadow-cljs reports shadow-cljs - failed to load module$node_modules$highlight_DOT_js$lib$core
Then some exceptions related to that
I think it’s because devcards vendors dependencies on highlight.js and marked
This commit seems relevant: https://github.com/bhauman/devcards/commit/4f02973c75586ad3f9559c044cb98585764e5199
@rickmoynihan which shadow-cljs version and which :target
?
@thheller cli version: 2.8.26 node: v13.7.0
with :target :browser
you can either upgrade or set :compiler-options {:output-feature-set :es6}
in your build config
ok I’ll try upgrading to 2.11.4
hmm actually the cli version was different to the one in my deps.edn
/ package.json
ok did yarn global add shadow-cljs
and bumped to 2.11.4
and it seems to have fixed the issue