shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Aron 2021-06-14T11:24:35.042700Z

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.

thheller 2021-06-14T11:45:13.044400Z

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

thheller 2021-06-14T11:47:29.045300Z

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

Aron 2021-06-14T11:59:11.046400Z

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

Aron 2021-06-14T12:02:19.047200Z

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

thheller 2021-06-14T12:16:01.047800Z

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

thheller 2021-06-14T12:16:19.048100Z

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

Aron 2021-06-14T14:21:12.050Z

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

2021-06-14T16:09:38.051Z

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?

thheller 2021-06-14T16:12:16.051300Z

you are supposed to fix warnings not ignore them 😛

1💯
2021-06-14T16:12:48.051800Z

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

2021-06-14T16:12:54.052100Z

but that's a totally fair stance

2021-06-14T19:07:04.053500Z

I'm having some bizarre problem importing and using the npm package, which I haven't encountered before. <https://date-fns.org/v2.22.1/docs/Time-Zones>

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

thheller 2021-06-14T19:09:33.054900Z

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

thheller 2021-06-14T19:09:54.055300Z

which shadow-cljs version? which :target?

2021-06-14T19:11:02.055800Z

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

2021-06-14T19:16:16.056Z

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

thheller 2021-06-14T19:19:32.056500Z

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

thheller 2021-06-14T19:22:24.056900Z

FWIW you call looks wrong to begin with?

thheller 2021-06-14T19:22:35.057100Z

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

thheller 2021-06-14T19:22:59.057300Z

thats not what you have?

2021-06-14T19:23:46.057500Z

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

2021-06-14T19:35:06.057800Z

on a clean project it works

2021-06-14T19:35:29.058Z

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

thheller 2021-06-14T19:37:09.058300Z

sometimes just restarting shadow-cljs might help

thheller 2021-06-14T19:37:21.058600Z

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

thheller 2021-06-14T19:37:42.059Z

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

2021-06-14T19:40:08.059300Z

I tried, also deleted the .shadow-cljs folder

2021-06-14T19:41:35.060400Z

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

2021-06-14T19:42:37.060700Z

not just import, but the later use of

2021-06-14T19:44:28.060900Z

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

thheller 2021-06-14T19:46:10.061800Z

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

2021-06-14T19:46:31.062Z

argh

2021-06-14T20:07:54.062200Z

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

thheller 2021-06-14T20:08:14.062700Z

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

thheller 2021-06-14T20:08:36.063200Z

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

thheller 2021-06-14T20:08:49.063500Z

maybe they sandboxed some more. really don't know

2021-06-14T20:09:41.063800Z

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

2021-06-14T20:10:19.064100Z

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

thheller 2021-06-14T20:11:01.064700Z

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

2021-06-14T20:11:52.065400Z

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

thheller 2021-06-14T20:11:57.065700Z

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

2021-06-14T20:12:00.066Z

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

thheller 2021-06-14T20:12:31.066400Z

works in the browser or works in electron?

2021-06-14T20:13:00.066600Z

I created a clean repo and added electron

2021-06-14T20:13:14.066800Z

and works as above

2021-06-14T20:14:26.067Z

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

thheller 2021-06-14T20:14:44.067200Z

could be a dependency version conflict in some npm package

thheller 2021-06-14T20:16:01.068300Z

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

thheller 2021-06-14T20:16:34.068700Z

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

2021-06-14T20:17:01.068900Z

no, 2.14.5

2021-06-14T20:39:38.069300Z

I found it.