- From: Sam Ruby <rubys@intertwingly.net>
- Date: Thu, 25 Jun 2015 07:51:51 -0400
- To: public-html@w3.org
On 06/24/2015 07:25 AM, Sam Ruby wrote: > > I'll also try to clean up my code and post it. It currently is written > entirely in Ruby (even the JavaScript is generated). Once it > stabilizes, it can either be left as is, or converted entirely to > node.js. (Before you vote for that option, wait until you see the Ruby > source, it truly is more maintainable than the generated code, even > though I took great pains to make the generated code look as if it were > hand authored). Code posted here: https://github.com/rubys/breakup/tree/gh-pages/search Build instructions: https://github.com/rubys/breakup#building-the-search-function Live on github.io: http://rubys.github.io/breakup/specs/search.html Source for the generated JavaScript: https://github.com/rubys/breakup/blob/gh-pages/search/views/app.js.rb Generated JavaScript: https://github.com/rubys/breakup/blob/gh-pages/specs/app.js Commentary on the generation: 1) The differences in the fetch function are negligible. Basically, everything you can do in JS can be done with Ruby syntax. 2) The differences in the componentDidMount method are marginal. Some of this will be improved in JavaScript once ES6 lands. 3) The differences in the render method are substantial. 4) Ruby2JS can also produce sourceMaps, which means that stack tracebacks and showing code in the browser's WebConsole will be based on the original source. - Sam Ruby > - Sam Ruby > >
Received on Thursday, 25 June 2015 11:52:19 UTC