portal

https://github.com/djblue/portal
practicalli-john 2020-12-11T14:52:56.059400Z

Does Portal work with Leiningen configured projects? I tried to include portal as a dev dependency in the project.clj configuration, but portal generated errors. If its not designed to work with Leinigen, that's okay. Just wondered if there was a way to make it work.

djblue 2020-12-11T15:55:12.059500Z

You should be able to use lein. https://github.com/djblue/portal/blob/master/examples/jvm/project.clj is the example I use for testing.

practicalli-john 2020-12-11T17:09:39.059800Z

Ah, if ring is required for the JVM approach to running portal then that's why it's not working... Ooops

practicalli-john 2020-12-11T17:11:10.060Z

Now I just need to find some examples of data that show off portal... Should have something in my many projects... Thanks

practicalli-john 2020-12-11T17:38:20.060300Z

I am still getting the same error when evaluating (require '[portal.api :as portal]), even with the simplest leiningen project

Syntax error compiling at (portal/runtime/jvm/launcher.clj:48:38).
No such var: http/server-port
It works fine with deps.edn and Clojure CLI tools, just doesnt like running under Leiningen I'll take a look at the line in the code the error is reporting...

practicalli-john 2020-12-11T17:39:48.060500Z

I'm running this with Leiningen 2.9.1 on Java 11.0.9.1 OpenJDK 64-Bit Server VM

practicalli-john 2020-12-11T17:39:54.060700Z

So nothing fancy...

practicalli-john 2020-12-11T17:49:48.060900Z

Hmm, I cloned the portal repository on GitHub and ran the jvm example without any problems... very strange. So something just not right with my project.... I'll do a diff

practicalli-john 2020-12-11T18:24:25.061100Z

I seem to be finding some interesting edge cases. I can run the jvm example from the command line, using lein repl however running from Calva jack-in it is not finding tap> Adding the org.clojure/clojure dependency explicitly makes running the portal jvm example work from Calva.

practicalli-john 2020-12-11T18:39:54.061300Z

How bizzare. I get a conflict with the scicloj/notespace library when running a Clojure project with Leiningen. However, Portal works just fine with the same project. Everyone seems happy using Clojure CLI tools, so I'll leave it there.

djblue 2020-12-11T19:37:01.061500Z

So you don't need ring to use portal for jvm, it was more just an example app. Portal brings http-kit for the http server which is interesting that you got http/server-port not found, because that's me using http-kit :thinking_face:

djblue 2020-12-11T19:37:43.061700Z

It sounds like you might have a conflicting dependency on http-kit, perhaps lein resolves an older version of http-kit on the classpath.

djblue 2020-12-11T19:39:05.061900Z

I think for the missing tap> , maybe portal should explicitly depend on clojure 1.10

1👍
djblue 2020-12-11T19:40:14.062200Z

A lot of these issues feel like dependency version problems

practicalli-john 2020-12-11T19:40:28.062400Z

Yes, Leinigen need clojure dependency to be explicit and works

djblue 2020-12-11T19:41:27.062600Z

It does look like when published, the clojure 1.10 dep is present

djblue 2020-12-11T19:41:54.063100Z

super weird

practicalli-john 2020-12-11T19:42:30.063300Z

and yes, some dependency conflict somewhere... but luckily we are happy not to use Leiningne for this project so I'm not going to try resolve it. There are lots of dependencies to trim from the scicloj/notespace library first Oh there is cheshire... depends on a library that often causes these types of issues when there are different versions...

djblue 2020-12-11T19:43:20.063500Z

I regret adding cheshire as a hard dependency 😅

practicalli-john 2020-12-11T19:43:44.063700Z

You are not the only developer to regret this 🙂 I will just get on with enjoying using Portal for the rest of the weekend, thanks

1💯