-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify Partials as Views #64
Comments
Hi all, after thinking a lot about this idea, I'm asking myself if this is really a feature we should specify it in depth. I had a look into a few template engines we support in Krazo and not all can render partials. So these are my insights:
As another point, the common way I know of using partials in server side rendered web applications is to use AJAX for progressive enhancement, which bypasses the whole complexity on server side by extracting relevant parts on the client. And even if there is a functionality to render partials on the server, the applications need to use AJAX to fetch them. The only benefit the users would have is a little performance improvement, which I guess can be easily killed by the server side partial mechanism. Because of this points, I think it makes sense to specify a kind of indicator if an |
Hey @erdlet, thanks a lot for the summary. I agree that there are different approaches for implementing partial page reloads. A simple form is already possible today by simply sending a request to the server via JavaScript, fetching the whole page, extracting the relevant part on the client and perform the DOM update manually. I created a small demo app for this a few years ago, which is available here. The JavaScript part is pretty simple, see here. Of course, it is not very efficient to fetch the whole page just for updating a specific part of the page. To optimize this, we would need support for this approach on the server side. But as @erdlet already described, most of them doesn't support this concept, especially JSP. It MAY be acceptable to let the view engine render the full view and post process the output by using jsoup or some other mechanism. However, this isn't a good idea from a performance perspective, because we need to buffer the response AND the view engine still renders the full page. The only good aspect with this approach is that we sent less data to the client via the network. IF we want to support partial rendering on the server side, I agree that it should be up to the ViewEngine to actually perform the necessary steps. Not sure yet how the API could look like. Any ideas? |
Prosed syntax:
<filename>::<elementId>
Example: Add a row to a table in the view
The text was updated successfully, but these errors were encountered: