This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-20
Channels
- # announcements (8)
- # babashka (19)
- # beginners (100)
- # boot (3)
- # calva (16)
- # cider (8)
- # cljdoc (6)
- # cljsrn (15)
- # clojure (73)
- # clojure-europe (7)
- # clojure-france (1)
- # clojure-italy (12)
- # clojure-nl (11)
- # clojure-sg (1)
- # clojure-uk (17)
- # clojurescript (63)
- # cursive (22)
- # data-science (2)
- # datomic (2)
- # defnpodcast (1)
- # docs (1)
- # fulcro (7)
- # graalvm (8)
- # jackdaw (1)
- # kaocha (11)
- # off-topic (26)
- # pedestal (4)
- # planck (1)
- # re-frame (35)
- # reitit (5)
- # ring (3)
- # shadow-cljs (25)
- # slack-help (11)
- # spacemacs (8)
- # specter (2)
- # tools-deps (61)
- # vscode (6)
- # xtdb (3)
I'm trying to require a json object from a json file.
(ns foo (:require ["test.json" as test-json]))
compiles to SHADOW_IMPORT("module$src$test_json.js");
, if I'm reading this correctly. Obviously that can't be found. I was expected this to work according to https://medium.com/technoetics/reading-data-from-json-files-in-react-native-3622744b75e3 saying import sample from '../dbstore/sample1.json';
would work.
Oh, sorry, I also have
:resolve {"test.json" {:target :file
:file "src/test.json"}}
FWIW :resolve
is typically only used in cases where you can't change the code that does the require (eg. in libraries)
if you can change the require that should be your first option. :resolve
doesn't give require any new options otherwise
I'm playing with uix: https://www.reddit.com/r/Clojure/comments/erdo6t/desktop_apps_in_clojurescript_and_qt/ but it doesn't exist on clojars appears it wants to be included with deps.edn via git shas: https://github.com/roman01la/uix I'd like to use hot code reloading with it so I'm looking at shadow
Build error looks like https://i.imgur.com/81uErti.png though works ok if invoked via node out/main.js
but not sure how to include uix as a dependency in shadow-cljs.edn
hmm uix library is specified in deps.edn - https://github.com/roman01la/proton-native-cljs/blob/master/deps.edn is that what you meant?
no I mean use deps.edn with shadow-cljs https://shadow-cljs.github.io/docs/UsersGuide.html#deps-edn
That worked thank you it builds, I have another error now but suspect it's not related to shadow
what is it? I know roman sometimes likes to write weird code that reaches deeply into the compiler that may cause issues with shadow-cljs 😛
lol, there was an error coming out of react-proxy for this line: https://github.com/roman01la/proton-native-cljs/blob/master/src/app/core.cljs#L200 I've replaced that locally with the same code but behind a function called main!
and updated my build's :main key to that function I now have a build without errors and running node out/main.js
runs the app without error but there's no live reloading I can see shadow is recompiling though
I think this line https://github.com/roman01la/proton-native-cljs/blob/master/src/app/core.cljs#L204 is supposed to be the line for reloading and it has meta data but I don't know if that's enough I haven't told shadow about it otherwise
ah cool I think it's working I can see println output from update!
I was assuming I could change the numbers on the calculator and immediately see that I don't think the update-proxy! thing is updating the react components properly