Fork me on GitHub
#shadow-cljs
<
2019-05-23
>
vigilancetech01:05:00

Has anyone here gotten the demo to work with msys2?

thheller06:05:10

what is msys2?

thheller07:05:13

@hlolli the way the current :react-native target works seems to be the only one thats reliable enough. the re-natal/figwheel-bridge approach also works ok-ish but the problem I found with that is that initialization becomes async. so you have to render a temporary "app is loading" component and then swap in the real one once it is loaded

thheller07:05:27

that implies having a different setup for development than production

thheller07:05:43

and also causes problem for things like react-native-navigation as far as I understand it

thheller07:05:06

if the RN folks just fix their source map support everything would be done

thheller07:05:25

as far as I can tell thats the only real issue left

hlolli09:05:26

stacktraces, and clojure compile errors (hud), they would come hand in hand with a source map support?

thheller09:05:28

stacktraces require source maps yes

thheller09:05:43

for compile errors all the data we need to available in the compiler

thheller09:05:49

so metro doesn't factor into any of that

nate14:05:09

Hello, is there a way to require json files, doing something like this (:require ["./multisig-abi.json" :as multisig-abi]) ?

nate14:05:59

for context I need to read a JSON file as part of a firebase function I'm writing

Mno14:05:09

Maybe JSON.parse from javascript would help? It would give you a js object which you can pass through js->clj if needed.

nate14:05:51

I'll have to first read the file from disk then, any suggestions on how to do that without having to for example evaluate clojure at compile time by wrapping slurp in a macro ?

nate14:05:03

The other option is to just rewrite the content of the json file in a def

Mno15:05:04

The only way I would know is using slurp unfortunately.. but maybe that would work.

nate15:05:10

Awesome, this is exactly what I needed. Thanks 👍

Mno15:05:10

No problem! good luck!

mss17:05:03

hi there, newbie-ish q about the cljs compiler. I might be asking this in the wrong place, but using shadow to do my compilation so figured I’d try this channel first. is there a way to bundle all generated code up in a single file (like in advanced optimizations), except with no optimizations applied? I’m outputting a node script that’s preloaded on electron webviews. closure modules in non-advanced comp modes try and resolve deps based on relative paths, which doesn’t work in this case as there’s a separate hostname prepended to every dep load. e.g. an output with a main fn in /my/local/lib.js which requires /my/local/dep.js is preloaded onto . when /my/local/lib.js tries to load /my/local/dep.js, it does so as . apologies if that’s a bit confusing. please let me know if so and I can clarify. if anyone has any ideas for how to solve this besides just programming w/ advanced mode turned on, I’m all ears

lilactown19:05:08

I recall thheller was working on a :single-file bundle option for node scripts but I think he ran into some blockers

thheller21:05:47

@mss you can set :devtools {:loader-mode :eval} which creates a single file. you'll need to use the :target :browser though since :node-script isn't really the correct target for webviews. see https://clojureverse.org/t/improving-initial-load-time-for-browser-builds-during-development/2518

🙌 4