Fork me on GitHub
#shadow-cljs
<
2022-10-07
>
valerauko04:10:00

is it possible to "include" files at compile-time? i'd want to read my i18n dictionary YAML files into a tongue dictionary. is this possible?

valerauko06:10:42

awesome, thanks!

Yab Mas08:10:38

Is is save to assume there are no issues with https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs when there are no compiler warnings? For example in the following situation I'll get a compiler warning:

(defn some-interop-fn [obj]
  (.interopCall2 (.interopCall1 obj)))
If I typehint the obj the compiler warning disappears, does the compiler not need a typehint on the result of the first call?

thheller09:10:33

shadow-cljs "poisons" the return type to some extent, so its also assumed ^js

šŸ‘ 1
delimber11:10:57

Hi, all The question is about https://clojureverse.org/t/modern-js-with-cljs-class-and-template-literals/7450 macro. Is there a way to imitate a js behavior for empty constructor in the derived class? i.e. if there is an empty constructor then

constructor(...args){
super(...args)
}
will be generated.

delimber11:10:27

At the moment macro throws on the missing constructor and I can't use

[this & args]
and can't apply a super macro clause, something like this
(constructor [this & args]
(apply super args))

delimber11:10:31

Don't know is it worth an issue šŸ™‚ As it seems like not a 1st tier feature for shadow

thheller17:10:56

CLJS doesn't support the rest/spread JS operators, so this isn't currently possible to support no

thheller17:10:33

apply wouldn't work here since super is not a function

thheller17:10:40

but given that JS doesn't really use variadic things very much. are you sure this isn't just a lazy way to write constructur(a,b,c) { super(a,b,c) }?

delimber19:10:04

On regard of vararg have took this from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor#description, but haven't notice large note right below the default constructor description about that there is no argument spreading. Same https://tc39.es/ecma262/multipage/ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classdefinitionevaluation (point 14.a.iv). So, you are totally right here. Anyway, I can't write proper constructor with a macro without a knowledge of super class constructor args number, right?

delimber19:10:40

There is only one arg on super class in my case actually. So, just

(constructor [this arg]
  (super arg)) 
works like a charm.

delimber19:10:07

BTW, let me take this opportunity to give huge respect for this beast (shadow I mean)

šŸ‘ 1
valerauko13:10:00

@thheller do you accept contributions to shadow-css?

thheller17:10:04

depends on what it is I guess. generally yes, but best ask before sitting down to write a bunch of code šŸ˜›

valerauko17:10:55

just wanna improve the readme's instructions on how to run/watch/build

thheller17:10:05

change how? I mean the first sentence is "All of this is subject to change.", this is not meant to be final in any way and is just an example

valerauko17:10:31

ā€¢ add an example of using that css start alongside shadow/watch build watches ā€¢ add (binding [*out* (io/writer (System/out))]) around the prn calls because if it's run separately (with a shadow-cljs run for example) and it jacks in to an already-running server it loses its original stdout and crashes

thheller17:10:51

hmm? I never had a crash with this? and its running for days šŸ˜›

valerauko17:10:02

if you start shadow with yarn shadow-cljs watch app for example, then in a separate terminal you start the css watch with yarn shadow-cljs run dev.css/start, after which if you save a cljs file in a "bad" state (some typo, missing : in a css map or something) it'll try to prn to stdout but it doesn't have its own anymore resulting in a closed stream exception

valerauko17:10:21

it's not a problem obv if you start them all from the same repl

thheller17:10:12

hmm yeah well the intent with this is for a typical REPL driven workflow

thheller17:10:19

Adding an example of how to watch a build is fine

thheller17:10:40

I don't want the binding thing since that wouldn't work with my setup šŸ˜›