This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-09
Channels
- # announcements (5)
- # beginners (53)
- # clj-kondo (4)
- # cljdoc (3)
- # cljs-dev (11)
- # cljsjs (1)
- # clojure (59)
- # clojure-europe (15)
- # clojure-italy (6)
- # clojure-nl (9)
- # clojure-spec (22)
- # clojure-uk (26)
- # clojurescript (16)
- # clojutre (6)
- # cursive (27)
- # datomic (34)
- # duct (1)
- # figwheel-main (2)
- # fulcro (12)
- # graphql (14)
- # jackdaw (9)
- # jobs (1)
- # kaocha (4)
- # luminus (1)
- # off-topic (11)
- # pathom (1)
- # pedestal (2)
- # re-frame (6)
- # reagent (10)
- # ring-swagger (34)
- # shadow-cljs (47)
- # spacemacs (21)
- # sql (3)
- # tools-deps (37)
- # uncomplicate (11)
- # vim (17)
Hey, I'm sorry to bother you. I'm curious whether it is necessary to write the properties and functions for all objects
in app.txt
, which refer to:
https://shadow-cljs.github.io/docs/UsersGuide.html#_simplified_externs
Actually, if it dosen't afford, some warning appear. But it seems that it will not affect the compile result.
It's a compile mechanism, but I also want to get some solutions about it. It's too trouble to add them manually.
@180338742 try using https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs
@thheller Maybe a little related. I want to avoid the externs, which also the clojurescript official suggestion. And with app.txt
also a kind of externs, is it?
@thheller is there any way I can help bring about preamble support? This would be useful for conforming to licenses like MIT and Apache 2.0
@levitanong its already supported?
well, it could be better I suppose since pasting a license into your build config would suck
@thheller oh! I looked at this: https://shadow-cljs.github.io/docs/UsersGuide.html#compiler-options. Perhaps a line could be added saying instead of preamble, use prepend?
But yes, pasting a license to my build config isn’t ideal 😛
(-> (shadow/get-build-config :your-build) (update-in [:modules :main] assoc :prepend (slurp "whatever.doc")) (shadow/release*))
Oh that’s funky! Never thought to use it in that way
Thanks for the tip!
Hi!
Applying the proposed change (`global-eval` -> js/eval
on src/main/shadow/cljs/devtools/client/browser.cljs
) seems to fix the CLJS REPL breakage on 2.8.52
!
I'm not sure whether that's good or bad news, though 🙂
@thheller 👋 hey! does shadow-cljs support css-in-js in compilation, that is to say, turning all of the CSS modules into .css files?
IIRC, no.
We have css-in-js (via garden
) and also regular clj
tasks to accomplish the css file generation
no it does not. but you can use the same approach described here to compile your own .css -> .js and include the .js files https://shadow-cljs.github.io/docs/UsersGuide.html#_javascript_dialects
Hi! I’m trying to use https://github.com/yamill/react-native-orientation. I put this in my ns:
(ns app.core
(:require [reagent.core :as r :refer [atom]]
["react-native" :as rn :refer [AppRegistry, Platform]]
["react-native-orientation" :default Orientation]))
I then try to use it: (js/console.log "Orientation:" Orientation)
, but it is undefined. In the verbose
compile output, I see that it is being flushed (`<- Flush: shadow.js.shim.module$react_native_orientation.js (1 ms)`). What am I doing wrong? (I have infer-externs auto enabled)@stefan.van.den.oord try ["react-native-orientation" :as Orientation]
@thheller Thanks, that worked. How could I have known this? I did follow the manual correctly I believe? (https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages)
Right. So can I propose to add that to that table? So in the cell with :default add:
> or: (:require ["module-name" :as defaultExport])
if the module is a commonJS module
I can also add a (“see also”) link in the table to that section about default exports.
hold off on that. I suspect there is going to be a few more changes in the future when more packages are actual ESM packages
is there a way to include local javascript files rather than npm installed packages with shadow-cljs?
i’ve got this kinda edge case where i can install the library i need and it’s dependency via npm, but shadow-cljs doesn’t like it, as the higher level library includes the other like this
const AuthenticationContext = require('expose-loader?AuthenticationContext!adal-angular')
here’s the error i get
[:app] Build failure:
The required JS dependency "expose?AuthenticationContext!adal-angular" is not available, it
was required by "node_modules/nm-adal/index.js".
Search in:
src/project/node_modules
You probably need to run:
npm install expose?AuthenticationContext!adal-angular
See: