PublicDataWorks / complaint-manager

Apache License 2.0
5 stars 0 forks source link

Evaluate if we should use Remix for v2.0 #571

Open paul-thompson1 opened 5 months ago

paul-thompson1 commented 5 months ago

Context: A production-grade React framework would eliminate the common problems faced when not using a framework. I have narrowed it down to Remix which seems suitable for our purposes.

What is Remix?

Can I use React without a framework?

paul-thompson1 commented 5 months ago

Investigate Remix

Context: A production-grade React framework would eliminate the common problems faced when not using a framework. I have narrowed it down to Remix which seems suitable for our purposes.

What is Remix? “Remix is a full-stack React framework with nested routing. It lets you break your app into nested parts that can load data in parallel and refresh in response to the user actions.” - React Documentation

Can I use React without a framework? “You can use React without a framework, however we’ve found that most apps and sites eventually build solutions to common problems such as code-splitting, routing, data fetching, and generating HTML. These problems are common to all UI libraries, not just React.” - React Documentation

Is Remix easy to implement and maintain? Remix Framework is designed with maintainability and implementation ease in mind, offering several features that contribute to these goals:

  1. Unified Codebase: Remix promotes a unified codebase for handling both client-side and server-side logic. This simplifies development, testing, and maintenance efforts by reducing the need to manage separate codebases or frameworks for different parts of the application.

  2. Convention over Configuration: Remix follows a "convention over configuration" approach, which means that it provides sensible defaults and conventions that developers can rely on. This reduces the need for manual configuration and boilerplate code, making it easier to get started with building applications.

  3. Developer Tools: Remix offers a suite of developer tools, including a built-in development server, hot reloading, and debugging utilities. These tools streamline the development process and provide immediate feedback, allowing developers to iterate quickly and troubleshoot issues effectively.

  4. Robust Routing: Remix provides a powerful routing system that enables developers to define routes, nested routes, and route parameters with ease. This allows for clear and intuitive navigation within the application, making it easier to manage complex page structures and user flows.

  5. Built-in Data Loading: Remix simplifies data loading by offering built-in strategies for fetching data on the server or client side. This makes it easier to manage data dependencies and ensure that pages are rendered with the necessary data, improving performance and user experience.

  6. Extensibility: Remix's plugin system allows developers to extend and customize its functionality to suit their specific needs. This enables the integration of third-party libraries, tools, and services, as well as the creation of reusable components and utilities, enhancing flexibility and maintainability.

Overall, Remix Framework emphasis on convention, developer tools, robust routing, data loading, and extensibility contributes to a development experience that is both straightforward and maintainable in the long run.

What value does it add? Remix adds a lot of value as a framework. Remix Framework offers several key values that make it stand out as a powerful tool for building web applications:

  1. Developer Experience (DX): Remix prioritizes developer experience by providing a modern and intuitive development environment. It offers features like built-in routing, server-side rendering, data loading strategies, and a powerful plugin system, all aimed at making the development process more efficient and enjoyable.

  2. Server-Side Rendering (SSR): Remix excels in server-side rendering, which enables fast initial page loads, improved SEO, and better accessibility. By rendering pages on the server and sending fully-formed HTML to the client, Remix ensures that users receive content quickly and consistently across devices and network conditions.

  3. Data Loading and Prefetching: Remix simplifies data loading by offering built-in strategies for fetching data on the server or client side. It provides tools for prefetching data before navigating to a new page, optimizing performance and reducing latency. Additionally, Remix's data loading features integrate seamlessly with its routing system, enabling efficient data fetching based on page transitions.

  4. Unified API: Remix promotes a unified API for handling both client-side and server-side logic, reducing the cognitive overhead associated with managing separate codebases or frameworks for different parts of the application. This unified approach streamlines development, testing, and maintenance efforts, leading to more maintainable and scalable codebases.

  5. Plugin Ecosystem: Remix's plugin system allows developers to extend and customize its functionality to suit their specific needs. This extensibility enables the integration of third-party libraries, tools, and services, as well as the creation of reusable components and utilities, fostering a vibrant ecosystem around the framework.

  6. Performance and Scalability: With its focus on server-side rendering, efficient data loading, and optimized client-side hydration, Remix delivers high performance and scalability out of the box. By leveraging techniques like code splitting, caching, and resource prioritization, Remix ensures that applications remain responsive and resilient under varying load conditions.

Overall, Remix Framework adds value by offering a comprehensive set of features, best practices, and development tools that empower developers to build fast, robust, and maintainable web applications with ease. Its emphasis on developer experience, server-side rendering, data loading, and extensibility makes it a compelling choice for modern web development projects.

How does Remix work with backend development? Here's how Remix works with backend development:

  1. Frontend Development: Remix provides a robust framework for building modern web applications with a strong emphasis on React components and client-side interactivity. It allows you to create reusable UI components and manage application state effectively.

  2. Backend Routing: Remix includes a powerful routing system that enables you to define routes for both frontend and backend components of your application. This means you can define routes that serve static content or dynamically generate responses from the server.

  3. Server-Side Rendering (SSR): Remix supports server-side rendering, which allows you to pre-render React components on the server and send the fully-rendered HTML to the client. This is beneficial for performance, SEO, and providing a consistent experience across different devices and browsers.

  4. Data Loading: Remix provides utilities for loading data on the server before rendering the page. This is useful for fetching initial data from APIs or databases, ensuring that the page is fully populated with content before it is sent to the client.

  5. Backend Logic: While Remix doesn't include a full-fledged backend framework like Express or Koa, it allows you to define backend logic within your routes using JavaScript or TypeScript. This includes handling form submissions, processing API requests, interacting with databases, and any other server-side operations your application requires.

  6. Middleware: Remix supports middleware, which allows you to intercept and modify requests and responses before they are processed by your route handlers. This is useful for implementing common functionality such as authentication, logging, error handling, and more.

  7. API Routes: Remix allows you to define API routes separately from your regular routes. These API routes can handle incoming requests and return JSON responses, making it easy to build RESTful APIs or integrate with external services.

  8. Authentication and Authorization: Remix provides features for implementing authentication and authorization in your application, including built-in support for OAuth providers and JWT tokens. This allows you to secure your backend routes and API endpoints based on user roles and permissions.

Overall, Remix combines frontend and backend development into a cohesive framework, allowing you to build full-stack web applications with a focus on performance, developer productivity, and maintainability.

paul-thompson1 commented 4 months ago

I will be done with the ADR by the end of Wednesday. Modifying the change organization script took more time than originally anticipated.