The hows of Rails Wasm-ification
Compiling a full-featured Rails application into a Wasm module can be challenging. Why? Because a typical Rails application depends on much more than just a Ruby VM. Just take a quick look:
What do we have on our plate?
- We heavily depend on native extensions, some of which require specific system libraries (hello, Nokogiri!)
- A Rails app is hardly imaginable without a database
- Oh, we need an actual web server to serve HTTP requests!
- ...Not only plain text requests, but file uploads (and don't forget about image transformations)
- What about queues for our background jobs?
- Should mention cables (real-time features) or it's enough?
You may think that solving all these problems doesn't worth the effort. Let's just run Rails on servers. But don't give up too quickly! We have something that could help you get started with Rails on Wasm with as little burden as possible.