Hey folks 👋,
It's been a while!
After some time away from writing, I'm back with a post on ViewComponent. Created by Github, ViewComponent is an open-source framework to create reusable, testable, and encapsulated view components in Rails. In this post, I explain why this framework was created, and the issues with the rails-way of building frontends. As a guide to how the framework works, the post also shows how Rails views can be abstracted to ViewComponents.
A bit of context to this post: I tend to work more on the backend side of things. At work, frontend usually means a React or Angular application on top of a Rails API. This is probably the case with most Rails developers nowadays. The complexity of these frameworks most often implies a complete separation between backend and frontend roles.
However, lately I have been curious about some of the new frontend tools that are promising to make building frontends with Rails simple and scalable - like Stimulus, Tailwindcss (not only for Rails), ViewComponents, and others. I will be exploring some of these tools and writing about them in future posts.
On another note, I have been thinking about creating a course or micro-courses on querying with ActiveRecord. I will probably send a free beta version to some of my newsletter subscribers for feedback. If that is something that would interest you, let me know by replying to this email.
Thank you for reading,
Ana