This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-26
Channels
- # aleph (9)
- # announcements (10)
- # aws (1)
- # beginners (65)
- # calva (9)
- # cider (11)
- # clj-kondo (1)
- # cljdoc (61)
- # cljsrn (6)
- # clojars (2)
- # clojure (40)
- # clojure-austin (1)
- # clojure-belgium (1)
- # clojure-europe (4)
- # clojure-finland (1)
- # clojure-france (1)
- # clojure-italy (57)
- # clojure-nl (6)
- # clojure-spec (134)
- # clojure-uk (67)
- # clojuredesign-podcast (2)
- # clojurescript (40)
- # cursive (25)
- # datascript (1)
- # datomic (8)
- # events (1)
- # figwheel-main (18)
- # fulcro (36)
- # immutant (5)
- # jobs (5)
- # joker (3)
- # kaocha (41)
- # leiningen (4)
- # luminus (4)
- # off-topic (13)
- # onyx (8)
- # pedestal (2)
- # perun (7)
- # planck (2)
- # protorepl (9)
- # re-frame (3)
- # reagent (73)
- # reitit (5)
- # shadow-cljs (186)
- # sql (4)
- # vim (1)
- # yada (2)
in a release
for the :browser
target, has anyone experienced local paths appearing in the build artifact? im trying to figure out where that might be leaking in
I've never uploaded a package to clojars before. I'm looking to wrap an npm library and publish that on clojars. Could anyone help me understand the build and publish process or point me somewhere I can learn more about it?
@nolan that is probably something doing a require("package.json")
. some js packages do that
confirmed that this is whats happening. not a problem was just curious where that might be coming from. thanks a million as always @thheller
feel free to open an issue about that. the fields added by npm/yarn should probably be removed so they don't pollute the build
ill open one to keep it on the radar and easy to track. its not a particularly harmful thing but seems extraneous to the artifact and worth being aware of
Hm...
I just tested the template (shadow-cljs + reagent) by @jacek.schae
https://github.com/jacekschae/shadow-reagent
It works in watch mode, but when I do compile or release, index.html is throwning this error TypeError: app.core is undefined
whereas file exists and is set in shadow-cljs.edn
:modules
{:main
{:entries [app.core]}}
(in case you open index.html
directly of the filesystem you need to change the path)
Yes I wanted to open it directly. I just had to change paths in index.html
, sorry for the noise 😉
https://github.com/thheller/shadow-cljs/issues/530#issuecomment-515574124 I think it's a little hard to avoid something even you knew it.
@doglooksgood wouldn't just using whatever the load-file-in-repl
command is in emacs/cider solve this problem? that should be working normally?
I fully agree that this situation is bad ... but I cannot easily fix it without possible breaking someone elses workflow
strictly speaking you also don't need to restart shadow-cljs. just the watch but thats besides the point
I don't know anything about cider but any clj/s REPL has a built-in command for load-file
which force loads the actual file from disk
It's more like a function, you can write (cider-load-file "some.clj")
in elisp.
but as almost every tutorial they will teach user use a command called C-c C-k
, that is cider-load-buffer
.
will load current buffer.
no that simple, because cider have many commands, like it can load a file from beginning to current cursor position.
the issue you reported is due to the REPL workflow not playing nice with the hot-reload
I'm just not sure how to reliable find a solution that works in an acceptable manner for both workflows
but that might then create problems for someone that prefers the REPL as the ultimate truth
you eval something at the REPL like (defn foo [] 2)
but in the file you have (defn foo [] 1)
The Clojure didn't have a hot-reload. But in Clojure, When you save a file and load it, it will revert the REPL state.
just adding the :require
to foo.core
will NOT trigger a reload of bar.core
from disk
so the "safe" guess is probably to throw away the REPL state and just reload from disk
I understand your point now, but how hot-reload work shouldn't be understand as "When I save the file, file content will be loaded in the REPL"?
for example in Cursive there is a "sync files in REPL" command which I use quite frequently
but rarely people use it, that what I mean you won't care about this workflow in Clojure. That doesn't mean you can't hot-reload in Clojure.
I can't understand this case, cause If I don't want hot-reload triggered, I just NOT save the file.
yes ... but you see how there are multiple workflows and how fixing one can break another?
just saying that I want to consider a proper solution first before coming up with a quick fix that fixes your particular problem
well the real problem I want to fix first is that reloading the browser makes the problem worse
But I want to say, in Clojure, there're some auto test libraries, that will auto reload test when file is saved.
but that really doesn't matter ... we completely agree that the current state is bad and needs to be fixed
The problem is in Clojure you don't have to do this. I don't know how the workflow you mentioned will work with auto-test-refresh in Clojure.
lets define it this way: when you use hot-reload you care more about that the state of the REPL matches what is saved in files
I think it should be fine if I fix the real problem in that a browser-reload fixes the actual problem instead of making it worse
that this "empty" file exists in disk is the real problem
goog.provide('bar.core');
goog.require('cljs.core');
//# sourceMappingURL=bar.core.js.map
what will this file be looks like if that is fixed? the content of repl or the content of file?
in your repro you first SAVE bar.core
. shadow-cljs watch kicks in and finds that the file is not used in the build so it is not compiled
then you add the require. require will find the ns loaded in the REPL and not recompile the file
yes and I'm telling you how it ends up in that bad state from the view of shadow-cljs
I was thinking you are telling me, the file should be never load, unless I trigger something
(load-file "/full/path/to/bar/core/cljs")
in the REPL however that is done in cider should fix it
I know what the problem is ... just need to find a proper way to fix it in the actual implementation
[:result {:type :repl/error, :ex #error {
:cause "symbol bar.core already provided by [:shadow.cljs.repl/resource \"bar/core.cljs\"], conflict with [:shadow.build.classpath/resource \"bar/core.cljs\"]"
:data {:provide bar.core, :conflict [:shadow.cljs.repl/resource "bar/core.cljs"], :resource-id [:shadow.build.classpath/resource "bar/core.cljs"]}