Fork me on GitHub
#shadow-cljs
<
2022-05-02
>
huygn06:05:21

I'm picking up next-cljs repo 👀 , fun stuff!

👀 1
😷 1
thheller06:05:35

meh, that is severly outdated by now. would probably be best served by a custom :target build on top of :target :esm or so https://clojureverse.org/t/generating-es-modules-browser-deno/6116

huygn06:05:37

oh, how would I be able to export my pages fn without having to specify all of them in :exports config? :thinking_face:

thheller06:05:26

can't say. custom :target could maybe generate it somehow. haven't looked at next.js since making that repo. no clue what it looks like nowadays

huygn06:05:59

Is there a doc for using custom :target? 🙏 also I'm targeting Remix not Next.js but both are file-based routing & expect some default exports per page file

huygn07:05:11

I'll give that a try 👌

promesante07:05:35

hi guys, I'm trying to start a little project with shadow-clj / re-frame / emacs / cider with the re-frame template, https://github.com/day8/re-frame-template with lein. Opening the repl from within Emacs (C-c M-j) works ok, but when invoking any function, in different namespaces, I keep getting the same error reported:

Syntax error compiling at (*cider-repl flexiana/scrambler-fe:localhost:8777(clj)*:50:20).
Unable to resolve symbol: init in this context
and no Clojure / REPL related Emacs shortcut works, i.e. C-c C-k to compile and load current buffer, or C-c C-z to jump straight into REPL.

promesante07:05:27

I tried the same with the front-end / SPA module of the following little Clojure fullstack project I've taking as reference: https://github.com/lagenorhynque/clj-rest-api-and-cljs-spa-example, SPA: https://github.com/lagenorhynque/clj-rest-api-and-cljs-spa-example/tree/master/todo-app, but in that other context, I keep getting exactly the same issues described above.

promesante07:05:39

Futhermore, as I start up the SPA from CLI as explained in its README:

$ npm install
$ npx shadow-cljs watch app
the SPA works well, but when started up by starting up the REPL from Emacs (C-c M-j), the SPA runs, but reporting the following warning:
shadow-cljs - Stale Output! Your loaded JS was not produced by the running shadow-clj instance. Is the watch for this build running?

thheller07:05:46

the stale error you likely get because you have 2 separate shadow-cljs instances running for the project at the same time. interfering with each other. when you have the watch running separately you need to "connect" in cider, not "jack-in".

thheller07:05:31

@lmrosso you are in the Clojure REPL. that needs to be switched to CLJS first. can't say how to do that in emacs. don't know how current this is https://shadow-cljs.github.io/docs/UsersGuide.html#cider

promesante07:05:02

hi @U05224H0W, thanks for such a quick reply, let me take a look...

promesante15:05:35

hi @U05224H0W, yes, that was one of the very few docs I was able to find out and, as far as I understand, I've taken into account in this config

thheller15:05:45

I cannot comment on any cider related issues. I don't use emacs so I really do not know. all I can see from the screenshots is that you are in a Clojure REPL

thheller15:05:23

as far as shadow-cljs is concerned you switch that via evaling (shadow/repl :your-build-id-here)

thheller15:05:37

I don't know if cider expects or needs anything on its end

promesante18:05:58

asking in cider channel as well, but no reply there yet, thanks !

thheller19:05:42

I mean connecting vs jack-in? you didn't describe what you do on the emacs side so maybe there is just something missing there?