Comments (5)
I don't see a problem with the concept of a default render for producing pages, but I think multiple template renderers will be pretty common. I'd like to see some conventions for renderer APIs so that users will have a consistent way of working with them.
We also need to think about who is responsible for security-related features such as codecs, form tokens, etc. To be honest, it may be possible to incorporate HDIV as a module without too much effort. But if that's a separate module, how would it interact with other template renders provided by different modules?
Sorry, I'm raising more questions than providing answers, but I think it's important to get the questions down first.
from ratpack.
I don't see a problem with the concept of a default render for producing pages, but I think multiple template renderers will be pretty common. I'd like to see some conventions for renderer APIs so that users will have a consistent way of working with them.
It's not clear exactly what kind of value having a global renderer really has. Ratpack core can certainly ship an agnostic interface that implementors can use if they choose, but the question is how deeply the concept of "a renderer" should be in the framework. I'm starting to favour not having this assumption in there at all.
For the Groovy module, I think it does make sense to have default support for the Groovy template renderer, so that will stay there. Above, I'm only saying it should be cut out of the core.
We also need to think about who is responsible for security-related features such as codecs, form tokens, etc. To be honest, it may be possible to incorporate HDIV as a module without too much effort. But if that's a separate module, how would it interact with other template renders provided by different modules?
This is not something I know much about so can't give specifics. The one thing I can say though is that there will almost certainly be nothing for this in the core. We can certainly ship modules that users can opt in to, but they won't be in by default.
I'll need to defer to someone else's expertise on this for how ensuring that things are secure is handled.
The core idea here though is that Ratpack (core) is not doing very much for you – it's raw, so it's up to you to do the right thing. On top of that, we can ship some opt in modules that you compose a solution out of yourself.
Sorry, I'm raising more questions than providing answers, but I think it's important to get the questions down first.
All questions are welcome.
from ratpack.
So does not having a global renderer mean that the render()
method disappears from core? If it does go, how would template rendering be done? To be honest, I've already forgotten how you 'render' a straight HTML file.
from ratpack.
So does not having a global renderer mean that the render() method disappears from core?
Yes. You'd inject your renderer as a dependency…
@Inject
class MyEndpoint implements Endpoint {
MyFancyRenderer renderer
void respond(Request request, Response response) {
// …
renderer.render("templateName", model, response)
}
}
That is, there's nothing special about rendering. It's just another thing that an endpoint might do.
from ratpack.
No longer valid as there's no real rendering framework.
from ratpack.
Related Issues (20)
- Recurring scheduled job HOT 2
- Add support for HTTP Proxy Authentication HOT 2
- Runtime issues while running ratpack on jdk17 and guice-5.1.10 with certificates based request HOT 2
- The latest stable/GA version (1.9.0) depends on a very old version of Spring Boot
- The latest 2.x version (2.0.0-rc-1) depends on an older version of Spring Boot
- 1.x docs are not discoverable on the docs site HOT 2
- Add more Gradle/Maven dependency examples to the docs
- ratpack-spring-boot-starter transitively depends on ratpack-guice
- Update docs for JacksonConverterFactory usage
- Section numbering seems backwards in the docs
- Static content is not always available with the Spring Boot plugin
- Incompatibility with slf4j 2.0.x HOT 1
- Consider publishing a version catalog
- Regex literal path segments using groups syntax match to multiple path tokens
- Micrometer Observation Support
- serving static files documentation is incorrect: version 1.9+
- Set pool acquire timeout to HttpClient for connection pooling
- How to do UploadFile HOT 1
- can I serve multiple static folders by path
- When ExecController.of is used where 'x' num of blocking threads are configured, ratpack compute threads are not waiting for completion of ratpack blocking threads before completing the request and sending response
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 ratpack.