{"action":"created","issue":{"url":"https://api.github.com/repos/jadejs/jade-code-gen/issues/21","labels_url":"https://api.github.com/repos/jadejs/jade-code-gen/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/jadejs/jade-code-gen/issues/21/comments","events_url":"https://api.github.com/repos/jadejs/jade-code-gen/issues/21/events","html_url":"https://github.com/jadejs/jade-code-gen/issues/21","id":115474192,"number":21,"title":"Rewrite using babel","user":{"login":"ForbesLindesay","id":1260646,"avatar_url":"https://avatars.githubusercontent.com/u/1260646?v=3","gravatar_id":"","url":"https://api.github.com/users/ForbesLindesay","html_url":"https://github.com/ForbesLindesay","followers_url":"https://api.github.com/users/ForbesLindesay/followers","following_url":"https://api.github.com/users/ForbesLindesay/following{/other_user}","gists_url":"https://api.github.com/users/ForbesLindesay/gists{/gist_id}","starred_url":"https://api.github.com/users/ForbesLindesay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ForbesLindesay/subscriptions","organizations_url":"https://api.github.com/users/ForbesLindesay/orgs","repos_url":"https://api.github.com/users/ForbesLindesay/repos","events_url":"https://api.github.com/users/ForbesLindesay/events{/privacy}","received_events_url":"https://api.github.com/users/ForbesLindesay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-06T10:01:43Z","updated_at":"2015-11-06T11:56:27Z","closed_at":null,"body":"babel does a really good job of generating source maps.  Generating ASTs will also help us only generate proper, syntactically valid javascript.  As a bonus we can rapidly run any babel plugins we want on the output for optimisation or implementation of advanced features.\r\n\r\nOne of the restrictions this will impose is that unbuffered code blocks (e.g. `- var x = 10;`) will now need to be valid statements.  This forces people to use our built in constructs for `if`, `else`, `each` etc. I don't think that's a bad thing though, and we can make up for it with much better error messages for syntax errors.\r\n\r\nI think this is too big a feature to block the 2.0.0 release, which I really want to roll out this weekend.  I do think we should hold off on plugins for code-gen until this is complete though."},"comment":{"url":"https://api.github.com/repos/jadejs/jade-code-gen/issues/comments/154392730","html_url":"https://github.com/jadejs/jade-code-gen/issues/21#issuecomment-154392730","issue_url":"https://api.github.com/repos/jadejs/jade-code-gen/issues/21","id":154392730,"user":{"login":"ForbesLindesay","id":1260646,"avatar_url":"https://avatars.githubusercontent.com/u/1260646?v=3","gravatar_id":"","url":"https://api.github.com/users/ForbesLindesay","html_url":"https://github.com/ForbesLindesay","followers_url":"https://api.github.com/users/ForbesLindesay/followers","following_url":"https://api.github.com/users/ForbesLindesay/following{/other_user}","gists_url":"https://api.github.com/users/ForbesLindesay/gists{/gist_id}","starred_url":"https://api.github.com/users/ForbesLindesay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ForbesLindesay/subscriptions","organizations_url":"https://api.github.com/users/ForbesLindesay/orgs","repos_url":"https://api.github.com/users/ForbesLindesay/repos","events_url":"https://api.github.com/users/ForbesLindesay/events{/privacy}","received_events_url":"https://api.github.com/users/ForbesLindesay/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T11:56:27Z","updated_at":"2015-11-06T11:56:27Z","body":"I suppose all you would need from a plugin API is the ability to override `buffer`, `bufferExpression`, `visitMixin` and `visitMixinBlock` (you no longer need `visitEach` because we no longer generate an immediately invoked function for each blocks).  We could create a simple plugin system that let you do that, but I think it would end up being brittle and would need to be replaced when we moved to babel anyway.  A better plan (I think) would be to continue with your current inheritance model, which is actually pretty simple and effective."}}