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

chore: Project setup #277

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

chore: Project setup #277

wants to merge 2 commits into from

Conversation

Ahmed-Ali
Copy link

@Ahmed-Ali Ahmed-Ali commented Jun 23, 2024

The changes in this PR consolidate the project setup modifications. They primarily focus on package.json configurations, dependency versions, workspace setup, .gitignore, submodules, and minor renaming of existing native APIs.

Context

We are rebuilding our React Native (RN) SDK to support Customer.io's Data Pipelines.

Public Changes

  • SDK Changes
    • Modernized our RN package to use the latest configurations and dependencies available in RN version 0.74.2.
    • Simplified our configuration to provide the minimum number of settings that make sense for our customers.
    • Added support to view native debug logs directly in the console alongside other console.* logs.
  • Example Apps
    • Created customer-oriented example apps where you can build, run, debug, and see the SDK usage in the App.tsx file.

Internal Changes

  • SDK Dev Environment Setup
    • Removed the pre-push hook that runs lint, as it can be challenging when lint fails before a push in a PR stack setup. Linting has been moved to the pre-commit hook.
    • Implemented yarn workspace for easier management of example apps.
    • Configured example apps to point to local paths for all native CIO pods, facilitating easier debugging and validation of native changes.
    • Made the native iOS repo a git submodule of this repo, simplifying the process of starting and validating relevant native changes within the RN repo.
    • Unified the example app codebase for both APN and FCM configurations, making it easier to maintain.
    • Included yarn release to ensure a consistent development experience.
    • Added yarn.lock to .gitignore.

QA Setup

  • Dev endpoints for QA can still be set in the example apps with a long-press on the settings button. This allows us to perform QA configurations without affecting customer-oriented examples.

PR Stack:

@Ahmed-Ali Ahmed-Ali force-pushed the feature/cdp/project-setup branch from 16a6af2 to 0a9f81e Compare June 24, 2024 09:32
@ami-aman ami-aman marked this pull request as ready for review August 9, 2024 18:37
@ami-aman ami-aman requested a review from a team August 9, 2024 18:44
@ami-aman
Copy link
Collaborator

ami-aman commented Aug 9, 2024

The PR stack might shift as new PRs are created from this branch. We’ll be opening smaller PRs aligned with milestones and tickets to facilitate easier review and testing.

# Yarn
.yarn/install-state.gz
yarn.lock

Copy link
Collaborator

Choose a reason for hiding this comment

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

Moving yarn.lock out of .gitignore as missing lock file is throwing error when example project is run. Here is the detail if you want to learn more about the yarn error.

@ami-aman ami-aman requested a review from a team August 9, 2024 18:54
Copy link
Contributor

@Shahroz16 Shahroz16 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, couple of suggestions and 1 important question about the submodule being pushed as part of the package.

@@ -0,0 +1,3 @@
[submodule "cio-native-sdks/customerio-ios"]
path = cio-native-sdks/customerio-ios
url = https://github.com/customerio/customerio-ios
Copy link
Contributor

Choose a reason for hiding this comment

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

We should ideally add branch in here, will help with testing changes on a specific branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

When this package gets pushed to npm, is this directory excluded?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not see this directory in gitignore file hence I assume that it will be pushed to npm.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But I believe it should be ideally in .gitignore or .npmignore. I am sure there are reasons behind Ahmed proposing using ios native SDK as a sub-module and one of them is "Made the native iOS repo a git submodule of this repo, simplifying the process of starting and validating relevant native changes within the RN repo." but this also makes me wonder if this change is to help testing or some other reason that's not called out.

"!android/gradle",
"!android/gradlew",
"!android/gradlew.bat",
"!android/local.properties",
Copy link
Contributor

Choose a reason for hiding this comment

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

i'll probably add .idea/ in the ignore too

Copy link
Collaborator

Choose a reason for hiding this comment

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

.idea/ is already in .gitignore. Is it something else you're referring to ?

"!**/__tests__",
"!**/__fixtures__",
"!**/__mocks__",
"!apps"
"!**/.*"
],
"scripts": {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should probably add another script to fetch the latest submodule changes. thoughts?

    "postinstall": "git submodule update --init --recursive && git submodule foreach git pull origin main"

"react-native": "0.74.2",
"react-native-builder-bob": "^0.23.2",
"release-it": "^17.4.0",
"turbo": "^2.0.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to go ahead with Turbo ?

@@ -1,6 +1,6 @@
#import <React/RCTBridgeModule.h>

@interface RCT_EXTERN_MODULE(CustomerioPushMessaging, NSObject)
@interface RCT_EXTERN_REMAP_MODULE(CustomerioPushMessaging, CustomerioPushMessaging, NSObject)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is RCT_EXTERN_REMAP_MODULE for ?

"react": "18.2.0",
"react-native": "0.74.2",
"react-native-builder-bob": "^0.23.2",
"release-it": "^17.4.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to use release-it?

@ami-aman ami-aman marked this pull request as draft August 12, 2024 18:27
Base automatically changed from feature/cdp-main to main October 16, 2024 20:46
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