Week 08: GSoC’23 with OpenMRS

Topherlumu
2 min readJul 26, 2023

--

Hello everyone! Welcome to my eighth-week update for my Google Summer of Code (GSoC) project.

Throughout the last week, I focused on migrating the existing Appointments Form to React Hook Form (RHF) and Zod for validation. I aimed to improve the performance, maintainability, and user experience of the form while ensuring data integrity with robust validation.

The Appointments Form is a critical component of this system, allowing users to schedule appointments with ease. By leveraging RHF and Zod, I wanted to replace the older vanilla react form implementation and bring modern best practices to our application.

Progess Pull Request

React Hook Form (RHF) has been instrumental in achieving my goals. It’s a more performant and straightforward library for managing form state and validation in React applications. Its hook-based approach allows me to handle form logic efficiently while keeping my components clean and reusable. Adopting RHF significantly reduces boilerplate code and improves the form’s responsiveness.

During the migration process, I encountered a few challenges. Adapting the existing form logic and validation to the new RHF and Zod setup required careful execution and testing. Some fields required additional transformations before validating with Zod, but I managed to find efficient solutions.

I observed improved performance due to RHF’s efficient rendering and validation process, resulting in a smoother user experience. The new form implementation is more organized, modular, and easier to maintain, making future updates and additions almost hassle-free. With Zod’s strict validation rules, I can ensure data integrity and minimize the risk of erroneous or incomplete appointments.

As I enter the final weeks of GSoC, I’m excited about the remaning integrations.

That’s all for this week! Thank you for following my progress. I’d love to hear your thoughts and feedback in the comments below.
Happy coding!

--

--