untangled

NEW CHANNEL: #fulcro
fragamus 2016-12-29T00:51:58.001278Z

Now I am having fun with these recipes. I like that I can have embedded css in my render functions. Some might say that it should be separated so that a non-developer could mess with it, but in a full stack development mode this way seems better.

fragamus 2016-12-29T06:37:22.001283Z

Is there a recipe for using datomic

ianchow 2016-12-29T06:53:49.001284Z

thereโ€™s untangled-todomvc. it uses untangledโ€™s own layer on top of datomic. personally i just roll an ad hoc component like so https://github.com/swannodette/om-next-demo/blob/master/todomvc/src/clj/todomvc/datomic.clj

wilkerlucio 2016-12-29T17:38:47.001294Z

hello, I'm trying to compile an untangled app for production, but I'm getting this error:

wilkerlucio 2016-12-29T17:40:52.001296Z

you guys have any idea what this is about?

wilkerlucio 2016-12-29T17:41:27.001297Z

when I try to compile using the lein uberjar I get a different error message:

tony.kay 2016-12-29T17:41:32.001298Z

Hm. Not sure why it is looking for that interface. @adambros made those changes recently to server. If you're not needing the latest server, then I'd drop back on the version. We have not had time to debug :advanced compilation either, so you try :whitespace or :simple optimizations instead.

wilkerlucio 2016-12-29T17:42:06.001300Z

@tony.kay actually this is using simple, I didn't changed the template, so I'm trying to get that first before trying advanced

tony.kay 2016-12-29T17:42:43.001301Z

but it builds in figwheel?

wilkerlucio 2016-12-29T17:42:46.001302Z

yes

tony.kay 2016-12-29T17:42:55.001303Z

latest version of cljsbuild?

wilkerlucio 2016-12-29T17:43:17.001305Z

[lein-cljsbuild "1.1.4"]

tony.kay 2016-12-29T17:43:47.001306Z

try 1.1.5 (clean and rebuild)

tony.kay 2016-12-29T17:43:55.001307Z

this is on untangled-template?

tony.kay 2016-12-29T17:45:22.001308Z

also, did you add deps? If so, have you analyzed and corrected any problems in lein deps :tree?

tony.kay 2016-12-29T17:45:47.001309Z

the default template compiles for me in production mode

wilkerlucio 2016-12-29T17:46:10.001310Z

just tried the update, but no success...

wilkerlucio 2016-12-29T17:46:58.001311Z

it's from the template and I have added a few dependencies, I should being trying to compile from the start, but this is first time I try, so, kind stuck here...

tony.kay 2016-12-29T17:47:29.001312Z

lein deps :tree is your friend, for sure

wilkerlucio 2016-12-29T17:47:35.001313Z

I'm using latest cljs and clojure ([org.clojure/clojure "1.9.0-alpha14"] [org.clojure/clojurescript "1.9.293"]), the bad part is that I'm actually using clojure.spec a lot, I can't try rolling back

wilkerlucio 2016-12-29T17:47:45.001314Z

ok, let me check what the deps tell me

tony.kay 2016-12-29T17:47:53.001315Z

are you using any cljc files?

wilkerlucio 2016-12-29T17:47:57.001316Z

yes

tony.kay 2016-12-29T17:48:09.001317Z

Ah, you might have clj only stuff not annotated that way

tony.kay 2016-12-29T17:48:27.001318Z

not sure why it would work in figwheel, but never know

tony.kay 2016-12-29T17:49:14.001319Z

the untangled/server/core/APIHandler bit should not be showing up

tony.kay 2016-12-29T17:49:24.001320Z

you might have a require that is hitting both sides

wilkerlucio 2016-12-29T17:50:26.001321Z

my cljc files are pretty simple, mostly they used shared stuff, the only occasions it doesn't are for integer coercion and string trimming (which uses google closure on cljs)

tony.kay 2016-12-29T17:50:30.001322Z

com.google.common...same thing

wilkerlucio 2016-12-29T17:50:38.001323Z

I tried to look for unwanted things, but not much there

tony.kay 2016-12-29T17:50:48.001324Z

both of those things are Java/Clojure things, not cljs

tony.kay 2016-12-29T17:51:38.001327Z

maybe you meant goog.string

tony.kay 2016-12-29T17:52:34.001328Z

anyhow, those are my best guesses based on your errors

wilkerlucio 2016-12-29T17:52:37.001329Z

this is the file, I don't think it's about it:

wilkerlucio 2016-12-29T17:52:39.001330Z

(ns remember.input-tags
  (:require [clojure.string :as str]
    #?(:cljs [goog.string :as gstr])))

(defn str-trim [s]
  #?(:clj  (.trim s)
     :cljs (gstr/trim s)))

(def tag-regex #"\[(.+?)]")
(def tag-regex-with-empty #"\[(.*?)]")

(defn process [input]
  (let [input (or input "")]
    {:text (-> input
               (str/replace tag-regex-with-empty "")
               (str-trim))
     :tags (into #{} (map second) (re-seq tag-regex input))}))

wilkerlucio 2016-12-29T17:54:22.001331Z

on the dependencies side, I added friend, which had some problems with ring-core because it was pointing to an old version incompatible with clj 1.9 (`ns` was incorrect)

wilkerlucio 2016-12-29T17:54:58.001332Z

just the error message is weird, why it's failing on Java stuff during cljs compilation?

tony.kay 2016-12-29T17:55:15.001333Z

agreed it is weird

tony.kay 2016-12-29T17:56:29.001334Z

what JVM version?

tony.kay 2016-12-29T17:56:32.001335Z

JDK, that is

tony.kay 2016-12-29T17:57:09.001336Z

Is your IDE perhaps using one, and the command-line another?

tony.kay 2016-12-29T17:57:20.001337Z

maybe you're hitting an old version of the JVM at the command line?

wilkerlucio 2016-12-29T17:59:06.001338Z

Wilkers-MacBook-Pro:datomic-pro-0.9.5530 wilkerlucio$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

wilkerlucio 2016-12-29T17:59:29.001339Z

ok, I tried changing the compilation from :simple to :none and now it worked

wilkerlucio 2016-12-29T18:00:03.001340Z

@tony.kay now let's see how the uberjar goes ๐Ÿ™‚

wilkerlucio 2016-12-29T18:05:47.001341Z

so, seems to be working with none, thanks for the help Tony

tony.kay 2016-12-29T18:47:21.001342Z

weird

tony.kay 2016-12-29T18:47:37.001343Z

but none does not generate a single js file

tony.kay 2016-12-29T18:48:37.001344Z

you at least want :whitespace

fragamus 2016-12-29T19:31:35.001345Z

Are you guys aware that one month ago Datomic Pro became free to use with unlimited clients (no support though)? I am asking because I want to use it, and I'm wondering how hard it would be to fork untangled-todomvc and make it use Datomic Pro.

wilkerlucio 2016-12-29T19:34:03.001346Z

@tony.kay just tried changing to whitespace, and errors got back

tony.kay 2016-12-29T19:34:45.001347Z

@fragamus I was not aware. Should be nothing more than a dependency change, assuming you don't have to apply for a license file

tony.kay 2016-12-29T19:36:02.001348Z

@wilkerlucio Hm. I'd be interested if you find out why. The template works, so it is something you added. I would strongly suspect the cljc stuff since it is complaining about Java stuff

wilkerlucio 2016-12-29T19:36:50.001350Z

@tony.kay I'll find some time to investigate it deeper, try to debug and see if I can pinpoint whats going on, I'll let you know

tony.kay 2016-12-29T19:37:43.001351Z

thanks

tony.kay 2016-12-29T19:38:32.001352Z

@fragamus Staying with free version we're on. Sounds like you still need a license file to make Starter work

tony.kay 2016-12-29T19:38:50.001353Z

I want people to be able to try out the example code without going through extra hoops

tony.kay 2016-12-29T19:39:14.001354Z

hopefully they'll continue to provide datomic-free. If not, then we'll look at the options

fragamus 2016-12-29T19:40:28.001355Z

Of course, but my aim is to morph untangled-todomvc into an app of my own, and in order to scale, I'll need something like this Datomic Pro.

wilkerlucio 2016-12-29T19:42:27.001356Z

@tony.kay I tried to run the compiled uberjar, and the error from ApiHandler showed up again

wilkerlucio 2016-12-29T19:42:44.001357Z

Wilkers-MacBook-Pro:remember2 wilkerlucio$ PORT=8080 java -Dconfig=config/prod.edn -jar target/remember.jar 
Exception in thread "main" java.lang.NoClassDefFoundError: untangled/server/core/APIHandler (wrong name: untangled/server/core/ApiHandler)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:344)
        at clojure.lang.RT.classForName(RT.java:2183)
        at clojure.lang.RT.classForName(RT.java:2192)
        at untangled.server.core__init.__init0(Unknown Source)
        at untangled.server.core__init.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:344)
        at clojure.lang.RT.classForName(RT.java:2183)
        at clojure.lang.RT.classForName(RT.java:2192)
        at clojure.lang.RT.loadClassForName(RT.java:2211)
        at clojure.lang.RT.load(RT.java:445)
        at clojure.lang.RT.load(RT.java:421)
        at clojure.core$load$fn__7846.invoke(core.clj:6008)
        at clojure.core$load.invokeStatic(core.clj:6007)
        at clojure.core$load.doInvoke(core.clj:5991)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.core$load_one.invokeStatic(core.clj:5812)
        at clojure.core$load_one.invoke(core.clj:5807)
        at clojure.core$load_lib$fn__7791.invoke(core.clj:5852)
        at clojure.core$load_lib.invokeStatic(core.clj:5851)
        at clojure.core$load_lib.doInvoke(core.clj:5832)
        at clojure.lang.RestFn.applyTo(RestFn.java:142)
        at clojure.core$apply.invokeStatic(core.clj:659)
        at clojure.core$load_libs.invokeStatic(core.clj:5889)
        at clojure.core$load_libs.doInvoke(core.clj:5873)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invokeStatic(core.clj:659)
        at clojure.core$require.invokeStatic(core.clj:5911)
        at clojure.core$require.doInvoke(core.clj:5911)
        at clojure.lang.RestFn.invoke(RestFn.java:482)
        at remember.core$loading__7732__auto____16713.invoke(core.clj:1)
        at remember.core__init.load(Unknown Source)
        at remember.core__init.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:344)
        at clojure.lang.RT.classForName(RT.java:2183)
        at clojure.lang.RT.classForName(RT.java:2192)
        at clojure.lang.RT.loadClassForName(RT.java:2211)
        at clojure.lang.RT.load(RT.java:445)
        at clojure.lang.RT.load(RT.java:421)
        at clojure.core$load$fn__7846.invoke(core.clj:6008)
        at clojure.core$load.invokeStatic(core.clj:6007)
        at clojure.core$load.doInvoke(core.clj:5991)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.lang.Var.invoke(Var.java:379)
        at clojure.lang.Util.loadWithClass(Util.java:250)
        at remember.core.<clinit>(Unknown Source)

tony.kay 2016-12-29T19:43:02.001358Z

turn on verbose compile option for cljs

wilkerlucio 2016-12-29T19:43:07.001359Z

do you think the fact you have the protocol APIHandler and the class ApiHandler could be a problem?

tony.kay 2016-12-29T19:43:09.001360Z

perhaps you can at least see which file it is hitting

tony.kay 2016-12-29T19:43:21.001361Z

I didn't write APIHandler

tony.kay 2016-12-29T19:43:27.001362Z

and have not reviewed it

wilkerlucio 2016-12-29T19:44:30.001365Z

I just have a hunch that the names might be clashing

wilkerlucio 2016-12-29T19:44:45.001366Z

the compiled output only has core$api_handler.class

tony.kay 2016-12-29T19:44:57.001367Z

where would the clash be coming from?

tony.kay 2016-12-29T19:45:07.001368Z

where is the class?

tony.kay 2016-12-29T19:45:13.001369Z

I see the protocol

wilkerlucio 2016-12-29T19:45:24.001370Z

there is a protocol named APIHandler and a defrecord named ApiHandler (line 181)

wilkerlucio 2016-12-29T19:45:38.001371Z

the difference on name is only on the letter case

tony.kay 2016-12-29T19:45:57.001373Z

Ah, I was looking at develop (where it is changed)

tony.kay 2016-12-29T19:46:03.001374Z

stand by

tony.kay 2016-12-29T19:46:37.001375Z

just pushed 0.7.0-SNAPSHOT to clojars. Try that

wilkerlucio 2016-12-29T19:46:45.001376Z

ok, thanks

tony.kay 2016-12-29T19:47:03.001377Z

of server, but I assume you knew that

wilkerlucio 2016-12-29T19:47:09.001378Z

can you remind me how I force the snapshot update?

tony.kay 2016-12-29T19:47:27.001379Z

lein deps -U I think?

tony.kay 2016-12-29T19:48:11.001380Z

oh, just lein -U any-task

tony.kay 2016-12-29T19:48:22.001381Z

is the new way

wilkerlucio 2016-12-29T19:51:59.001382Z

@tony.kay jar running! ๐Ÿ™‚

tony.kay 2016-12-29T19:52:28.001383Z

sweet. So, the current master is busted, but develop is not. I should cut a release probably

tony.kay 2016-12-29T19:53:16.001384Z

actually, the current master was an internal release only, so you were already using 0.7.0-SNAPSHOT I take it

tony.kay 2016-12-29T19:53:27.001385Z

and it was busted. So, guess we're ok

tony.kay 2016-12-29T19:53:57.001386Z

your optimizations should work now on cljsbuild as well

wilkerlucio 2016-12-29T19:57:40.001388Z

no, compilation with optimizations still failing, but I'm starting to suspect that the problem might be about my user.clj, I see some logs messages indicating it's being loaded, and I don't expected it too (because it loads some code to easy querying my system, but I don't expected it to be running during cljs compilations)

wilkerlucio 2016-12-29T20:36:07.001391Z

@tony.kay hey, I found more weirdness here, hehehe, if I just remove datomic dependency the compilation with :whitespace starts working again

wilkerlucio 2016-12-29T20:36:45.001392Z

I tried switching datomic versions, but any of then are failing (free or pro)

wilkerlucio 2016-12-29T20:56:33.001393Z

seems that the guava dependency is incompatible between datomic and cljs 1.9.293

wilkerlucio 2016-12-29T21:03:18.001394Z

@tony.kay all compilations working again! solution: add :exclusions [com.google.guava/guava] to datomic dependency

wilkerlucio 2016-12-29T21:08:37.001395Z

even :advanced!! ๐Ÿ˜„

wilkerlucio 2016-12-29T21:09:08.001397Z

so happy that advanced worked with no extra change ๐Ÿ˜„

2016-12-29T21:39:50.001398Z

This is timely info - I've been updating libraries today - cljs was going to be my last one - might be a problem from the sounds of it. Glad you found the source of the error @wilkerlucio ๐Ÿ˜„

wilkerlucio 2016-12-29T21:41:15.001399Z

cool, hopefully it will be easier for you, please let us know if you bump in some problem ๐Ÿ˜‰

tony.kay 2016-12-29T21:46:03.001400Z

@wilkerlucio Yes, I did suspect that kind of dep conflict. That has very frequently been the source of problems for me.

tony.kay 2016-12-29T21:46:50.001401Z

just for my own edification: were you getting warnings from lein deps :tree around that?

wilkerlucio 2016-12-29T21:47:36.001402Z

kind of, it pointed that, but in the wrong direction

wilkerlucio 2016-12-29T21:47:47.001403Z

it asked to exclude it on the clojurescript side

wilkerlucio 2016-12-29T21:48:00.001404Z

but that didn't worked, excluding on datomic did

wilkerlucio 2016-12-29T21:48:26.001405Z

I'm thinking that an alternative would be to move datomic dependency into a different profile, and exclude that profile while compiling cljs

wilkerlucio 2016-12-29T21:48:48.001406Z

because I'm afraid excluding it from datomic might cause some problem in some situation

tony.kay 2016-12-29T21:49:40.001407Z

so, the recommendataions are typically crap...it's the fact that it makes one that is helpful

tony.kay 2016-12-29T21:50:20.001408Z

The exclusions route is so-so, as it just causes some other inherited dep to take precedence. If you nail the top-level to a version it is more explicit.

tony.kay 2016-12-29T21:50:33.001409Z

but then you're saying you depend directly on the resource

tony.kay 2016-12-29T21:51:31.001410Z

so, hard balance to strike. I have often chosen the route of declaring an explicit dependency rather than an exclusion, since the exclusions end up needing to be peppered about like the swedish chef got hold of your project file.

wilkerlucio 2016-12-29T22:51:02.001414Z

had you people deployed datomic to heroku? I'm trying to follow this tutorial: https://elements.heroku.com/buildpacks/opengrail/heroku-buildpack-datomic

wilkerlucio 2016-12-29T22:51:20.001416Z

I'm just not sure what my datomic connection url should look like

wilkerlucio 2016-12-29T22:51:26.001417Z

should I point to localhost?

tony.kay 2016-12-29T22:51:53.001418Z

not us

2016-12-29T23:01:21.001419Z

Since this is a buildpack for a transactor, I'm guessing the idea is to point another Heroku app's datomic client to whatever your heroku appname is - something like datomic:<dev://freezing-rain.herokuapp.com:80/test>?

2016-12-29T23:01:53.001420Z

But we've always had Datomic in AWS and it's been a while since we moved off Heroku.

wilkerlucio 2016-12-29T23:10:26.001421Z

humm, thanks @therabidbanana, I was trying to use both on the same app, I'll try to make a different one, thanks

fragamus 2016-12-29T23:53:07.001422Z

how hard is it to deploy untangled-todomvc on heroku? I am going through the arduous process of morphing their starter app into untangled-todomvc. I tried to deploy untangled-todomvc but it lacked that certain something with which I am unfamiliar.