Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Upgrade #1422

Closed
Da-Colon opened this issue Mar 8, 2024 · 3 comments · Fixed by #1431
Closed

Static Upgrade #1422

Da-Colon opened this issue Mar 8, 2024 · 3 comments · Fixed by #1431
Assignees
Labels
enhancement New feature or request maintenance Keep the lights on

Comments

@Da-Colon
Copy link
Contributor

Da-Colon commented Mar 8, 2024

Description:

In light of recent discussions and recurring issues attributed to Server-Side Rendering (SSR) complexities and our current infrastructure setup, I've come to realize that a significant refactor might be beneficial, potentially without the need to entirely remove NextJS from our stack.

Issue Overview:

Our current usage of NextJS and its handling of SSR has introduced challenges, particularly in how it distinguishes between Server Components and Client Components based on the component's data. The decision-making process behind the mounting of these components is opaque, leading to unnecessary re-renders as NextJS mounts components and processes the data.

Proposed Solution:

I suggest we transition from the current AppRouter setup to a Page Router setup. This approach aims to simplify the process of exporting a static site by minimizing NextJS's inference over our component system. It should provide a more straightforward and controlled environment for managing component rendering and data handling on the client and server sides.

Considerations:

  • We need to carefully review and potentially adjust the loadKey configurations and the conditional logic within useEffect hooks. These have been previously implemented to address re-render issues but may not align with the new architecture's logic and performance optimizations.
  • This refactor requires thorough testing to ensure that moving to a Page Router setup does not introduce new issues or negatively impact the user experience.
  • This may require an update to Netlify's Configurations
@Da-Colon Da-Colon added this to Decent Mar 8, 2024
@Da-Colon Da-Colon converted this from a draft issue Mar 8, 2024
@Da-Colon Da-Colon moved this to In progress in Decent Mar 8, 2024
@Da-Colon Da-Colon added enhancement New feature or request maintenance Keep the lights on labels Mar 8, 2024
@Da-Colon Da-Colon linked a pull request Mar 8, 2024 that will close this issue
@Da-Colon Da-Colon linked a pull request Mar 11, 2024 that will close this issue
@Da-Colon Da-Colon moved this from In progress to In review in Decent Mar 11, 2024
@Da-Colon
Copy link
Contributor Author

Update:

@tomstuart123 @adamgall @mudrila

The Past

So there are two PRs attached to this issue.

In the first PR #1421 , I approached this with the attempt to make NEXTJS static. To this goal I move away from the App Router setup to the Page Router setup. This change removes alot of the inferring that NextJS as its expected a SSR setup. This change ultimately resulted in a statically built app which we can see in the build logs in console.

This works. The deployed app in the preview of that PR is running as mostly a statically built site. There is still a 'server' being built and when running dev environment locally some errors pop up on every load as NextJSi continues to use SSR for local dev and it hydrates weirdly in the setup.

The Present

So we get to PR #1431 , This Development experience would not be great, so I took the plunge to remove NextJS in its entirely and replace the build framework to vite. The details of the changes are in the PR. It really wasn't too bad and I don't expect any new issues to arise.

I manually created a deploy on the branch since the env changed @adamgall I just used my keys for now since its temporary) to test the deployed site.

@adamgall
Copy link
Member

adamgall commented Mar 11, 2024

Freakin Epic, this is Great Timing, @Da-Colon

@adamgall
Copy link
Member

Increasing the "end date" on this issue, to account for the fact that the scope of this Issue (and associated PRs) has increased since it was started.

This issue is now, as @Da-Colon stated in his previous message, encompassing the removal of NextJS from this codebase.

@github-project-automation github-project-automation bot moved this from In review to Done in Decent Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance Keep the lights on
Projects
Status: Done
2 participants