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

Refactoring DataFunctionArgs to LoaderFunctionArgs and ActionFunctionArgs #573

Closed
diegotc86 opened this issue Dec 23, 2023 · 3 comments
Closed

Comments

@diegotc86
Copy link
Contributor

Hi Kent,

I've noticed that The Epic Stack is utilizing DataFunctionArgs for the loaders and actions arguments, while the Remix documentation now advises using LoaderFunctionArgs and ActionFunctionArgs. If you think updating this would be beneficial, I'd be happy to assist.

The action plan involves identifying all instances where DataFunctionArgs is used, replacing it with the appropriate type, and updating the imports as needed.

P.S.: I've already located these instances. My only uncertainty is regarding the file entry.server.ts, where DataFunctionArgs is employed to type the handleError function. I believe LoaderFunctionArgs would be a suitable replacement here.

@jacobparis
Copy link
Contributor

jacobparis commented Dec 28, 2023

This will need to be addressed before Client Data comes to the Epic Stack, and since it's in unstable pre-release now I think it'd be a good time

remix-run/remix#7634 (comment)

Regarding handleError, I think we can actually delete it? It doesn't appear to be used https://github.com/search?q=repo%3Aepicweb-dev%2Fepic-stack%20handleError&type=code

@kentcdodds
Copy link
Member

I'm really bummed about this decision by Remix, but whatever it's fine.

handleError is used by remix: https://remix.run/docs/en/main/file-conventions/entry.server#handleerror

Anyone can feel free to make this change. PRs welcome.

@jacobparis
Copy link
Contributor

handleError is used by remix: https://remix.run/docs/en/main/file-conventions/entry.server#handleerror

Ah makes sense, then @diegotc86 as documented there you can use the type LoaderFunctionArgs | ActionFunctionArgs for that function

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

No branches or pull requests

3 participants