Skip to content

(DOCSP-26985): @realm/reactify: UUID - React Native SDK #2443

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

Conversation

mohammadhunan-dev
Copy link
Contributor

@mohammadhunan-dev mohammadhunan-dev commented Dec 28, 2022

Pull Request Info

Jira

Staged Changes

Reminder Checklist

If your PR modifies the docs, you might need to also update some corresponding
pages. Check if completed or N/A.

  • [N/A] Create Jira ticket for corresponding docs-app-services update(s), if any
  • [N/A] Checked/updated Admin API
  • [N/A] Checked/updated CLI reference

Review Guidelines

REVIEWING.md

@mohammadhunan-dev mohammadhunan-dev changed the base branch from master to realm-react-guidance December 28, 2022 00:01
@github-actions
Copy link

github-actions bot commented Dec 28, 2022

Readability for Commit Hash: fd09182

You can see any previous Readability scores (if they exist) by looking
at the comment's history.

Flesch Reading Ease scores for changed documents:

  • source/sdk/react-native/realm-database/schemas/uuid: 57.87

The following table can be helpful in assessing the readability score of a document.

Score Difficulty
90-100 Very Easy
80-89 Easy
70-79 Fairly Easy
60-69 Medium
50-59 Fairly Hard
30-49 Hard
0-29 Very Hard

@mohammadhunan-dev mohammadhunan-dev changed the title (DOCSP-26985): UUID object (DOCSP-26985): @realm/reactify: UUID - React Native SDK Dec 28, 2022
Copy link
Collaborator

@krollins-mdb krollins-mdb left a comment

Choose a reason for hiding this comment

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

@mongomoe, this looks great! I did notice one thing that should be addressed: one of the list items seems to be incomplete. Could be a simple fix, but it currently leaves readers hanging.

:tabid: javascript

.. literalinclude:: /examples/generated/react-native/js/Profile.snippet.js-profile-schema.js
:language: javascript

Usage
-----
Copy link
Collaborator

Choose a reason for hiding this comment

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

[minor] I know you didn't change line 38 in this PR, but we may want to remove "the string". I think readers will understand its a string, and mentioning it here may confuse some readers - make them think that the object type is a string.

The ``CreateProfileInput`` component does the following:

- Get access to the opened realm instance by calling the ``useRealm()`` hook.
- Create a name `state variable <https://reactjs.org/docs/hooks-state.html>`__ called "name" that.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[blocker] Incomplete sentence. Was there supposed to be more after "that"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 👍

Create a name `state variable <https://reactjs.org/docs/hooks-state.html>`__ called "name" that represents the name of the profile.


The ``CreateProfileInput`` component does the following:

- Get access to the opened realm instance by calling the ``useRealm()`` hook.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[grammar] Because all of these list items share the same subject (the component), their starting verbs should agree with the singular subject.

For example, "The CreateProfileInput component ... Gets access to ...."

- Get access to the opened realm instance by calling the ``useRealm()`` hook.
- Create a name `state variable <https://reactjs.org/docs/hooks-state.html>`__ called "name" that.
- Create a ``createProfile`` method that performs a write transaction. Within that write transaction, we :ref:`create <react-native-create-a-new-object>` a ``Profile`` object with the ``name`` value of the "name" state variable and an ``_id`` value of a new ``UUID`` object.
- Renders a ``TextInput`` component that allows the user to enter a name for the profile. When the user presses the "Create Profile" button, the ``createProfile`` method is called and creates the ``Profile`` :js-sdk:`Realm.Object <Realm.Object.html>`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[minor] The way this is worded, it could be read that the createProfile method creates a Profile called Realm.Object.

I suggest re-writing to avoid this ambiguity. Also, moving the link up to when we first mention realm object on line 47 could help. Something like this could work:

Suggested change
- Renders a ``TextInput`` component that allows the user to enter a name for the profile. When the user presses the "Create Profile" button, the ``createProfile`` method is called and creates the ``Profile`` :js-sdk:`Realm.Object <Realm.Object.html>`.
- Renders a ``TextInput`` component that allows the user to enter a name for the profile. When the user presses the "Create Profile" button, the ``createProfile`` method is called and creates a ``Profile`` Realm object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the link up, but reworded the sentence slightly different than your suggestion:

- Renders a ``TextInput`` component that allows the user to enter a name for the profile. When the user presses the "Create Profile" button, the ``createProfile`` method is called and creates a ``Profile`` object.

Example
~~~~~~~

In the following ``CreateProfileInput`` example, we create a ``Profile`` realm
Copy link
Collaborator

Choose a reason for hiding this comment

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

[capitalization] Realm object should have a capital R.

Suggested change
In the following ``CreateProfileInput`` example, we create a ``Profile`` realm
In the following ``CreateProfileInput`` example, we create a ``Profile`` Realm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed locally

Copy link
Collaborator

@krollins-mdb krollins-mdb left a comment

Choose a reason for hiding this comment

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

Thanks for making changes, @mongomoe! This looks great. 🚢

@mohammadhunan-dev mohammadhunan-dev merged commit ff70e2f into mongodb:realm-react-guidance Jan 4, 2023
mongodben pushed a commit that referenced this pull request Feb 10, 2023
## Pull Request Info

### Jira

- https://jira.mongodb.org/browse/DOCSP-26985

### Staged Changes

- [UUID - React Native
SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-26985-uuid-object/sdk/react-native/realm-database/schemas/uuid/)

### Reminder Checklist

If your PR modifies the docs, you might need to also update some
corresponding
pages. Check if completed or N/A.

- [N/A] Create Jira ticket for corresponding docs-app-services
update(s), if any
- [N/A] Checked/updated Admin API
- [N/A] Checked/updated CLI reference

### Review Guidelines


[REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)

Co-authored-by: Mohammad Hunan Chughtai <[email protected]>
Copy link
Collaborator

@takameyer takameyer left a comment

Choose a reason for hiding this comment

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

It wasn't clear right away where UUID lives until I read the example (Realm.BSON.UUID). I think it would be good to indicate this somehow.

Other than that, LGTM

mongodben pushed a commit that referenced this pull request Mar 21, 2023
## Pull Request Info

### Jira

- https://jira.mongodb.org/browse/DOCSP-26985

### Staged Changes

- [UUID - React Native
SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-26985-uuid-object/sdk/react-native/realm-database/schemas/uuid/)

### Reminder Checklist

If your PR modifies the docs, you might need to also update some
corresponding
pages. Check if completed or N/A.

- [N/A] Create Jira ticket for corresponding docs-app-services
update(s), if any
- [N/A] Checked/updated Admin API
- [N/A] Checked/updated CLI reference

### Review Guidelines


[REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)

Co-authored-by: Mohammad Hunan Chughtai <[email protected]>
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.

3 participants