This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-03
Channels
- # babashka (5)
- # beginners (34)
- # biff (3)
- # calva (29)
- # cherry (11)
- # cider (7)
- # clojure (148)
- # clojure-brasil (1)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (6)
- # clojuredesign-podcast (8)
- # clojurescript (49)
- # cursive (1)
- # datalevin (7)
- # fulcro (1)
- # honeysql (1)
- # jobs (1)
- # matrix (7)
- # off-topic (13)
- # re-frame (12)
- # react (21)
- # reagent (42)
- # releases (6)
- # remote-jobs (2)
- # shadow-cljs (9)
- # solo-full-stack (5)
- # sql (7)
- # squint (9)
- # vim (2)
- # xtdb (11)
- # yamlscript (5)
shadow serve index.html from the public/
folder.
is it possible to create a bunch of json files under public/data/
and list those files using only client side code?
that would be an extreme security hole is everyone could just list any directory contents
what might help is having an index.json
file that contains paths to all the json files you care about. But it would be up to you to update that index.json
file
Hi,
I'm upgrading shadow-cljs on a project that hasn't been touched for a while and I'm running into an issue where I'm not sure how to proceed.
The upgrade is from version 2.8.61
to 2.25.7
.
The issue is that we integrate with a product that uses google closure itself; during dev the goog libraries clash. So the project builds, but when I run the artifact in the browser I get Error: Namespace "goog.X" already declared.
errors. Release build seems to run fine.
The existing fix uses a build-hook and runs the following code in the compile-finish
stage (update build-state :unoptimizable str "window.goog = {};" "\n")
This worked in the old version but doesn't work anymore after upgrading.
I'm unable to find anything about this :unoptimizable
key in the documentation and I've understood it was setup from reading the source. I tried setting :prepend
and :prepend-js
on the module from the build-hook but it seems to be set too late in the js output; i.e. the goog initialisation happens before my :prepend
value.
Any tips on how to proceed on this?
hmm but how did that work? I mean you are forcefully overriding goog
, which means the other stuff using closure gets deleted?
I'm not sure. My interpretation was that we reset the closure library that was initialised by the platform and simply let shadow initialise it again, which is a bit silly but avoids the "already declared" issue. I didn't expect that line to remove any app specific code, just the goog library stuff (and Im also not seeing any behaviour that suggests otherwise). But my understanding of all this is pretty shallow so my interpretation might be wrong. All I know for sure is that this worked with the mentioned older version of shadow (and that I get the same "already declared" errors when I remove the build hook) but that it doesn't work anymore with the newer version. In the end I obviously just want to fix the "already declared" errors and I don't necessarily have to fix this build hook, so if you have advice from a different angle I would be happy with that as well.