-
Notifications
You must be signed in to change notification settings - Fork 88
(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
(DOCSP-26985): @realm/reactify: UUID - React Native SDK #2443
Conversation
Readability for Commit Hash: fd09182 You can see any previous Readability scores (if they exist) by looking Flesch Reading Ease scores for changed documents:
The following table can be helpful in assessing the readability score of a document.
|
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.
@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 | ||
----- |
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.
[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. |
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.
[blocker] Incomplete sentence. Was there supposed to be more after "that"?
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.
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. |
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.
[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>`. |
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.
[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:
- 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. |
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.
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 |
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.
[capitalization] Realm object should have a capital R.
In the following ``CreateProfileInput`` example, we create a ``Profile`` realm | |
In the following ``CreateProfileInput`` example, we create a ``Profile`` Realm |
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.
Fixed locally
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.
Thanks for making changes, @mongomoe! This looks great. 🚢
## 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]>
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.
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
## 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]>
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.
Review Guidelines
REVIEWING.md