Cookie Consent by Free Privacy Policy Generator Aktuallisiere deine Cookie Einstellungen ๐Ÿ“Œ I Built an App with Remix in 30ย Minutes


๐Ÿ“š I Built an App with Remix in 30ย Minutes


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

I love playing with new toys. For development, that translates to trying out new tools and frameworks. Iโ€™m always on the hunt for ways to speed up and streamline my app development workflow. And so, recently, I came across Remix, a JavaScript-based web framework that prioritizes fast page loads and is focused on running at the edge.

Since I already have extensive experience with Node.js and React, I wanted to give Remix a try. I decided to go through the Remix tutorial to see just how quickly I could get through it while still understanding what I was doing. Then, I wanted to see how easy it would be to deploy the final app to the cloud. I used Heroku for that.

So, letโ€™s dive in together. Here we go!

Introducing Remix

This is what Remix says about itself:

Remix is a full stack web framework that lets you focus on the user interface and work back through web standards to deliver a fast, slick, and resilient user experience.

Most important for me, though, is how Remix aims to simplify the developer experience. I really enjoyed reading their take on why Remix isnโ€™t just another framework but isโ€Šโ€”โ€Šin addition to being a robust web dev frameworkโ€Šโ€”โ€Šalso a way to gain transferable knowledge that will serve you even long after youโ€™ve stopped using Remix.

Remix seems to be great for developers who have React experience butโ€Šโ€”โ€Šlike meโ€Šโ€”โ€Šwant something that helps them spin up an app faster, prettier, and easier. I found that Remix works to remove some of that slog, providing conveniences to help streamline the development experience.

The Remix tutorial was very comprehensive, covering lots of different features. And I got through it in less than 30 minutes.

Introducing Heroku

At the end of the day, Remix was going to give me a full-fledged SPA. And thatโ€™s awesome. But I also wanted a way to deploy my application to run the code quickly and simply. Lately, Iโ€™ve been using Heroku more and more for this kind of thing. Itโ€™s fast, and itโ€™s reliable.

Remix tutorial highlights

I encourage you to go through the tutorial yourself. Iโ€™m not going to rehash it all here, but I will provide some highlights of features.

Built on Reactย Router

Remix is built on top of React Router, which is an easy-to-use routing library that integrates seamlessly into your React applications. React Router supports nested routes, so you can render the layout for child routes inside parent layouts. This is one of the things I love. Done this way, routing just makes sense. Itโ€™s easy and intuitive to implement.

Note: In the Contact Route UI section of the tutorial, the code snippet for app/routes/contacts.$contactID.tsx (at line 10) references a URL for an avatar. It turns out that the URL for the avatar wasnโ€™t returning any data. I needed to change it to https://placekitten.com/200/200 (removed the /g in the original path) instead.

Client side routing and fast dataย loading

Remix also features client side routing through React Router. This means clicks that are meant to fetch data and render UI components wonโ€™t need to request and reload the entire document. Navigating between views is snappy, giving you a smooth experience with fast transitions.

On top of this, Remix loads data in parallel with fetch requests, so all of the heavy lifting is happening in the background. The end user doesnโ€™t feel it or notice it. Data just loads into components super fast. Remix does this through its loader API, which lets you define a function in each route that provides data to the route upon render.

Submitting forms without navigation

This is a challenge that Iโ€™ve dealt with on many occasions. Sometimes, you want to submit a form to make some sort of data update on the backend, but you donโ€™t want to trigger a navigation in your browser. The Remix tutorial describes the situation this way: We arenโ€™t creating or deleting a new record, and we donโ€™t want to change pages. We simply want to change the data on the page weโ€™re looking at.

For this, Remix provides the useFetcher hook to work in conjunction with a route action. Forms and data manipulation actions on the pages felt smooth and fast.

Hereโ€™s a quick screen vid of the final result of the tutorial app:

Image description

They said that going through the tutorial would take about 30 minutes, and they were right. And I learned a lot along the way.

Deploying to Heroku was Blazingย Fast

Ahh, but then it came time to deploy. Running the tutorial app on my local machine was great. But how easy would it be to get this appโ€Šโ€”โ€Šor any app I build with Remixโ€Šโ€”โ€Šdeployed to the cloud?

The one thing I needed to add to my GitHub repo with all the completed code was a Procfile, which tells Heroku how to spin up my app. My Procfile is one line, and it looks like this:

web: npm run dev

I logged into Heroku from the CLI.

Next, I needed to create a Heroku app and deploy my code. How long would that take?

Image description

Andโ€ฆ it took 42 seconds. I challenge you to beat my time. ๐Ÿ’ช

Just like that, my Remix app was up and running!

Image description

Production deployment

Remix provides the Remix App Server (@remix-run/serve) to serve up its applications. To deploy your application to production, just make sure youโ€™ve added @remix-run/serve to your project dependencies. Heroku will automatically execute npm run build for you. So, the only other step is to change your Procfile to the following:

web: npm run start

Then, push your updated code to Heroku. Your production deployment will be off and running!

Conclusion

Iโ€™m always looking out for newer, faster, and better ways to accomplish the tasks that I need to tackle regularly. I often find myself trying to spin up simple apps with clean and fast navigation, forms, and data handling. Usually, Iโ€™m building quick prototypes for prospective clients or some helpful mini-app for a friend. For deployment and running my code on the web, I keep going back to my tried-and-true, Heroku. But in stumbling upon Remix, I think Iโ€™ve found my go-to for easy single-page app development in the coming days. I know that by going through the tutorial, Iโ€™ve really only scratched the surface of what Remix has to offer. So Iโ€™m looking forward to playing with it a lot more.

Happy coding!

...



๐Ÿ“Œ I Built an App with Remix in 30ย Minutes


๐Ÿ“ˆ 37.45 Punkte

๐Ÿ“Œ Building a progressive web app in Remix with Remix PWA


๐Ÿ“ˆ 30.5 Punkte

๐Ÿ“Œ Remix IO: Neue Set-Top-Box mit Remix OS und Android TV ist finanziert


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ Remix IO: Neue Set-Top-Box mit Remix OS und Android TV ist finanziert


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ Meet Remix IO+, a More Powerful Remix IO That Doubles as an Android or Gaming PC


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ Remix IO: Neue Set-Top-Box mit Remix OS und Android TV ist finanziert


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ Remix IO: Neue Set-Top-Box mit Remix OS und Android TV ist finanziert


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ Meet Remix IO+, a More Powerful Remix IO That Doubles as an Android or Gaming PC


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ Android auf dem Desktop: Entwicklung von Remix OS und Remix IO eingestellt


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ Remix OS for PC, Remix IO/IO+ 4K HDR Android Media Boxes Are Now Discontinued


๐Ÿ“ˆ 27.76 Punkte

๐Ÿ“Œ How I Built Microservices In Go In 30 Minutes


๐Ÿ“ˆ 20.83 Punkte

๐Ÿ“Œ How I Built a Custom GPT-Based Chatbot in Under 10 Minutes with LlamaIndex


๐Ÿ“ˆ 20.83 Punkte

๐Ÿ“Œ I built NextJS starters directory in 54 minutes


๐Ÿ“ˆ 20.83 Punkte

๐Ÿ“Œ How we Built a 20 Billion Dollar Company in 20 minutes


๐Ÿ“ˆ 20.83 Punkte

๐Ÿ“Œ How we ran a Unix-like OS (Xv6) on our home-built CPU with our home-built C compiler


๐Ÿ“ˆ 19.24 Punkte

๐Ÿ“Œ If Android were to be built today, which parts of it could be built with mainstream GNU/Linux components? (i.e.: glibc and not bionic)


๐Ÿ“ˆ 19.24 Punkte

๐Ÿ“Œ So I Built This: Broadening the Impact of What Youโ€™ve Built in the Lab


๐Ÿ“ˆ 19.24 Punkte

๐Ÿ“Œ Tipp: Neue Story Remix App gibts nicht automatisch fรผr alle Insider


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ Tipp: Neue Story Remix App gibts nicht automatisch fรผr alle Insider


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ GarageBand drops new in-app Remix Sessions featuring Katy Perry and SEVENTEEN


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ Adding Sign In With Google To A Remix App From Scratch


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ Adding passkeys to a Remix App


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ Building a full stack app with Remix, Prisma, and Neon


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ Story Remix: Microsoft testet neuen Namen fรผr Windows 10 Foto-App


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ Story Remix: Microsoft testet neuen Namen fรผr Windows 10 Foto-App


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ Vollversion: DJ Mixer - DJ Music Remix Pro - Android App 1.0.8 Englisch


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ How to Create Shopify App And Extension With Remix


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ How to create a simple remix app- A beginner guide


๐Ÿ“ˆ 16.62 Punkte

๐Ÿ“Œ New App Gives Free Movie Tickets To People Who Watch 15 Minutes of Ads


๐Ÿ“ˆ 13.95 Punkte

๐Ÿ“Œ Deus ex hackina: It took just 10 minutes to find data-divulging demons corrupting Pope's Click to Pray eRosary app


๐Ÿ“ˆ 13.95 Punkte

๐Ÿ“Œ Improve device integration for your Web App in just a few minutes


๐Ÿ“ˆ 13.95 Punkte

๐Ÿ“Œ Android App Excellence Summit in 9 minutes


๐Ÿ“ˆ 13.95 Punkte

๐Ÿ“Œ Protected: Improve your Meeting Minutes with Airgram AI Meeting Assistant App


๐Ÿ“ˆ 13.95 Punkte

๐Ÿ“Œ The Untold Secrets to Flutter App Development in Less Than Ten Minutes


๐Ÿ“ˆ 13.95 Punkte











matomo