Skip to content

Add React Native Migration Guide #875

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

Merged
merged 34 commits into from
Jan 30, 2025
Merged

Conversation

MongoCaleb
Copy link
Collaborator

@MongoCaleb MongoCaleb commented Jan 24, 2025

Copy link

netlify bot commented Jan 24, 2025

Deploy Preview for docs-app-services ready!

Name Link
🔨 Latest commit 98e5781
🔍 Latest deploy log https://app.netlify.com/sites/docs-app-services/deploys/679bc33d00885b000838cfbb
😎 Deploy Preview https://deploy-preview-875--docs-app-services.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 30 (🟢 up 1 from production)
Accessibility: 85 (no change from production)
Best Practices: 75 (no change from production)
SEO: 83 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@cbullinger cbullinger left a comment

Choose a reason for hiding this comment

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

Several URL-related items to correct. I think you can consider everything else as a suggestion 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest:

  • for all of the PDF links, add something to indicate it as a pdf
    • e.g. Ditto Reference Architecture Guide (PDF)
  • for links to external guides and docs, something indicating it's not MDB-hosted?
    • e.g. [Atlas Device Sync to Ditto migration guide] in the Ditto documentation
    • or Official [AWS AppSync documentation]?

@@ -12,6 +12,7 @@ Device Sync Deprecation
:hidden:

Migrate to AWS AppSync </sync/migration/awsappsync>
Migrate a React Native Application from Device Sync to PowerSync </sync/migration/reactnativetutorial>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Migrate a React Native Application from Device Sync to PowerSync </sync/migration/reactnativetutorial>
Tutorial: Migrate RN App from Device Sync to PowerSync </sync/migration/reactnativetutorial>

Do we really need to specify Device Sync here? Isn't it implied that's what you'd be migrating from?

solution and could be the right solution to migrate to if you have a mobile
application using Device Sync.

This article will guide you through the steps you need to take in order to
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
This article will guide you through the steps you need to take in order to
This tutorial will guide you through the steps needed to

Comment on lines 6 to 8
================================================================
Migrate a React Native Application from Device Sync to PowerSync
================================================================
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
================================================================
Migrate a React Native Application from Device Sync to PowerSync
================================================================
==========================================================================
Tutorial: Migrate a React Native Application from Device Sync to PowerSync
==========================================================================

again, do we need to specify from Device Sync here?

Copy link

@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.

Found a few formatting things. I appreciate all the work done here!

Would be important for someone to actually do the tutorial and ensure there aren't any technical pieces that do not work.

configure the PowerSync service, update the local database schemas and
bindings, and set up a backend service for writing to Atlas.

This tutorial uses a Realm todo list application for React Native available in the [realm2powersync example repository](https://github.com/takameyer/realm2powersync/tree/main).

Choose a reason for hiding this comment

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

This link was written in markdown. It appears to have not rendered correctly on the page. Ensure this and other links are formatted correctly

`PowerSync Security & IP Filtering <https://docs.powersync.com/installation/database-setup/security-and-ip-filtering>`__
documentation.

In the left sidebar, click **Network Access** under the Security heading.

Choose a reason for hiding this comment

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

Would it be useful to have imagery here as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We / you had an image here. Cory and I discussed, and felt like the size really broke up the flow and didn't add enough additional value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, so I cropped it and added a red box around the part that is important. LMK what you think.

~~~~~~~~~~~~~~~~

To finalize this setup, you will use the
`PowerSync Diagnostics App <https://diagnostics-app.powersync.com/login>`

Choose a reason for hiding this comment

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

This link didn't render correctly

- Mark items as done
- Delete items

.. image:: /images/migration/react_native_guide/image9.png

Choose a reason for hiding this comment

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

Image needs some constraints. It's taking up the entire page.


For this tutorial, you will modify ``source/ItemSchema.tsx`` as follows:

.. code-block:: bash

Choose a reason for hiding this comment

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

Suggested change
.. code-block:: bash
.. code-block:: javascript

Finally, update ``source/ItemListView.tsx`` to invoke the ``toggleViewAll``
method in the ``onValueChange`` attribute of the “Show All Tasks” switch:

.. code-block:: bash

Choose a reason for hiding this comment

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

Suggested change
.. code-block:: bash
.. code-block:: javascript


First, add the following to ``source/PowerSync.ts``:

.. code-block:: bash

Choose a reason for hiding this comment

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

Suggested change
.. code-block:: bash
.. code-block:: javascript

Next, refactor the ``source/OfflineModeButton.tsx`` to remove the Realm
functionality and replace it with by invoking the new method:

.. code-block:: bash

Choose a reason for hiding this comment

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

Suggested change
.. code-block:: bash
.. code-block:: javascript

Finally, open ``source/App.tsx`` and uncomment the ``headerRight``
component back into the ``Stack.Screen`` of the application:

.. code-block:: bash

Choose a reason for hiding this comment

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

Suggested change
.. code-block:: bash
.. code-block:: javascript


First, remove the default sync rules and replace them with the following:

.. code-block:: bash

Choose a reason for hiding this comment

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

Suggested change
.. code-block:: bash
.. code-block:: yaml

Is there a yaml formatter for code-block?

@MongoCaleb MongoCaleb requested a review from takameyer January 29, 2025 18:06
@MongoCaleb
Copy link
Collaborator Author

LGTM from @takameyer via Slack.

@MongoCaleb MongoCaleb merged commit 7b6924f into mongodb:master Jan 30, 2025
8 checks passed
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