Comments (3)
I guess this is because the middleware must be supplied on the nrepl server and lein repl :connect
does not start a server. I tested connecting to a server started with lein repl
with ultra added and the client I connected seems to pretty print just fine.
I looked at this because I'm manually embedding an nREPL server using clojure.tools.nrepl.server/start-server
. You can set a custom handler using the :handler
parameter and that the default handler can optionally apply middleware. So I could start my server like this:
(clojure.tools.nrepl.server/start-server
:port 6789
:handler (clojure.tools.nrepl.server/default-handler custom-middleware-fn))
So, my question is: is there a way for me to grammatically access ultra's nREPL middleware so that I can add it to my embedded server?
I'm not familiar with leiningen plugins, so don't know if I can just include it as a dependency and pull it out of some var or call some function to generate it.
from ultra.
You're right - I knew this at one point in time and then forgot it and subsequently created this issue 😛
Re: middleware: you can, and you actually don't need to use Ultra to do it (though you can if you like). The middleware that needs to be included server-side is the Whidbey middleware, which is what Ultra uses for pretty-printing values. The relevant blocks of code in Ultra can be found here (https://github.com/venantius/ultra/blob/master/src/ultra/repl/whidbey.clj#L7) and here (https://github.com/venantius/ultra/blob/master/src/ultra/repl.clj#L23) (side note, I hadn't looked at those namespaces in a while but there's a rather ugly circular dependency I'm working around that could easily be circumvented and which I should probably create an issue for).
Anyways, the middleware you want is is in clojure.tools.nrepl.middleware.render-values/render-values
, which is a Whidbey ns (it looks like it's from clojure.tools.nrepl, but it's not). Ultra modifies the start-server function to just do a partial in case the user wants to layer additional middleware on top of that.
from ultra.
Thanks!
On Sun, 17 May 2015 02:03 Ursa americanus kermodei [email protected]
wrote:
—
Reply to this email directly or view it on GitHub
#29 (comment).
from ultra.
Related Issues (20)
- compatibility with leiningen 2.9.0 HOT 4
- Ultra assert-expr changes `:actual` value
- Please support Java 11 HOT 1
- Does not work for JDK 12 + Clojure 1.10.0
- Does not work for JDK 12 + Clojure 1.10.0 + lein 2.9.1 HOT 9
- Exception with Puget when running lein repl HOT 4
- Fix `source` to follow provided custom colorscheme
- Ultra causes CIDER to hang indefinitely when running tests with some values HOT 11
- Comparisons between PersistentArrayMap and PersistentHashMap should diff on keys, not types HOT 1
- Whitespace in string diffs is incorrectly eliminated in tests.
- Test reporting can cause test code to run twice HOT 14
- On the main page you suggest to use version 0.5.3 but it does not exist HOT 1
- Is clojure 1.9 supported yet? HOT 5
- Newer ClojureScript versions clashes with rrb-vector which prevents building HOT 4
- If ultra is "finished" can the version reflect it? HOT 1
- Colors not working on Windows HOT 2
- using circleci.test with ultra HOT 5
- Update org.clojure/tools.nrepl 0.2.12 to nrepl 0.5.3? HOT 6
- Declare middleware HOT 5
- Broken on JDK11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultra.