Skip to content

Commit

Permalink
Consolidation Providers and Hooks (#3356)
Browse files Browse the repository at this point in the history
## Pull Request Info - SDK Docs Consolidation

Jira ticket: https://jira.mongodb.org/browse/DOCSP-41470

*Staged Page*

- [Providers &
Hooks](https://preview-mongodbosharafmdb.gatsbyjs.io/realm/react-providers-and-hooks/frameworks/react/providers-hooks/)

*Page Source*
- [RealmProvider
(@realm/react)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/react-native/api-reference/realm-provider/)
- [AppProvider
(@realm/react)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/react-native/api-reference/app-provider/)
- [UserProvider
(@realm/react)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/react-native/api-reference/user-provider/)

*Note*
This PR is built off a previous PR, [linked
here](#3339). The previous PR
had feedback from the original draft and the second draft after that.
The feedback from that second draft was then implemented to get what is
seen here.

### PR Author Checklist

Before requesting a review for your PR, please check these items:

- [x] Open the PR against the `feature-consolidated-sdk-docs` branch
instead of `master`
- [x] Tag the consolidated page for:
  - genre
  - meta.keywords
  - meta.description

#### Naming
- [x] Update Realm naming and the language around persistence
layer/local/device per [this
document](https://docs.google.com/document/d/126OczVxBWAwZ4P5ZsSM29WI3REvONEr1ald-mAwPtyQ/edit?usp=sharing)
- [ ] Include `.rst` files comply with [the naming
guidelines](https://docs.google.com/document/d/1h8cr66zoEVeXytVfvDxlCSsUS5IZwvUQvfSCEXNMpek/edit#heading=h.ulh8b5f2hu9)

#### Links and Refs
- [x] Create new consolidated SDK ref targets starting with "_sdks-" for
relevant sections
- [x] Remove or update any SDK-specific refs to use the new consolidated
SDK ref targets
- [ ] [Update any Kotlin API
links](https://jira.mongodb.org/browse/DOCSP-32519) to use the new
Kotlin SDK roles

#### Content
- [ ] Shared code boxes have snippets or placeholders for all 9
languages
- [ ] API description sections have API details or a generic placeholder
for all 9 languages
- [ ] Check related pages for relevant content to include
- [ ] Create a ticket for missing examples in each relevant SDK:
Consolidation Gaps epic

### Reviewer Checklist

As a reviewer, please check these items:

- [ ] Shared code example boxes contain language-specific snippets or
placeholders for every language
- [ ] API reference details contain working API reference links or
generic content
- [ ] Realm naming/language has been updated
- [ ] All relevant content from individual SDK pages is present on the
consolidated page
  • Loading branch information
osharaf-mdb authored Aug 9, 2024
1 parent 6ffd8b5 commit c2b6210
Show file tree
Hide file tree
Showing 16 changed files with 982 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import { APP_ID } from "../realm.config.json";
import { AppProvider, UserProvider, RealmProvider, useRealm, useUser } from "@realm/react";

export const AppWrapper = () => {
return (
<AppProvider id={APP_ID}> {/* pass in your App ID as a prop */}
<UserProvider>
<RealmProvider>
{/* call any app components here */}
</RealmProvider>
</UserProvider>
</AppProvider>
);
};
7 changes: 5 additions & 2 deletions source/frameworks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ Build with Frameworks
.. toctree::
:titlesonly:

React </frameworks/react>
React Native </frameworks/react-native>
Electron </frameworks/electron>
Flutter </frameworks/flutter>
Maui </frameworks/maui>
.NET </frameworks/dotnet>
React Native </frameworks/react-native>
SwiftUI </frameworks/swiftui>

The following pages contain information about building with specific
frameworks using Atlas Device SDK:

- :ref:`sdks-build-with-react`
- :ref:`sdks-build-with-react-native`
- :ref:`sdks-build-with-electron`
- :ref:`sdks-build-with-flutter`
- :ref:`sdks-build-with-maui`
- :ref:`sdks-build-with-dotnet`
- :ref:`sdks-build-with-react-native`
- :ref:`sdks-build-with-swiftui`
- :ref:`sdks-build-with-swiftui`
30 changes: 30 additions & 0 deletions source/frameworks/react.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. _sdks-build-with-react:

================
Build with React
================

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

.. toctree::
:titlesonly:

Install </frameworks/react/install>
Quick Start </frameworks/react/quick-start>
Providers & Hooks </frameworks/react/providers-hooks>
Model Data </frameworks/react/model-data>
Open & Manage Database Files </frameworks/react/manage-database-files>
Read & Write Data </frameworks/react/read-write>
React to Changes </frameworks/react/react-to-changes>
Access Atlas </frameworks/react/access-atlas>
Manage Users </frameworks/react/manage-users>
Sync Data </frameworks/react/sync-data>
Test & Debug </frameworks/react/test-debug>
API Reference </frameworks/react/api-reference>

Placeholder page for information about building with React. (This may
be a directory depending on how much content we have/need.)
14 changes: 14 additions & 0 deletions source/frameworks/react/access-atlas.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _sdks-react-access-atlas:

============
Access Atlas
============

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Placeholder page for information about building with @realm/react. (This may
be a directory as we have two pages for this?)
10 changes: 10 additions & 0 deletions source/frameworks/react/api-reference.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _sdks-react-api-reference:

===================================
API Reference
===================================

.. toctree::
:titlesonly:

JavaScript SDK Reference (@realm) <https://www.mongodb.com/docs/realm-sdks/js/latest/>
14 changes: 14 additions & 0 deletions source/frameworks/react/install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _sdks-react-install:

===================================
Install @realm/react in a React App
===================================

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Placeholder page for information about building with @realm/react. (This may
be a directory as we have two pages for this?)
14 changes: 14 additions & 0 deletions source/frameworks/react/manage-database-files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _sdks-react-manage-database-files:

============================
Open & Manage Database Files
============================

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Placeholder page for information about building with @realm/react. (This may
be a directory as we have two pages for this?)
14 changes: 14 additions & 0 deletions source/frameworks/react/manage-users.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _sdks-react-manage-users:

============
Manage Users
============

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Placeholder page for information about building with @realm/react. (This may
be a directory as we have two pages for this?)
14 changes: 14 additions & 0 deletions source/frameworks/react/model-data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _sdks-react-model-data:

==========
Model Data
==========

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Placeholder page for information about building with @realm/react. (This may
be a directory as we have two pages for this?)
Loading

0 comments on commit c2b6210

Please sign in to comment.