JavaScript for Rails Developers
Make JavaScript your second-favorite language
For decades Ruby on Rails devs have shrugged at JavaScript, cursed at it or vowed to never use it again. But over the years, JavaScript has improved greatly. And if you want to write modern (SaaS) web apps today, there is simply no way around it.
Sure, the Hotwire tools help you tremendously to write as little JavaScript as possible, but if you want something a bit more bespoke, you need to write some JavaScript (preferably using Stimulus) by hand.
This short and focused book will help you, Ruby on Rails developer, become more comfortable writing your own JavaScript and understand the JavaScript written by others. It won't be about React or Vue (or any of the other thousands available JS frameworks), but about writing and understand JavaScript in the Hotwire-way.
If you have been a Rails developer who has cursed at JavaScript, this book might be for you. If you've been a Rails developer avoiding JavaScript at all costs, this book is what you need. For Rails developers who've wished JavaScript would just disappear, this book might change your mind.
Pre-order Today — $25 (50% off)
Table of Contents
This is the tentative table of contents. Let me know if you want to see a specific subject.
-
Introduction
- Why JavaScript Cannot Be Denied
- Overview of JavaScript Evolution
-
Do You Really Need JavaScript?
- When CSS is enough
- Balancing Between Server-Side and Client-Side Logic
-
DOM Manipulation
- Basics of the Document Object Model
- Select and Modify Elements with JavaScript
- Event Handling and Listeners
-
Essentials
- Understanding JavaScript Syntax and Features
- Variables, Functions, and Scope
- ES6+ Features: Let, Const, Arrow Functions, and More
-
Advanced JavaScript
- Asynchronous JavaScript: Callbacks, Promises, and Async/Await
- JavaScript Modules and Imports
- Error Handling and Debugging
-
JavaScript and Stimulus
- What is Stimulus
- Beyond The Basic Examples
- Stimulus Best Practices
- Conclusion
FAQ
When will the book be published?
At this point there is the outline and only a few chapters written. My aim is early 2025. Based on the feedback it will be earlier or later.
Is the book for beginners?
Yes, and no. If you are a Rails veteran but always steered away from JavaScript, this book might just be for you. If you are just starting out with Rails, I would recommend to focus on Ruby (and Rails) first, and then come back to buy this book.
Anything I can read or preview?
Nothing from the book yet, but if you are curious about my writing around JavaScript and front-end code, check out these articles from Rails Designer.
Is there bulk/team pricing?
Want to buy 5, 10 or event more books for, for example, your team? Reach out for a volume discount code.
How will the book be published?
Plan is to distribute digitally for the common formats (HTML, PDF and e-book formats).