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

Record type misleading issue #6426

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

MiniPiku
Copy link
Contributor

Key Changes:

  1. Added typedef Explanation:

    • Added a section explaining how to use typedef to name record types.
    • Provided an example of defining and using a UserProfile record type.
  2. Improved Readability:

    • Clarified that typedef can be used to improve code readability and reusability.

1. Renamed the variable json to data throughout the section.
2. Updated the text to clarify that the example works with deserialized data (e.g., parsed from JSON) rather than raw JSON strings.
3. Ensured consistency in variable naming and explanations.

This update makes the documentation more accurate and avoids misleading readers into thinking that the variable holds a JSON string. If you’re contributing to the Dart documentation, you can submit this change as a pull request to the [site-www repository](https://github.com/dart-lang/site-www)
1. **Added 	ypedef Explanation:**
   - Added a section explaining how to use 	ypedef to name record types.
   - Provided an example of defining and using a UserProfile record type.

2. **Improved Readability:**
   - Clarified that 	ypedef can be used to improve code readability and reusability.
@MiniPiku
Copy link
Contributor Author

@parlough can you review this PR please
thank you :)

@parlough parlough self-requested a review February 20, 2025 02:54
@MiniPiku
Copy link
Contributor Author

@parlough just a follow up comment for reviewing this PR
thank you

Copy link
Member

@parlough parlough left a comment

Choose a reason for hiding this comment

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

Thanks so much for this thoughtful PR @MiniPiku! And sorry again for the delay in reviewing it.

It looks like a lot of this was covered in #6382 which was reviewed over the past month and resulted in a new Records and typedefs section.

Could you take a look at that new section and see if its content is sufficient for what you were imagining? If it is, then perhaps you could simplify your PR to instead cross link to that new section from the "Record types" section to avoid repeating too much.

Let me know what you think. Thanks again :D

Copy link
Member

Choose a reason for hiding this comment

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

It looks like this PR also has some remnants from other branches. Let me know if you need help removing these unrelated changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you mention the area that are not related to this PR
will delete those files from commit

Copy link
Member

Choose a reason for hiding this comment

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

It seems you removed most of those changes now, thanks!

The records.md~ (with a ~ after the filename) file is still there though. It seems to be an accidental copy of the records.md file.

Copy link
Member

@parlough parlough left a comment

Choose a reason for hiding this comment

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

Seems some of my original comments got lost, so I added similar comments back. Thanks for continuing on this improvement!

Copy link
Member

Choose a reason for hiding this comment

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

It seems you removed most of those changes now, thanks!

The records.md~ (with a ~ after the filename) file is still there though. It seems to be an accidental copy of the records.md file.

There is no type declaration for individual record types. Records are structurally
typed based on the types of their fields. A record's _shape_ (the set of its fields,
the fields' types, and their names, if any) uniquely determines the type of a record.
Records are structurally typed based on the types of their fields.
Copy link
Member

Choose a reason for hiding this comment

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

It seems my review comment got lost here, perhaps from the force push? I'm not sure, sorry about that!

I think adding this clarification is nice, but from another PR worked on last month, a new section called Records and typedefs was added that already covers much of this.

What do you think about keeping this introduction mostly the same as it was, and adding new text cross-link to that new section? That way this text can be shorter and focused and we don't end up repeating ourselves.

Let me know. I can help brainstorm some cross-link text as well if you get stuck. Thanks again for working on this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i guess the crosslink would be better in this case
should i delete the previous content and just add the crosslink with a single line introduction text
or the previous text remains same with the crosslink addition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and how do i resolve the experterts are up-to-date issue
as dart run dart_site refresh-excerpts --fail-on-update --dry-run this cmd is not working

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

Successfully merging this pull request may close these issues.

2 participants