Giter VIP home page Giter VIP logo

Comments (5)

pledbrook avatar pledbrook commented on June 27, 2024

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.

ldaley avatar ldaley commented on June 27, 2024

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.

pledbrook avatar pledbrook commented on June 27, 2024

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.

ldaley avatar ldaley commented on June 27, 2024

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.

ldaley avatar ldaley commented on June 27, 2024

No longer valid as there's no real rendering framework.

from ratpack.

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.