Fork me on GitHub
#shadow-cljs
<
2021-10-28
>
Hukka08:10:15

I can't figure that (0, whatever). Why does typescript do that, what's the trick?

David Vujic09:10:25

Is it the compiled/transpiled output to ES5? In that case, it might have to do with references, function calls and the this thing šŸ˜„

thheller17:10:46

why they started doing this I don't know exactly

thheller17:10:06

I expect it has something to do with matching how ESM imported functions are called

Franklin09:10:18

hello šŸ‘‹ . I would appreciate your help here but I'm not certain if I have given enough info/context https://stackoverflow.com/questions/69751508/unclear-error-from-react-leaflet-with-shadow-cljs

Franklin10:10:15

actually found a solution for this

Otto Nascarella18:10:46

hi there sorry if I am asking something really stupidā€¦ when you configure your shadow-cljs project to run tests in the browser, it compiles all tests to a single file. are there intermediate steps for that compilation? Iā€™ve been feeling that it is getting slower and slower as the project grows.

thheller18:10:03

I don't understand the question? I mean the more code you have the more time it is going to take to compile? do you use watch in which case it shouldn't matter much since its incremental and only recompiles what changes?

thheller18:10:30

but I do agree that there needs to be a better test runner that doesn't always run all the tests. just need time to build it šŸ˜›

šŸ•“ 1
Otto Nascarella19:10:32

yeah. compilation has watch. and we have some sort of way to choose the namespaces we wanna run tests on. but on each save, it takes quite a lot to change the interfaceā€¦

Otto Nascarella19:10:59

my point wasā€¦ the target folder you see each module from cljs-runtime in a separate js file. whereas the test files are all in one bundle.

Otto Nascarella19:10:39

in fact, it does have each module in a file (TIL)

thheller19:10:23

I don't understand why you want that though? it actually performs worse to load many files instead of one

thheller19:10:10

but in watch is only hot-reloads the files that changes anyways so that is entirely different thing that is also much faster

Brandon Olivier21:10:01

has anybody used shadow-cljs much with electron?

Brandon Olivier21:10:24

Iā€™m having a lot of issues import ipcRenderer but, based on the electron docs themselves, I donā€™t understand why.,

Brandon Olivier23:10:23

In case anybody else has the same problem, I figured it out. You can no longer directly access ipcRenderer through electron in the renderer process. You have to access it in a ā€œpreload scriptā€ which you can access when you start the browser window. I just created a resources/preload.js file and added ipcRenderer to the window object. https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts

thheller07:10:26

are you sure you are "allowed" to do that? I mean that to me seems to represent the security issue that preload scripts are supposed to prevent?

thheller07:10:36

I haven't looked at electron stuff in a long time (long before preload scripts) but it might be feasible to create a special :target for this. too busy currently to figure it out though