Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Newsletter_sign-up_form_Typescript_HTML_SCSS

P
Gilbert 290

@juliengDev

Desktop design screenshot for the Newsletter sign-up form with success message coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am proud of several aspects of the project, particularly the implementation of TypeScript for enhanced type safety. This not only made the codebase more robust but also improved the overall developer experience with better autocompletion and error detection.

Organizationally:

•	I grouped DOM elements within an interface, which brought a structured approach to handling DOM manipulations.
•	The code is segmented into smaller, more specific functions, emphasizing clarity and readability.
•	By focusing on reusability, utility functions can be easily reused across different parts of the project, reducing redundancy and promoting efficient coding practices.
•	The modular structure of the codebase ensures that future modifications are straightforward and less error-prone.

Additionally, I implemented email field validation both at the HTML level and using a regex tailored to the expected data type. This dual-layered approach enhances the reliability of the form validation process, ensuring that incorrect email formats are caught early.

What challenges did you encounter, and how did you overcome them?

I have a strong recent experience with React and am accustomed to a declarative programming approach rather than an imperative one. The challenge here was to seriously reacquaint myself with vanilla JavaScript for this project, utilizing a functional programming paradigm.

What specific areas of your project would you like help with?

TypeScript Code Logic

  • I am interested in having a review of my TypeScript code to identify any areas where the logic can be improved.
  • I would appreciate suggestions on how to enhance the type safety and overall structure of the code.

Code Organization and Structure

Feedback on how the code is organized, particularly with respect to the separation of concerns and modularization, would be valuable.

  • Are there any best practices I can adopt to make the code more maintainable and scalable?

Form Validation Approach

  • I implemented email validation both at the HTML level and using regex. I am open to constructive criticism on this approach and any recommendations for more effective methods or libraries.

Performance Optimization

  • Any tips on optimizing the performance of my code, especially with respect to form handling and DOM manipulation, would be greatly appreciated.

Usability and User Experience

  • Suggestions on how to improve the user experience, particularly in terms of providing clear and actionable feedback for form validation errors.

Community feedback

P
Moa Davou 310

@moadavou

Posted

The solution looks great! I can't give any feedback since I'm not familiar with Typescript yet (writing this as a part of the Learning Paths)...

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord