Open the-moisrex opened 2 years ago
We need to finish caching system (#91) before we can start implementing a good view system.
lru_cache
with memory_gate
seems a good choice for caching parsed data.
Either way, the lru_cache
requires a bit of configuration, so we're not gonna let the user configure this by default but we do want them to be able to.
Where should the data conversion happen?
Inside the view means code duplication
view_manager
be used?In the context, it wouldn't be able to cache the parsed files unless with a few tricks that I don't like. Context is router specific thing. The user may want to use another type of router.
In the server/protocol, it can be stored for a long running process. But it's not that straight forward to pass it to the application. There are multiple ways we can achieve this but it'll complicate the things that the user needs to do in order to use it.
In the application, everything seems okay, but the problem is that the user has to manage its life time and that'll complicate things for the user.
The request needs to stay a request, it doesn't make sense for a request to contain a view.
Calling application with a context will probably save the whole issue; at this point, I'm not sure why I designed the routing system this way; I should check this more...
Adding initial
ctx.view("file.mustache")
support.View Manager Features:
.render()
method.dp.cpp
file (a c++20 module?)Possible Views: