On Tue, Apr 28, 2020 at 11:26 AM Sam Ruby <ru...@intertwingly.net> wrote:
>
> Porting the CGIs would be very quick.
> https://github.com/rubys/ruby2js would do most of the work.

An example to illustrate.

Go to https://whimsy.apache.org/ruby2js/functions/react/wunderbar

Copy/paste the following there:

list = ['apples', 'oranges', 'pears']

_html do
  _h2 "Grocery list"
  _ui do
    list.each do |item|
      _li item
    end
  end
end

You will see the Ruby logic converted to JavaScript, and the Wunderbar
bits converted to JSX.

Bonus: change ES level to 2020 and click Convert to see what you can
do with more modern JavaScript syntax

- Sam Ruby

Reply via email to