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

Split out api.ts into client vs server functions #1114

Open
mkst opened this issue Mar 9, 2024 · 1 comment
Open

Split out api.ts into client vs server functions #1114

mkst opened this issue Mar 9, 2024 · 1 comment
Labels

Comments

@mkst
Copy link
Collaborator

mkst commented Mar 9, 2024

Because we are doing useEffect in the api.ts, we have to use client to ensure all code runs on the client-side. There are functions that could (should?) run on the server side.

Describe the solution you'd like
Split the api file into api_client/api_server, and use the server functions where appropriate

Describe alternatives you've considered
I might be using it wrong.

@mkst mkst added the backend label Mar 10, 2024
@conorgolden1
Copy link
Contributor

This would require a rewrite of almost all of the api's that you want to be used in the server side. As almost all of them implement functionality that requires rendering on the client side (useSWR, useEffect, useRouter). I think that it would be most helpful to identify the api's that "need" to be rendered in the client side because we need to do more than just split the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants