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

docs: jokes app tutorial in fetching jokes part #3547

Merged
merged 9 commits into from
Jul 5, 2022

Conversation

justinsalasdev
Copy link
Contributor

@justinsalasdev justinsalasdev commented Jun 23, 2022

at point where reader is only done with building types for Joke, the example shows to import type User from @prisma/client where it is not there yet.

the succeeding code continuation also didn't use the built type from @prisma/client

at point where reader is only done with building types for `Joke`, the example shows to import `type User` from `@prisma/client`
@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Jun 23, 2022

Hi @justinsalasdev,

Welcome, and thank you for contributing to Remix!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Jun 23, 2022

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

use generated type in `type LoaderData`
@justinsalasdev justinsalasdev changed the title Update jokes tutorial User > Joke fix: jokes app tutorial in fetching jokes part Jun 23, 2022
pick from `type Joke` on projected query
@justinsalasdev justinsalasdev changed the title fix: jokes app tutorial in fetching jokes part docs: jokes app tutorial in fetching jokes part Jun 23, 2022
@machour machour added the docs label Jun 24, 2022
Copy link
Collaborator

@machour machour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @justinsalasdev !

Left you a couple of remarks to address.

docs/tutorials/jokes.md Outdated Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
* separated `json` import from `types` import
* imported `Joke` type on `findMany` example - placed directly below `import type`'s for grouping (updated line highlight for new lines added)
* removed `Pick` from projected example and replaced with `{ id:string, name:string }` - add line highlight so reader is aware that original `Joke` type needs to be edited
remove left-over market
@justinsalasdev justinsalasdev requested a review from machour June 25, 2022 06:09
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @justinsalasdev. Thanks for the PR.

As noted in the text right before your changes:

this is just an example. No need to copy/paste this 😄

It's only there to give you an idea of how things work as an example so you can finish the goal without looking at the finished version. We purposefully don't use Joke there. I think using Joke would be more confusing because it would lead people to believe that they need to make those changes to their code which they do not.

I'd be more in favor of changing the example completely to be something like Sandwich or something.

update example type from `Joke` to `Sandwich`
@justinsalasdev
Copy link
Contributor Author

Hi @justinsalasdev. Thanks for the PR.

As noted in the text right before your changes:

this is just an example. No need to copy/paste this 😄

It's only there to give you an idea of how things work as an example so you can finish the goal without looking at the finished version. We purposefully don't use Joke there. I think using Joke would be more confusing because it would lead people to believe that they need to make those changes to their code which they do not.

I'd be more in favor of changing the example completely to be something like Sandwich or something.

@kentcdodds, still can't believe I got an actual pr review from you ^__^
I must admit I have overlooked that example caveat. I skimmed the tutorial and found the User model so when I decided to do the tutorial, I got confused when it's importing User even do I haven't built it.

Overall, here are the changes I've done

  • changed example type from User to Sandwich
  • imported Joke type in answer portion and used it for findMany, also adjusted highlight numbers due to spaces added
  • used { id:string, name:string } type on fetch overload example, and highlight its change from Joke

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stellar. Thank you so much @justinsalasdev 👏

@kentcdodds kentcdodds merged commit f69a422 into remix-run:main Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants