Comments (5)
The wrap-reload middleware reloads namespaces. It doesn't require a var, but you do need to be careful of the order of evaluation.
In the example you give, if app
is passed directly to wrap-reload
, then the middleware will retain the old handler. Only when the next request comes in, with the app-with-reload
var pointing to a new value, will the updated handler be used.
This isn't anything specific to wrap-reload
, it's just a natural consequence of the structure of the namespace and how Clojure handles reloads.
I think this would be better placed in a wiki page on namespace reloading, as it's a subject that will take at least several paragraphs to cover. The docstring of wrap-reload
is accurate, so long as you understand how Clojure reloads namespaces.
from ring.
Thanks for taking the time to followup, all of what you say makes sense. A wiki page with more extensive explanation (and accompanying docstring note to it) would be a great help I think.
I agree that the docstring is accurate, my concern is that as a middleware it runs a little contrast to the usual pattern(s) of tying middleware together, which would almost certainly confuse someone using it for the first time without a little heads-up.
from ring.
I also have remark about wrap-reload.
Ring throws NullPointer exception if routes are misspelled for example, which is kind of confusing for new comers.
from ring.
While developer friendliness is definitely an aspect to consider, so is the efficiency and size of the created production artefact (ie the compiled program that will end up in production use).
If the project is going to go down the path of baking documentation and bug-catching helpful pointers into the codebase and its exceptions, it's definitely advisable to make production compilation options not include this cruft that is only useful for developers. Creating such a program is a much more complicated thing to do than, say, just recommending newcomers read the documentation, recommending that they know how to debug their code properly and ensuring that there are adequate FAQ / troubleshooting articles in place. ( @micrub you could possibly spearhead this effort, as you care enough to comment on it ).
from ring.
Ring throws NullPointer exception if routes are misspelled for example
I don't understand what you mean by this, @micrub.
from ring.
Related Issues (20)
- function ring.util.response/file-response doesn't work with opt. :root like "C:\\" in Windows
- `wrap-nested-params` does not parse `query-params` to produce a nested structure. HOT 3
- Callback after response transmission HOT 2
- ring.util.response/resource-response triggers JDK bug and leaks file descriptors HOT 2
- Consider adding data_readers for clj-time or coercing to timestamp HOT 1
- URL path causes exception in resource middleware HOT 3
- Broken link on https://github.com/ring-clojure/ring/wiki/Creating-responses HOT 2
- Prevent compilation-time jetty log initialization HOT 6
- request: How to register wasm mime on clojure ring server? HOT 2
- Ring Jetty Adapter attempts to handle requests that have already been handled HOT 6
- Release new version of ring-jetty-adapter to avoid CVE-2022-2191 HOT 1
- ring-jetty and timeouts HOT 5
- Can ring use the latest version of Jetty - 9.4.49.v20220914 HOT 1
- upgrade of Apache Commons FileUpload to 1.5 HOT 13
- Websocket support HOT 1
- The AES / CBC algorithm used in the cookie session store _might_ be insecure HOT 3
- Attributes in the `Set-Cookie` header are formatted incorrectly HOT 1
- How to measure time that it takes to complete a request? HOT 2
- Documentation for cookies HOT 2
- How to change UriCompliance mode HOT 2
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 ring.