{"action":"created","issue":{"url":"https://api.github.com/repos/ractivejs/ractive/issues/2145","labels_url":"https://api.github.com/repos/ractivejs/ractive/issues/2145/labels{/name}","comments_url":"https://api.github.com/repos/ractivejs/ractive/issues/2145/comments","events_url":"https://api.github.com/repos/ractivejs/ractive/issues/2145/events","html_url":"https://github.com/ractivejs/ractive/issues/2145","id":106233978,"number":2145,"title":"Is there a comparison guide between Ractive / Handlebars / Mustache?","user":{"login":"matthew-dean","id":414752,"avatar_url":"https://avatars.githubusercontent.com/u/414752?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew-dean","html_url":"https://github.com/matthew-dean","followers_url":"https://api.github.com/users/matthew-dean/followers","following_url":"https://api.github.com/users/matthew-dean/following{/other_user}","gists_url":"https://api.github.com/users/matthew-dean/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-dean/subscriptions","organizations_url":"https://api.github.com/users/matthew-dean/orgs","repos_url":"https://api.github.com/users/matthew-dean/repos","events_url":"https://api.github.com/users/matthew-dean/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-dean/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ractivejs/ractive/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-13T19:00:32Z","updated_at":"2015-09-13T22:13:50Z","closed_at":null,"body":"Here's my issue: I want to use Ractive.js on the front-end because it's awesome. That's not an issue, the next part is the issue. The backend is PHP. In some cases, I'd like to share templates between Ractive and PHP; e.g. displaying an invoice to the user in the browser and also emailing that same invoice, bound to data, via PHP.\r\n\r\nI know Ractive doesn't have a PHP port. However, the documentation states it shares many features from Mustache and Handlebars. My question is: which ones? What is a \"safe\" template that can be used by, say, both Handlebars.php and Ractive? It would be great to see a table that lists overlapping keywords or features between Ractive and other mustache-y libraries.\r\n\r\n(A follow-up question might be: if Ractive supports many features that Handlebars supports, why does it omit certain ones? Why not be mostly a \"superset\" of Handlebars so that people can easily port to Ractive? It would be like Handlebars with better Virtual DOM, similar to the relationship between Underscore and Lodash, the latter being a more performant variant of the former with 99% feature overlap.)"},"comment":{"url":"https://api.github.com/repos/ractivejs/ractive/issues/comments/139923100","html_url":"https://github.com/ractivejs/ractive/issues/2145#issuecomment-139923100","issue_url":"https://api.github.com/repos/ractivejs/ractive/issues/2145","id":139923100,"user":{"login":"MartinKolarik","id":6192491,"avatar_url":"https://avatars.githubusercontent.com/u/6192491?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinKolarik","html_url":"https://github.com/MartinKolarik","followers_url":"https://api.github.com/users/MartinKolarik/followers","following_url":"https://api.github.com/users/MartinKolarik/following{/other_user}","gists_url":"https://api.github.com/users/MartinKolarik/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinKolarik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinKolarik/subscriptions","organizations_url":"https://api.github.com/users/MartinKolarik/orgs","repos_url":"https://api.github.com/users/MartinKolarik/repos","events_url":"https://api.github.com/users/MartinKolarik/events{/privacy}","received_events_url":"https://api.github.com/users/MartinKolarik/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T22:13:50Z","updated_at":"2015-09-13T22:13:50Z","body":"Ractive is backward compatible with mustache, with two exceptions:\r\n - no lambdas - see [this comment](https://github.com/ractivejs/ractive/issues/142#issuecomment-22948119) for an explanation,\r\n - variables/sections can only be inside text nodes/attributes, e.g., something like `<{{tagName}}>` is not valid. This is a limitation of using virtual DOM instead of returning an HTML string.\r\n\r\nAs for Handlebars, we support explicit `{{#with}}`, `{{#each}}`, `{{#if}}`, `{{else}}` (no `else if` though), and `{{#unless}}` sections, as well as special references `@index` and `@key` inside `{{#each}}`.\r\n\r\nAs @Madgvox pointed out, Ractive has many features Mustache doesn't, so while porting a template from Mustache to Ractive should be fairly easy, it isn't possible vice-versa (without serious limitations)."}}