Fork me on GitHub
#shadow-cljs
<
2021-06-14
>
Aron11:06:35

I need some general advice, if someone has it. I have found this https://github.com/thheller/reagent-react-native and trying to adapt it to a windows-wsl setup. I am not sure which part should be inside of WSL, has anyone done something similar that's available publicly? 🙂 I know I am asking for much, but from the answers it seems I might be better of just ditching windows for any project using react native with shadow-cljs.

thheller11:06:13

why would ditching windows be a factor? I mean I use windows so I know that all the commands work fine there. don't have a clue about react-native and wsl though

thheller11:06:29

given that I made the reagent-react-native demo on windows I assume it works fine still 😉 IIRC I didn't use wsl though

Aron11:06:11

wait, so everything inside windows? i have not yet tried that, using git with ssh was difficult last time

Aron12:06:19

anyway, this is exactly the kind of information I needed, thanks

thheller12:06:01

I mean I use WSL1 still so I have all the files on my windows drive and access them using windows tools

thheller12:06:19

just some command line stuff I run through WSL sometimes. shadow-cljs I mostly run directly in windows. RN too because of the emulator stuff

Aron14:06:12

makes total sense, I am just starting with react native (again, once I tried it several years ago), everything is new, I don't even know which bit goes where

chrisetheridge16:06:38

is it possible to disable certain warnings being outputted to the console during dev builds? something like :ignore in :warnings-as-errors, but to disable output instead?

thheller16:06:16

you are supposed to fix warnings not ignore them 😛

💯 2
chrisetheridge16:06:48

haha totally agree with you. its coming from an interned (no longer maintained) library, which is my reasoning

chrisetheridge16:06:54

but that's a totally fair stance

ribelo19:06:04

I'm having some bizarre problem importing and using the npm package, which I haven't encountered before.

["date-fns-tz" :rename {format dtftz.format}]
...
(dtftz.format (js/Date.) "Europe/Berlin")
;;=>
module$node_modules$date_fns_tz$index is not defined

thheller19:06:33

this would be a lot more helpful if it was an actual reproducible snippet

thheller19:06:54

which shadow-cljs version? which :target?

ribelo19:06:02

thheller/shadow-cljs {:mvn/version "2.11.23"} :target :browser

ribelo19:06:16

I upgraded the shadow-cljs version to the latest 2.14.5, but it doesn't change anything

thheller19:06:32

then it should be easy to make a reproducible repo. can't say much else.

thheller19:06:24

FWIW you call looks wrong to begin with?

thheller19:06:35

const output = format(zonedDate, pattern, { timeZone: 'Europe/Berlin' })

thheller19:06:59

thats not what you have?

ribelo19:06:46

sure, I will check one more thing and do repo right away

ribelo19:06:06

on a clean project it works

ribelo19:06:29

which means I need to see what I have broken and where

thheller19:06:09

sometimes just restarting shadow-cljs might help

thheller19:06:21

if you run npm install while shadow is running it sometimes gets confused

thheller19:06:42

dunno if you did that but restart is always a good check 😛

ribelo19:06:08

I tried, also deleted the .shadow-cljs folder

ribelo19:06:35

but what else I have noticed, which may give some guidance, in this particular project also importing via ["date-fns/format" :as format] also causes the same type of error

ribelo19:06:37

not just import, but the later use of

ribelo19:06:28

the fact that it is an electron should be rather irrelevant, shouldn't it?

thheller19:06:10

not really. that is very relevant. it is not a regular browser anymore

ribelo20:06:54

this is not an electron issue either, because again on a relatively clean project it works

thheller20:06:14

I mean did you try this in actual code anywhere? maybe the REPL is not the best place to verify it

thheller20:06:36

don't know any particulars about electron but I know they changed some security related things

thheller20:06:49

maybe they sandboxed some more. really don't know

ribelo20:06:41

I'm trying something like (js-keys dtf-tz)to see if it even exists and what it has inside

ribelo20:06:19

never mind, thanks for your time, if I figure it out, I'll share

thheller20:06:01

that is checking the wrong thing if dtf-tz is undefined what module$node_modules$date_fns_tz$index is not defined basically means

ribelo20:06:52

I don't really know what I'm checking, but I know that if it works, it spits out a list of functions, and on a clean project it works

thheller20:06:57

in the browser you can easily verify it it the console since it will even autocomplete once you start typing module$...

ribelo20:06:00

(js-keys dtf-tz);; => #js ["format" "getTimezoneOffset" "toDate" "utcToZonedTime" "zonedTimeToUtc"]

thheller20:06:31

works in the browser or works in electron?

ribelo20:06:00

I created a clean repo and added electron

ribelo20:06:14

and works as above

ribelo20:06:26

it doesn't work in one particular project and I'm curious why and what I've messed up, especially as it has >1y and maybe I've misconfigured something somewhere

thheller20:06:44

could be a dependency version conflict in some npm package

thheller20:06:01

did you restart shadow-cljs after updating it? and updated it in the correct place? I did fix a bug somewhat related to this not too long ago. definitely after 2.11.23

thheller20:06:34

or did you test with the 2.11.23 in the empty project?

ribelo20:06:01

no, 2.14.5

ribelo20:06:38

I found it.