We actually work with the Symfony 2 PHP framework and Twig as a template engine. We think that we could avoid code duplication for the View layer and benefit from progressive enhancement (p-jax).

Current status:

PJAX doesn't handle partial updates of the page layout based on route. Our goal is to implement a system where only some page "fragments" (HTML nodes) would be updated when navigation is handled by Y.App (routing).

In this regard we started to implement a POC at: https://github.com/benjamindulau/PocSfYui/ Javascript can be found here: https://github.com/benjamindulau/PocSfYui/tree/master/src/Acme/PocBundle/Resources/public/js And Y.App initial configuration there: https://github.com/benjamindulau/PocSfYui/blob/master/src/Acme/PocBundle/Resources/views/layout.html.twig#L66

The idea is that when we first load the page, everything is handled server-side (progressive enhancement), meaning that the whole page and page fragments are rendered by the server. For the next requests, which should be performed by Y.App, we defined a JSON format like the following (/photos path response):

{
    "title": "MyAwesomeWebsite - Photos", // page <title>,
    "fragments": {
        "sidebar": "<h2>Sidebar Menu<\/h2><!-- etc.... -->", // ..... maybe an updated menu for active page
        "main": "<h2>Photos<\/h2><div id=\"photo-list-container\"><ul id=\"photo-list\"><!-- photo items.... --></ul></div>", // Pre-rendered photo list
    },
    "templates": {
        "photo_item_tpl": "<li data-id=\"{{index}}\"><img src=\"{{url}}\" alt=\"{{title}}\" \/><\/li>" // te
Edit
Report