RedwoodJS
I went to a Meetup recently in my area where Ryan Hamblin presented on a relatively new Javascript framework, RedwoodJS. It was a solid presentation, and I came away really wanting to learn more about RedwoodJS. So I did, and thought I would share my experience with others.
Redwood is an opinionated full-stack Javascript framework, taking a lot of cues from Ruby on Rails, to improve and automate many of the annoying things about full-stack development and even automating and improving some things about developing with React.
Why Redwood?
I'm sure the answer to that question will depend greatly on what kind of development you do, and for whom. As for me, I'm a freelancer, so I generally work alone, and I'm always looking for ways to speed up and simplify the development process.
I'm also relatively new to web development, and there are so many things that developers need to be able to do these days, and I'm always looking for ways to simplify and streamline my development workflow so that I can build awesome things without spending too much time doing the most basic setup things.
This is why Redwood stood out to me. RedwoodJS takes a lot of the things that are repetitive and tedious in the development process (things like forms, validation, basic database actions) and either automates them or simplifies them to the point where the basics are simple and you can move on to more exciting things more quickly.
React, simplified
Luckily the team at Redwood has some pretty good documentation on their site so far. I went through one of their tutorials this week, and found their documentation easy to follow and detailed.
During the tutorial I noticed that they simplified some pretty annoying things about React development, giving it more of a Ruby on Rails feel while keeping it in the JS family.
For instance, you don't need to write
import React from 'react'
at the top of all of your components, Redwood does it for you. You'll need to import other things, but that annoying step is taken care of for you.
Instead of manually creating pages, they have set up standard terminal commands that automatically create basic pages, components, and layouts with some boiler-plate items in there and a testing file to go along with each component you create. Who knows, maybe I'll actually learn more about testing as a result.
Redwood Scaffolding
Those are small things in the grand scheme, but they can make a difference. It's a nice thing to not have to import React and it's nice that they have automated component setup processes, but those things wouldn't necessarily get anyone excited enough to jump into a new framework all of their own. What really impressed me was their scaffolding features.
I remember going through my coding bootcamp and feeling like I spent 80% of my time setting up CRUD (Create, Read, Update, Delete) actions to update a database. I used Ruby on Rails and React in school, and while Rails does a good job of supplying the infrastructure for managing those functions, I still had to set them up for every table I created. Maybe there was a way to automate those things with Rails, but since graduating I have been using Rails as much.
I kept thinking throughout my time that, surely, some developer out there automated the process of setting up CRUD actions. They're very often set up the same way every time.
Well, the good team at Redwood thought so too. So they created scaffolding that not only sets up the database CRUD actions for you with a single terminal command, but also sets up basic views so that you can test CRUD actions directly in the browser without having to build any forms, buttons, or any other functions. With just one command
yarn redwood generate scaffold post
// or
yarn rw g scaffold post
you've got yourself CRUD actions and views set up for that database table. Done! Then you can focus on styling, or integrating those components into the rest of your app.
Other Cool Stuff
Scaffolding was a big part of what made me dive into RedwoodJS as opposed to looking at the many other things that are trending right now (serverless and Deno anyone?), I didn't want to have to learn a bunch of new stuff right now, so this keeps me in my React comfort zone, while simplifying full-stack development a lot.
But there was more!
Schema
Schema setup was easy. Redwood comes with GraphQL packaged in, so defining the schema with GraphQL formatting was simple enough with their tutorials, and then their database terminal commands handled creating migration files and updating the database structure using the schema file.
Named Routes
Managing routes in React isn't a hugely complex process (I thought), but Redwood solved a problem that I hadn't come up against before; they use named routes, so that when you reference your routes throughout your application you use the name of the route, not the URL, so you can change the URL whenever you want without having to change any of your other files.
While I haven't changed my route URLs often, I can see this making a huge difference down the road.
Form Validation
Form validation is one of those things I've been avoiding doing, and learning about. I hear many people complain about forms, and while building the HTML/CSS for forms is kind of fun for me, dealing with validation rules and security is a rabbit hole that I haven't had time to jump into yet.
So once again the Redwood team came to help out.
While they didn't automate form validations completely, they did add some nice features to help with this process.
I'm still unpacking some of the info that they had in their docs, but following along was simple, and validation was a lot less stressful knowing that there was an opinionated way to handle the basics built into the system.
Conclusion
My first impressions of RedwoodJS have been really positive. Their documentation is good. It's a new framework, so the documentation isn't as complete as I wanted, but I reached out to the team on Twitter and they were extremely helpful in filling in the gaps where the documentation was lacking.
They say that it's the future of full-stack development; bringing a traditional full-stack development workflow and making it more JAMstack, automating and simplifying a lot of processes, and keeping it real on Twitter.
I'm excited to see where this goes as the team continues to build things out and refine their framework and their documentation.
I for one see myself adding RedwoodJS to my arsenal of tools that I use for developing full-stack apps. It keeps me in React, where I'm most comfortable, and makes development much less intimidating when you're working on your own.
Top comments (0)