Fork me on GitHub
#hoplon
<
2018-10-15
>
flyboarder00:10:01

it’s a dependency issue

vigilancetech01:10:07

hey @flyboarder, you have a minute to help me sort out how to get shadow's built in web server to serve up a hoplon app that doesn't use *.hl file nor (page) macro?

flyboarder01:10:42

I am working on a project like that right now

vigilancetech01:10:08

oh, cool. So I'm just getting nada. Not sure what port to use, nor how to tell shadow's ws what the main function is

flyboarder01:10:31

Can I see your configuration file?

vigilancetech01:10:19

package.json:

{
  "name": "guardian-dashboard",
  "version": "3.3.2",
  "description": "UI to JBOG guardian server",
  "main": "guardian/dashboard.js",
  "directories": {
    "doc": "doc"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+"
  },
  "author": "Jessie Umblerg/Kevin Haddock",
  "license": "ISC",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "dependencies": {
    "markdown": "^0.5.0",
    "npm": "^6.4.1",
    "util": "^0.11.0"
  }
}

flyboarder01:10:35

actually the shadow-cljs.edn

vigilancetech01:10:55

yeah, was getting that next πŸ™‚

;; shadow-cljs configuration
{:source-paths
 ["src"]

 :dependencies
 [
  [binaryage/devtools "0.9.10"]
  [adzerk/env                "0.3.1"          :scope "test"]
  [com.rpl/specter "1.1.1"]
  [hoplon/hoplon "7.3.0-SNAPSHOT"]
  [cljsjs/markdown                          "LATEST"]
  [vigilancetech/ui "0.3.0-SNAPSHOT"]
  ]

 :builds
 {:app { :target :browser
        :compiler-options {:language-in :ecmascript5-strict }
        :output-dir "public/assets/app/js"
        :asset-path "/assets/app/js"
;;        :build-hooks [(build.hop/foo)]
        :modules {:main {:entries [guardian.dashboard]}}}}}

flyboarder01:10:10

ah ok πŸ‘Œ

vigilancetech01:10:38

but my feeling is I'm needing to grok how to config the package.json to tell it where main is

vigilancetech01:10:48

that's why I put it out first

flyboarder01:10:58

:devtools {:http-root "public"
           :http-port 8080}

flyboarder01:10:28

in your build for shadow

vigilancetech01:10:06

that should go right under the app build with :target :browser and all that?

flyboarder01:10:25

yeah like after :modules map

flyboarder01:10:13

you will still need an html file

vigilancetech01:10:05

yeah, I put that in public/

flyboarder01:10:55

so you should be good to go then, the contents of that point to your js files I assume

vigilancetech01:10:09

as an aside here, I seem to be getting multiple instances of shadow's compile server when I'm working on multiple projects at the same time. Have you noticed that?

vigilancetech01:10:00

yeah, I'm assuming the script tag in my index.html is supposed to have a relative path to my main.js (or index.html.js IIRC)?

vigilancetech01:10:03

YES! Looks like its trying to load! Broken images tho, so I just gotta figure out where to copy them to. Thanks for that!

flyboarder01:10:41

yeah there should be one server per project, so it will depend on where you run the library from

vigilancetech01:10:36

hmm... too bad they won't share a JVM. Seems to take almost a gig of resident memory for each πŸ˜•

vigilancetech01:10:38

yeah, rough when you're working on an old POS computer w/only 4g!