-
Notifications
You must be signed in to change notification settings - Fork 25
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
Recommended changes to getting started guide #228
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for remix-forms ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
apps/web/app/routes/get-started.tsx
Outdated
it will return structured error messages for us. You can also put this | ||
in the route where you'll be submitting a form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is not a good practice as domain functions usually have server side code.
I use to put my schemas in a app/domain/some-domain
folder so they can be used in their related domain function. I also keep my domain functions away from the route as there's no need (and often there are problems) to send that code to the client bundle.
Now that we have route folders in Remix v2 you could create those functions in separate files under that route's folder but it is important to make sure you only use them in either loaders or actions so it won't be sent to the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'm writing short mutations inline in the formAction
, but worth clarifying! Let me update the patch.
Thank you for taking the time and contributing to this repo!! I appreciate it. However it is important to keep in mind that any code which is not part of the Remix's magic exports (loader, action, meta, etc) will be sent to the client. Maybe we should make some changes to clarify that, what do you think @boazsender ? |
Good call @gustavoguichard. I've tried adding some language. Let me know what you think. Happy to make further changes. |
Looking much better IMO. |
It took me a minute to understand that we had moved into the route around the 'compose a zod schema' section of the getting started section. I thought it might help future readers to be more explicit about that.