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

Refactor preexisting example app with focus on offline support #6172

Merged
merged 23 commits into from Oct 9, 2023

Conversation

elle-j
Copy link
Member

@elle-j elle-j commented Oct 3, 2023

What, How & Why?

Moves our existing React Native "Todo/Task Manager" example app from example/ to examples/rn-todo-list and refactors several parts of the app. (Only some files are relevant for review. See further below.)

The following has been updated/refactored:

  • It focuses on showcasing offline support and how to CRUD data.
  • Created more of a separation between business and view concerns.
    • This is structurally similar to our React and Electron Todo apps.
  • Updated the styles.
    • Since this example uses the same data model as our React/Wasm and Electron Todo examples, they can be demoed on these different platforms at the same time, using the same underlying App Services App.
    • To have them look and feel more cohesive, I've restyled this app to look similar.
  • As earlier, it provides two apps in one (one local-only and one Device Sync enabled).
    • Which one to use is configured by the developer.
    • The previous default in this config was local-only. This PR sets Device Sync as the default.
    • (This can be reverted if needed.)
  • The app has been removed from workspaces.
    • This also means it is not using our @realm/metro-config package.
    • If we find it more useful for us to have it be part of workspaces, I propose that we make those changes in a follow-up PR.
  • A README is provided along with the backend App Services App for users who prefer to set it up via the Realm CLI.

For more information and an overview of the project structure, see the README.

Not updated:

  • Our templates remain untouched.
    • As I understand it, the templates were very similar to this example app.
    • If needed, the templates can also get an upgrade at a later point :)

Main Files to Review

  • examples/rn-todo-list
    • frontend/app/
    • README.md

This closes #5825

☑️ ToDos

--

@coveralls-official
Copy link

coveralls-official bot commented Oct 3, 2023

Coverage Status

coverage: 85.388% (-0.02%) from 85.412% when pulling 0f59d22 on lj/refactor-example into 9913451 on main.

Copy link
Member

@kneth kneth left a comment

Choose a reason for hiding this comment

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

Thank you for migrating the old example so it can be included in our example collection.

examples/rn-todo-list/README.md Show resolved Hide resolved
examples/rn-todo-list/frontend/sync.config.js Show resolved Hide resolved
Copy link
Contributor

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

Looks good! Still need to find a way to make this "workspace"able. I do prefer not having to update all those xcode and android files. Perhaps we will end up using a new package manager to solve this issue.

@elle-j elle-j merged commit 0f790ce into main Oct 9, 2023
27 of 29 checks passed
@elle-j elle-j deleted the lj/refactor-example branch October 9, 2023 11:18
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example in RN: Offline login/ realm access
4 participants