Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
166.41k stars 44.05k forks source link

[Builder] Implementation of Error and Loading boundaries NextJS #7712

Closed andrewhooker2 closed 4 days ago

andrewhooker2 commented 1 month ago

Duplicates

Summary 💡

We should implement NextJS 14's built-in loading.tsx and error.tsx file naming conventions throughout our project. This would replace the current standard React approach to loading states and error handling.

The feature should work as follows:

Examples 🌈

NextJS documentation provides excellent examples of how these conventions work:

Loading UI: https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming Error Handling: https://nextjs.org/docs/app/building-your-application/routing/error-handling

Motivation 🔦

What is the motivation behind the feature ask?

Currently, our developers are not utilizing NextJS 14's loading.tsx and error.tsx conventions. Instead, they're implementing loading states and error handling using standard React methods.

This approach has several drawbacks:

By adopting NextJS 14's conventions, we can:

andrewhooker2 commented 1 month ago

@Swiftyos If you don't mind I would like to implement this in our Application. This will help with maintaining a clean codebase that reflects to the standard practices of NextJS 14's App Router.

Swiftyos commented 1 month ago

@Swiftyos If you don't mind I would like to implement this in our Application. This will help with maintaining a clean codebase that reflects to the standard practices of NextJS 14's App Router.

Yeah that would be fantastic

andrewhooker2 commented 2 weeks ago

@Swiftyos Feel free to checkout the PR I've linked above.

One callout here would be that to see better UX for our users it would be ideal for use to leverage more server side components and less client side components. This would require a larger refactor consideration and is not part of this changes at the moment.