Fork me on GitHub
#hoplon
<
2017-05-16
>
mudphone19:05:40

Noob question: Is it possible (or is there an example I can check out) of how to build hoplon in dev for an alternative web server? For example, I am used to embedding react/reagent apps into an html page (via an ID on a div tag). My web framework creates the html page and includes the reagent js file.

mudphone19:05:16

I understand that in the advanced optimization boot task, the HTML and JS files are emitted and are deployable.

mudphone19:05:58

I was just looking at those examples and must have missed that one.

alandipert19:05:13

well, same way really. only slightly different

mudphone19:05:24

okay great, I’ll take a look at both of those

mudphone19:05:28

thank you much

mudphone19:05:41

I’d like to go with boot if possible.

alandipert19:05:48

and good choice 👌

mudphone19:05:44

I’m getting the following error on boot dev of the embedded-hoplon-example project:

Compiling Hoplon pages...
• app/main.cljs.hl
Writing main.cljs.edn...
Compiling ClojureScript...
• main.js
java.lang.AssertionError: No ns form found in file:/path/to/embedded-hoplon-example/9ek/-grrwi1/adzerk/boot_reload.cljs
cljs.analyzer$parse_ns$fn__2110.invoke  analyzer.cljc: 2761
         cljs.analyzer$parse_ns.invoke  analyzer.cljc: 2711
         cljs.analyzer$parse_ns.invoke  analyzer.cljc: 2703
   cljs.closure/find-cljs-dependencies    closure.clj:  733
   cljs.closure/add-dependency-sources    closure.clj:  800
                    cljs.closure/build    closure.clj: 1941
                  cljs.build.api/build        api.clj:  210
    adzerk.boot-cljs.impl/compile-cljs       impl.clj:   89
                                   ...
                    clojure.core/apply       core.clj:  630
                 boot.pod/eval-fn-call        pod.clj:  294
                     boot.pod/call-in*        pod.clj:  315
                                   ...
                     boot.pod/call-in*        pod.clj:  318
              adzerk.boot-cljs/compile  boot_cljs.clj:   71
         adzerk.boot-cljs/compile-1/fn  boot_cljs.clj:  126
   clojure.core/binding-conveyor-fn/fn       core.clj: 1916
                                   ...

mudphone19:05:18

I cloned the project from github and then ran boot dev in the root… am I missing something?

mudphone19:05:41

I’m more than happy to track down the error if someone can point me toward the light.

mudphone19:05:30

Maybe I’ll try bumping all the dep versions?

mudphone19:05:08

(to what’s used in the starter project)

mudphone19:05:52

Sorry for the noise, that seems to have worked. I can put a PR in if that’s helpful (just some version changes).

mudphone19:05:10

So, the other hang-up I have with using Hoplon with another web framework is that boot dev doesn’t generate any JS files which I can server from a web server. Is that correct?

dm319:05:41

you can add the target task to generate fileset into the target dir

dm319:05:01

but you shouldn’t need that when working within boot

mudphone19:05:10

Or, put another way, I’m wondering how the (serve ...) boot task gets its assets (html, and js) to serve?

mudphone19:05:39

@dm3 ah, I see, you’re assuming that I’m serving the web page via (serve ...) though, correct?

mudphone20:05:13

@dm3 thank you I’ll go educate myself 🙂

mudphone20:05:25

also, thanks for the target tip, I’m not sure why I didn’t consider it