untangled

NEW CHANNEL: #fulcro
fragamus 2017-01-01T03:23:00.001476Z

OK, I am building an uberjar for the untangled/todomvc app and a lot of namspace references don't match the final locations in the jar. todomvc.system ends up in server/todomvc/system, etc. I could go through and fix them but I want to maintain some continuity with the original code. I know this is a newb question, but I have spent some time researching and it's time to humble myself and ask.

fragamus 2017-01-01T03:49:19.001477Z

I now realize that this is problematic and that I may have to either move stuff in the final jar or fix references. Maybe I can control lein better in the creation of the uberjar.

sova-soars-the-sora 2017-01-01T04:43:43.001478Z

@fragmus so you git cloned the code and are now making an uberjar? and things ain't lein'n up?

fragamus 2017-01-01T05:15:44.001479Z

well - the original app is wonderful and I want to run it on heroku as an uberjar; their buildpack for clojure makes one automatically BUT yeah the stuff is structured in the jar just the same as in github which is different than the namespace references. I am writing a hack that expands the jar and moves a few things and re-creates the jar. I call it jarjar because everyone will hate it.

fragamus 2017-01-01T05:37:21.001480Z

Well jarjar seems to work; My process came up on heroku. The virtue of jarjar is that I can track the original untangled/todomvc project and just have a few things different rather than moving a lot of stuff.

adambros 2017-01-01T08:43:41.001485Z

@fragamus I can't think of a reason that you couldn't move stuff around so they match.

tony.kay 2017-01-01T17:05:27.001490Z

@fragamus I just checked out master on todomvc and uberjar works perfectly. Sounds like you messed with the project file.

tony.kay 2017-01-01T17:07:16.001491Z

my guess is you might have been triggering a pom generation and a maven package possibly? I think you have to tell heroku to use lein itself...I've done it before and don't remember having that problem.

tony.kay 2017-01-01T17:14:01.001492Z

I just found the project I have deployed there.

tony.kay 2017-01-01T17:14:23.001493Z

I’m using the clojure buildpack, this project and Procfile:

tony.kay 2017-01-01T17:15:56.001496Z

and the content of src/server/config/prod.edn is { :port :env.edn/PORT }

tony.kay 2017-01-01T17:16:48.001497Z

I’m deploying to heroku through a git remote

tony.kay 2017-01-01T17:18:12.001498Z

I have a vague memory of having to be sure :min-lein-version was set, or it used too old of a lein…perhaps that is the problem

tony.kay 2017-01-01T17:22:35.001500Z

Yeah, I just looked through my old build logs. That was exactly my problem early on.

tony.kay 2017-01-01T17:55:04.001502Z

I just added an appendix to the Dev Guide on this. on develop and master…will deploy live asap

fragamus 2017-01-01T21:06:52.001508Z

Trying to apply all of this to deploying untangled-todomvc on heroku.

notanon 2017-01-01T21:40:08.001510Z

should figwheel and figwheel-sidecar be a dev dependency and not an actual dependency? (completely guessing... take it for what it's worth)

notanon 2017-01-01T21:44:44.001511Z

just basing my comment off the figwheel-template example. https://github.com/bhauman/figwheel-template/blob/master/src/leiningen/new/figwheel/project.clj

notanon 2017-01-01T21:44:55.001513Z

you can see the dependency for sidecar is only in the dev profile, line 101

tony.kay 2017-01-01T21:49:41.001515Z

@fragamus One of your namespaces is asking for figwheel de stuff, AND is on your production build classpath. Make sure you don't have your user namespace as part of your primary source paths. You need to learn about the tools. None of these are Untangled issues.

tony.kay 2017-01-01T21:50:30.001516Z

you might find that adding :verbose true to your cljs build might help with the error messages.

tony.kay 2017-01-01T21:51:06.001517Z

but in this case, I just suspect you have your dev user REPL namespace on the source path of your uberjar build

fragamus 2017-01-01T21:52:46.001518Z

no, I even commented out all such builds

fragamus 2017-01-01T21:53:07.001519Z

I will figure it out

tony.kay 2017-01-01T21:53:13.001520Z

git grep figwheel

tony.kay 2017-01-01T21:53:26.001522Z

something is asking for figwheel stuff in your production build

fragamus 2017-01-01T21:53:36.001523Z

ok i shall look for that

tony.kay 2017-01-01T22:17:58.001525Z

Caused by: java.io.FileNotFoundException: Could not locate figwheel_sidecar/repl_api__init.class or figwheel_sidecar/repl_api.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name., compiling:(user.clj:1:1)

tony.kay 2017-01-01T22:18:19.001526Z

means that your user.clj namespace was attempted to be compiled, and that it has a require for sidecar repl

tony.kay 2017-01-01T22:18:35.001527Z

BUT, in production, your user.clj should not even be present

tony.kay 2017-01-01T22:19:01.001528Z

your problem is in your project.clj file.

tony.kay 2017-01-01T22:19:23.001529Z

your source path is including wherever user.clj is...OR you moved user.clj into your production source

tony.kay 2017-01-01T22:19:49.001530Z

either way you're getting code that is not meant for production into your production uberjar, and then when it tries to compile it tries to pull in dev-time stuff

tony.kay 2017-01-01T22:20:01.001531Z

which won't be there, because your classpath for production should not include it

tony.kay 2017-01-01T22:22:03.001533Z

:source-paths ["dev/server" "dev/watcher" "src/client" "src/server" "specs/client" "specs/server"]

tony.kay 2017-01-01T22:22:05.001534Z

is wrong

tony.kay 2017-01-01T22:22:25.001535Z

should be "src/server"

tony.kay 2017-01-01T22:22:38.001536Z

then in your profiles, put the other stuff on the source paths

tony.kay 2017-01-01T22:23:12.001539Z

test source goes under :test-paths (specs)

tony.kay 2017-01-01T22:23:40.001541Z

the dev stuff never goes on anything in the top-level source-paths

tony.kay 2017-01-01T22:24:10.001542Z

So, in :profiles { :dev { :source-paths [...stuff for dev only...]}}

tony.kay 2017-01-01T22:25:04.001544Z

The todomvc project should probably be fixed. I didn't realize it did that.

tony.kay 2017-01-01T22:25:31.001547Z

Yeah, I see it

tony.kay 2017-01-01T22:25:34.001548Z

sorry about that

fragamus 2017-01-01T22:25:47.001549Z

no worries I am just thrilled

tony.kay 2017-01-01T22:25:50.001550Z

That was built early on, mainly by a junior dev

fragamus 2017-01-01T22:26:08.001551Z

I love this stack so much

tony.kay 2017-01-01T22:26:08.001552Z

never have gotten back to it for review. Untangled-template should be in better shape

tony.kay 2017-01-01T22:26:49.001553Z

@fragamus I'm glad these problems have not killed your enthusiasm 🙂

tony.kay 2017-01-01T22:27:22.001554Z

I'll update the master branch on todomvc to keep ppl from having similar problems with it...

tony.kay 2017-01-01T22:37:36.001555Z

@fragamus There is also not a main in todomvc

tony.kay 2017-01-01T22:38:02.001556Z

I guess you added one

tony.kay 2017-01-01T22:44:10.001557Z

so, fixed source paths, I don't have time to add an uberjar to that and test it...but at least it isn't as misleading anymore

fragamus 2017-01-01T22:52:48.001558Z

i made a main for it yeah but I started over today... I'll got find that and add it to my fork

tony.kay 2017-01-01T22:54:15.001559Z

I seem to remember documenting what all the files/folders and such are for somewhere

tony.kay 2017-01-01T22:54:45.001560Z

probably in the doc for the template

tony.kay 2017-01-01T22:55:09.001561Z

yeah...that README.md

tony.kay 2017-01-01T22:55:55.001562Z

hm...in fact, that also include Heroku instructions

tony.kay 2017-01-01T22:56:19.001563Z

https://github.com/untangled-web/untangled-template

tony.kay 2017-01-01T23:01:21.001565Z

also just verified that this is set up properly for Heroku out of the box

sova-soars-the-sora 2017-01-01T23:18:29.001567Z

Hi everyone. Happy New Year! I have a question. In Untangled is there a figwheel for the cljs side, and then a ring server for the "clj serverside" ? I am trying to create the scaffolding for a project that can seamlessly use (dom/render-to-string ..) and it seems like having a back-end server that runs off ring & http-kit with routing (bidi or compojure) and then having a client-side solution (via cljs) seems to be the best way. In this way, though, in production I'd only need the server to run, not a figwheel process to host my cljs as well, right?