This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-19
Channels
- # admin-announcements (1)
- # asami (9)
- # aws (46)
- # beginners (117)
- # calva (9)
- # cider (48)
- # clj-kondo (27)
- # cljdoc (6)
- # clojure (41)
- # clojure-australia (2)
- # clojure-europe (22)
- # clojure-nl (3)
- # clojure-spec (3)
- # clojure-uk (26)
- # clojurescript (57)
- # code-reviews (25)
- # cursive (9)
- # data-science (2)
- # datomic (31)
- # events (1)
- # expound (24)
- # figwheel-main (8)
- # fulcro (38)
- # graalvm (40)
- # helix (6)
- # jackdaw (4)
- # java (5)
- # jobs (1)
- # kaocha (7)
- # kekkonen (1)
- # meander (65)
- # off-topic (67)
- # pathom (4)
- # reagent (9)
- # reitit (8)
- # remote-jobs (3)
- # ring (2)
- # shadow-cljs (24)
- # spacemacs (13)
- # timbre (2)
- # tools-deps (4)
Is there a way to alias a namespace per build? So two builds would use the same namespace in the code, but when built are replaced with aliased namespaces
@mruzekw you can set :build-options {:ns-aliases {my.app.foo my.app.bar}}
. that will make it use .bar
whenever .foo
is required in the build
@jag I can't tell what is going on but the package doesn't seem to be bundle-able. looks like you are supposed to directly include it via a script tag
I mean it even has tons of custom instructions for webpack. doesn't even work out of the box there. https://docs.mathjax.org/en/latest/web/webpack.html
Thanks @thheller. Sorry if this was obvious. My JS knowledge needs a bit of a turbo boost.
Hi! I’m having issues making Leaflet work in the build I’m trying to convert. The issue is that some plugin of Leaflet refers to the global L
variable that is traditionally exposed by leaflet. The NPM version of leaflet does not expose the global. In another lein project I fixed this by running webpack, with the following tweak:
new webpack.ProvidePlugin({
// Leaflet markercluster plugin requires global L object.
L: 'leaflet'
}),
Is there some way of solving this naturally in shadow-cljs? Seems like I could change my :js-provider
, but that would kind of remove the point of moving to shadow-cljs.
Maybe create my own cheat where I make a new module that requires leaflet and exposes the global?@ingesol :js-options {:resolve {"leaflet" {:exports-globals ["L"]}}}
in the build config might do the trick. or just (js/goog.exportSymbol "L" L)
with (:require ["leaflet" :as L])
somewhere before the plugin is loaded
worked nicely with that export-globals
thing. Tried to find it in the docs, seems undocumented for now?
Having react-native as a target, when I'm connected to "on device repl" (`(shadow/repl :app)`), I'm having a string encoding issue. when using println in the REPL all non ASCII chars are ?
any idea on how to fix that?
@defa shadow-cljs uses unicode everywhere so this should be fine. did you try shadow-cljs cljs-repl app
directly and check if it happens there too? if so it is your connection to the other REPL
@thheller hi, might be useful for you and others: https://akovantsev.github.io/corpus/shadow-cljs this is aggregated slack log on a single page, rather than spread across hundreds of 1-day=1-page files at https://clojurians-log.clojureverse.org/shadow-cljs/
I must be doing something wrong. I have a simple app build:
{:app
{:target :node-script
:output-to "out/server.js"
:main com.disney.rant-lsp/main
:compiler-options {:infer-externs true}}
:test
{:target :node-test
:output-to "out/node-tests.js"
:compiler-options {:infer-externs false}
;;:ns-regexp "-spec$"
:autorun true}}
I do npx shadow-cljs compile app
. The app runs fine, until I package it (it’s a VS Code extension). The packaging doesn’t include the .shadow-cljs
directory. This used to work, but recently I started getting this:
Error: ENOENT: no such file or directory, open '/Users/wisej041/.vscode/extensions/wdi.rant-1.0.2/server/.shadow-cljs/builds/app/dev/out/cljs-runtime/goog.debug.error.js'
@wiseman you need to run shadow-cljs release app
if you want to publish something. compile
and watch
are development builds only meant to run on the machine they were compiled on
@misha yikes that file is gigantic. doesn't seem very practical to me. where did you get the data?