Giter VIP home page Giter VIP logo

Comments (5)

weavejester avatar weavejester commented on July 3, 2024 1

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.

trevor avatar trevor commented on July 3, 2024

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.

micrub avatar micrub commented on July 3, 2024

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.

GetContented avatar GetContented commented on July 3, 2024

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.

weavejester avatar weavejester commented on July 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.