Fork me on GitHub
#shadow-cljs
<
2018-05-10
>
jmckitrick10:05:03

I see the cider integration docs are still marked ‘help wanted’. I’m interested in helping clarify that section, once I have a few details nailed down.

jmckitrick11:05:00

I’m not sure if my method of integrating with cider is unofficial or wrong. What’s the difference between shadow.cljs.devtools.api/nrepl-select and shadow.cljs.devtools.api/repl ?

jmckitrick12:05:35

Also, once I build my project, what’s the best way to deploy it in a container-friendly way?

jmckitrick12:05:58

With a back and front-end project, I’d have a jar, which works nicely with Docker.

thheller13:05:46

@jmckitrick I'm not an emacs user so I don't know how to configure anything. help is definitely welcome. repl delegates to nrepl-select nowadays so it doesn't matter much which on is used.

jmckitrick13:05:14

ok, cool. I’ll put together some points and open a PR

thheller13:05:17

deploy depends entirely on your setup. jars works although I personally do not recommend them since you need to restart your server to reload the cLJS

jmckitrick13:05:34

If not a jar, what else for front-end only?

jmckitrick13:05:50

I’m trying to be as devops friendly as possible 😉

thheller13:05:48

its just a .js file, just copying that should be enough

thheller13:05:59

jar file implies you have a java webserver running as well

jmckitrick13:05:10

Right, and I don’t want that.

jmckitrick13:05:34

So we’d need a build step that copies the payload into our client app.

thheller13:05:35

so just take the js file(s) and copy them to a directory

thheller13:05:40

and use any webserver to serve it

jmckitrick13:05:10

Yeah, that’s what I figured. I was hoping there was a more self-contained way to do it that didn’t depend on relative paths to other projects. Oh well.

jmckitrick13:05:48

Maybe what I need to do is move this project into that one, and call shadow as part of that build.

thheller13:05:50

don't unterstand what you mean

jmckitrick13:05:20

Well, this project is in its own repo. And we like to be able to deploy components into containers from standalone repos, where possible.

thheller13:05:50

no idea what that means "deploy components into containers"

jmckitrick13:05:22

So each repo represents a component, either a server, a nodejs front-end, etc.

jmckitrick13:05:45

Each repo is deployed into a docker container, which is deployed into Rancher or Kubernetes

jmckitrick13:05:52

Without dependencies on other components.

thheller13:05:11

yes but your server must serve the .js files

thheller13:05:21

how else would the client access them

jmckitrick14:05:54

Correct. Node comes with express, and obviously a jar file would have netty or something similar.

thheller14:05:19

is express directly serving the traffic or is something like nginx in front?

thheller14:05:24

or any other loadbalancer?

thheller14:05:44

how do you deal with other assets? ie. css, images, etc

jmckitrick14:05:51

express is a tiny server that just serves up the index, js, and css for one component.

jmckitrick14:05:19

This is all behind Rancher, loadbalancer, nginx, etc

jmckitrick14:05:46

Anyway, I don’t mean to bore you with our devops details, I just want to pick the best way to get our payload into our build.

thheller14:05:52

I would just copy things to a path that nginx is serving

jmckitrick14:05:00

Right, that’s probably what we’ll do.

thheller14:05:23

things used to be so much simpler without all these containers 🙂

jmckitrick14:05:54

Yep! I think I found my answer. Since this is all npm-integrated, I’ll configure the project to serve the assets with express.