Optimizing Opal output for size

I wrote an article on the Opal blog. It touches some parts on how Opal transforms Ruby to JavaScript, if anyone would be interested :D. We touch low-level interfaces quite a lot, so it may not be very obvious to people new to this approach, but may serve as a some introduction to Opal:

https://opalrb.com/blog/2021/11/24/optimizing-opal-output-for-size/

This project looks interesting.
Can I understand it generates JS on server end by dynamic?
Does it have any requirement to web server software?

Thanks.

···

On 2021/11/25 8:32 下午, hmdne wrote:

I wrote an article on the Opal blog. It touches some parts on how Opal transforms Ruby to JavaScript, if anyone would be interested :D. We touch low-level interfaces quite a lot, so it may not be very obvious to people new to this approach, but may serve as a some introduction to Opal:

Optimizing Opal output for size

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<ruby-talk list: member options login page>

Well - it can generate JS on server, but also on client (because it's able to compile itself).

In general it's not tied to anything. Can be used as a CLI tool, integrated with Sprockets or Rails. Or even directly with Tilt or Rack. Or you can also generate JavaScript using a rake task.

It's compatible with a browser, which is the primary target, but is also compatible with NodeJS, GJS, QuickJS, to name a few. You can use `opal-repl` CLI tool (by default on NodeJS) which is similar to `irb` but runs on Opal instead of MRI.

I made a zoo of integrations here: opal-browser/examples/integrations at master · opal/opal-browser · GitHub (I write a production app usingdynamic-roda-roda-sprockets <opal-browser/examples/integrations/dynamic-roda-roda-sprockets at master · opal/opal-browser · GitHub>)

For Rails there is GitHub - opal/opal-rails: Bringing Ruby to Rails · Rails bindings for Opal

There is a big integration with Rails & React available: https://hyperstack.org/

In general our aim is to allow you to write a complex website with not a single line of JS.

···

On 11/27/21 00:56, Henrik Y wrote:

This project looks interesting.
Can I understand it generates JS on server end by dynamic?
Does it have any requirement to web server software?

Thanks.

On 2021/11/25 8:32 下午, hmdne wrote:

I wrote an article on the Opal blog. It touches some parts on how Opal transforms Ruby to JavaScript, if anyone would be interested :D. We touch low-level interfaces quite a lot, so it may not be very obvious to people new to this approach, but may serve as a some introduction to Opal:

Optimizing Opal output for size

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<ruby-talk list: member options login page>

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<ruby-talk list: member options login page>